Commit graph

30808 commits

Author SHA1 Message Date
bors
5cef16e9b3 auto merge of #15531 : steveklabnik/rust/guide_looping, r=brson 2014-07-15 05:56:19 +00:00
bors
2eadfe42e5 auto merge of #15511 : brson/rust/extract-rustc-back, r=alexcrichton
This was my weekend project, to start breaking up rustc. It first pulls out LLVM into `rustc_llvm`, then parts of `rustc::back` and `rustc::util` to `rustc_back`. The immediate intent is just to reduce the size of rustc, to reduce memory pressure when building rustc, but this is also a good starting point for further refactoring.

The `rustc_back` crate is definitely misnamed (`rustc::back` was never a very cohesive module anyway) - it's mostly just somewhere to stuff parts of rustc that don't have many deps. Right now it's main dep is `syntax`; it has no dep on `rustc_llvm`.

Some next steps might be to split `rustc_back` into `rustc_util` (with no `syntax` dep), and `rustc_syntax_util` (with a syntax dep); move the rest of `rustc::util` into `rustc_syntax_util`; move all of `rustc::front` to a new crate, `rustc_front`. At that point the refactoring necessary to keep extracting crates will get harder.
2014-07-15 04:16:20 +00:00
bors
b1ae09e52a auto merge of #15434 : steveklabnik/rust/guide_match, r=brson 2014-07-15 01:21:22 +00:00
kwantam
cf432b8f8f add Graphemes iterator; tidy unicode exports
- Graphemes and GraphemeIndices structs implement iterators over
  grapheme clusters analogous to the Chars and CharOffsets for chars in
  a string. Iterator and DoubleEndedIterator are available for both.

- tidied up the exports for libunicode. crate root exports are now moved
  into more appropriate module locations:
  - UnicodeStrSlice, Words, Graphemes, GraphemeIndices are in str module
  - UnicodeChar exported from char instead of crate root
  - canonical_combining_class is exported from str rather than crate root

Since libunicode's exports have changed, programs that previously relied
on the old export locations will need to change their `use` statements
to reflect the new ones. See above for more information on where the new
exports live.

closes #7043
[breaking-change]
2014-07-14 19:53:46 -04:00
kwantam
c066a1ee9f add UnicodeStrSlice width() function 2014-07-14 19:53:46 -04:00
bors
b733592adb auto merge of #15227 : alexcrichton/rust/windows-unlink, r=brson
Currently when a read-only file has unlink() invoked on it on windows, the call
will fail. On unix, however, the call will succeed. In order to have a more
consistent behavior across platforms, this error is recognized on windows and
the file is changed to read-write before removal is attempted.
2014-07-14 23:36:23 +00:00
Alex Crichton
fe67d269a5 std: Make unlink() more consistent
Currently when a read-only file has unlink() invoked on it on windows, the call
will fail. On unix, however, the call will succeed. In order to have a more
consistent behavior across platforms, this error is recognized on windows and
the file is changed to read-write before removal is attempted.
2014-07-14 14:24:50 -07:00
Nick Cameron
2bc6547a5a Borrow checking for overloaded indexing
Closes #15525
2014-07-15 09:05:06 +12:00
Brian Anderson
a008fc84aa Fix rebase fallout. Sorry. 2014-07-14 12:27:56 -07:00
Brian Anderson
3096d9bf94 rustc_llvm: Remove the inner llvm module
This makes it much saner for clients to use the library since
they don't have to worry about shadowing one llvm with another.
2014-07-14 12:27:08 -07:00
Brian Anderson
8e2e15f163 rustc_llvm: Remove an unnecessary workaround
Just some leftover junk from extracting llvm.
2014-07-14 12:27:08 -07:00
Brian Anderson
c199790077 rustc: Move util::sha2 to rustc_back 2014-07-14 12:27:08 -07:00
Brian Anderson
46266bd606 rustc: Move util::fs to rustc_back 2014-07-14 12:27:07 -07:00
Brian Anderson
be018645d8 rustc_back: Update crate docs
Indicate that anything that can be extracted here should and that things with
syntax deps should be split out someday.
2014-07-14 12:27:07 -07:00
Brian Anderson
504d4599e2 rustc: Move archive to rustc_back 2014-07-14 12:27:07 -07:00
Brian Anderson
55393493e1 rustc: Move ArchiveRO to rustc_llvm
It is a wrapper around LLVM.
2014-07-14 12:27:07 -07:00
Brian Anderson
7f6a66f77e rustc: Invert some archive deps 2014-07-14 12:27:07 -07:00
Brian Anderson
930abc1567 Extract rpath to rustc_back::rpath 2014-07-14 12:27:07 -07:00
Brian Anderson
c5a2ac1097 rustc: Invert some rpath dependencies 2014-07-14 12:27:07 -07:00
Brian Anderson
cf360f328a Extract librustc_back from librustc 2014-07-14 12:27:07 -07:00
Brian Anderson
d3096c2348 Move llvm bindings to their own crate 2014-07-14 12:27:07 -07:00
bors
e62479133b auto merge of #15666 : yorkie/rust/patch-1, r=alexcrichton 2014-07-14 18:06:22 +00:00
Yazhong Liu
7a199ba9f1 doc: missing quote in keyword Send 2014-07-15 01:26:41 +08:00
bors
61e84a5dca auto merge of #15655 : lightsofapollo/rust/glob-match-options-pub, r=alexcrichton
Not sure how to test this correctly I assume the current tests pass now because of the crate boundaries [and that this is fallout from private by default]?
2014-07-14 15:41:22 +00:00
bors
4e2da7cb79 auto merge of #15632 : masklinn/rust/patch-1, r=alexcrichton
I saw that it was bounded by `Show` but the implication is no guarantee (and had only 0.10 to test, where this behavior has been added to 0.11)
2014-07-14 13:51:29 +00:00
masklinn
ded48c5847 Document that Result.unwrap prints the Err's value
It is implied by the Show bound, but that implication can be missed.
2014-07-14 10:20:29 +02:00
James Lal
e4801da62f glob::MatchOptions struct fields should be public 2014-07-13 22:06:52 -07:00
bors
996263a015 auto merge of #15653 : erickt/rust/master, r=alexcrichton 2014-07-14 04:01:26 +00:00
bors
0a1e251e81 auto merge of #15497 : jasonthompson/rust/docs/str3, r=cmr
- for 3 implementations of into_maybe_owned()
  - is_slice()
  - is_owned()
2014-07-14 02:16:28 +00:00
bors
3d70f50b2c auto merge of #15649 : catharsis/rust/rust-libstd-examples, r=alexcrichton
This patch adds doc examples for the make_absolute, change_dir,
errors_string and args functions in the os module.
2014-07-14 00:31:30 +00:00
Erick Tryzelaar
c5edc70fad std: make std::io::IoError{,Kind} implement Eq 2014-07-13 16:28:01 -07:00
Kevin Butler
407fe9a08c mandelbrot: fix overlapping buffers 2014-07-13 23:52:11 +01:00
bors
a35774b128 auto merge of #15158 : alexcrichton/rust/windows-paths, r=brson
In order to have the spawning semantics be the same for unix/windows, the
child's PATH environment variable needs to be searched rather than the parent's
environment variable.

If the child is inheriting the parent's PATH, then no action need be taken as
windows will do the heavy lifting. If the child specifies its own PATH, then it
is searched beforehand for the target program and the result is favored if a hit
is found.

cc #15149, but does not close the issue because libgreen still needs to be
updated.
2014-07-13 22:46:28 +00:00
Alex Crichton
b1a964a9bf native: Search the child's PATH on win32
In order to have the spawning semantics be the same for unix/windows, the
child's PATH environment variable needs to be searched rather than the parent's
environment variable.

If the child is inheriting the parent's PATH, then no action need be taken as
windows will do the heavy lifting. If the child specifies its own PATH, then it
is searched beforehand for the target program and the result is favored if a hit
is found.

cc #15149, but does not close the issue because libgreen still needs to be
updated.
2014-07-13 14:06:20 -07:00
bors
ffd9966c79 auto merge of #15591 : aturon/rust/box-cell-stability, r=alexcrichton
This PR is the outcome of the library stabilization meeting for the
`liballoc::owned` and `libcore::cell` modules.

Aside from the stability attributes, there are a few breaking changes:

* The `owned` modules is now named `boxed`, to better represent its
  contents. (`box` was unavailable, since it's a keyword.) This will
  help avoid the misconception that `Box` plays a special role wrt
  ownership.

* The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
  method is renamed to `downcast`, in both cases to improve clarity.

* The recently-added `AnySendOwnExt` extension trait is removed; it was
  not being used and is unnecessary.

[breaking-change]
2014-07-13 21:01:28 +00:00
Aaron Turon
e0ede9c6b3 Stabilization for owned (now boxed) and cell
This PR is the outcome of the library stabilization meeting for the
`liballoc::owned` and `libcore::cell` modules.

Aside from the stability attributes, there are a few breaking changes:

* The `owned` modules is now named `boxed`, to better represent its
  contents. (`box` was unavailable, since it's a keyword.) This will
  help avoid the misconception that `Box` plays a special role wrt
  ownership.

* The `AnyOwnExt` extension trait is renamed to `BoxAny`, and its `move`
  method is renamed to `downcast`, in both cases to improve clarity.

* The recently-added `AnySendOwnExt` extension trait is removed; it was
  not being used and is unnecessary.

[breaking-change]
2014-07-13 12:52:51 -07:00
Anton Lofgren
77c4b3d26d libstd: Add a few doc examples
This patch adds doc examples for the make_absolute, change_dir,
errors_string and args functions in the os module.
2014-07-13 21:17:51 +02:00
bors
7a6208f2cc auto merge of #15646 : jbclements/rust/method-macros, r=cmr
This patch adds support for macros in method position. It follows roughly the template for Item macros, where an outer `Method` wrapper contains a `Method_` enum which can either be a macro invocation or a standard macro definition. 

One note; adding support for macros that expand into multiple methods is not included here, but should be a simple parser change, since this patch updates the type of fold_macro to return a smallvector of methods.

For reviewers, please pay special attention to the parser changes; these are the ones I'm most concerned about.

Because of the small change to the interface of fold_method, this is a ...

[breaking change]
2014-07-13 19:16:28 +00:00
John Clements
aee5917556 macro expansion for methods
Closes #4621
2014-07-13 10:22:43 -07:00
John Clements
bb333ca392 expansion abstraction 2014-07-13 10:10:38 -07:00
John Clements
2c4b6d6f7d add make_method method to MacResult trait
this allows macro results to be parsed as methods
2014-07-13 10:10:38 -07:00
John Clements
6c8bb5a68a macro in method position parsing 2014-07-13 10:10:38 -07:00
John Clements
6ee2155fe0 remove no-stmt check
nothing wrong with a statement expanding into 0 stmts, that I can see.
2014-07-13 10:10:38 -07:00
John Clements
c4cc3ba130 update fold_method to return a smallvector
This is nice for macros, to allow them to expand into multiple methods
2014-07-13 10:10:38 -07:00
John Clements
b293a6604b macro method unit test case fix 2014-07-13 10:10:27 -07:00
John Clements
c654fd1f49 test case for method macros 2014-07-13 10:10:27 -07:00
John Clements
b0b4b3122a refactor Method definition to make space for macros
This change propagates to many locations, but because of the
Macro Exterminator (or, more properly, the invariant that it
protects), macro invocations can't occur downstream of expansion.
This means that in librustc and librustdoc, extracting the
desired field can simply assume that it can't be a macro
invocation. Functions in ast_util abstract over this check.
2014-07-13 10:08:27 -07:00
bors
fbeee04f31 auto merge of #15507 : jakub-/rust/iterate, r=alexcrichton
The new iterator takes a function and produces an infinite stream
of results of repeated applications of the function, starting from
the provided seed value.
2014-07-13 15:51:27 +00:00
Jakub Wieczorek
ed54162e86 Add an iterate function to core::iter
Implementation by Kevin Ballard.

The function returns an Unfold iterator producing an infinite stream
of results of repeated applications of the function, starting from
the provided seed value.
2014-07-13 11:47:40 +02:00
bors
55cf6d723c auto merge of #15639 : supr/rust/master, r=sfackler
* Fixes a typo in the libstd documentation, referring UPD instead of UDP
2014-07-13 08:16:26 +00:00