Commit Graph

50221 Commits

Author SHA1 Message Date
bors
5d771cd5b3 Auto merge of #31455 - tmiasko:expected-tokens, r=alexcrichton
Previously when breaking tokens into smaller pieces, the replace_token
function have been used. It replaced current token and updated span
information, but it did not clear the list of expected tokens, neither
did it update remaining info about last token. This could lead to
incorrect error message, like one described in the issue #24780:

    expected one of ... `>` ...  found `>`
2016-02-10 20:55:53 +00:00
bors
b5da60d03a Auto merge of #30686 - wesleywiser:rustdoc_display_since, r=steveklabnik
Here's some screenshots after this change:

![screen shot 2016-01-03 at 11 38 30 am](https://cloud.githubusercontent.com/assets/831192/12079661/23da4e38-b20f-11e5-8c84-ba51d7a59c3f.png)
![screen shot 2016-01-03 at 11 40 39 am](https://cloud.githubusercontent.com/assets/831192/12079663/23e00012-b20f-11e5-9f01-408cc8d43687.png)
![screen shot 2016-01-03 at 11 42 17 am](https://cloud.githubusercontent.com/assets/831192/12079662/23dfe6c2-b20f-11e5-9998-53abc643e2ef.png)

I tried to click through the `std` docs and make sure everything that can have stability attributes has it rendered but I'm probably missing some. I'd also appreciate any feedback on the css changes. I had difficulty getting the `since` labels aligning correctly for enum variants. If anyone has a better idea for that, I'd be glad to implement it.

Fixes #27607
2016-02-10 17:23:40 +00:00
bors
052b3fd4a0 Auto merge of #31499 - kamalmarhubi:cfg-flag-invalid-cfgs, r=brson
A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This
makes the same spec be rejected by the compiler if passed in as a
`--cfg` argument.

Fixes #31495
2016-02-10 14:24:41 +00:00
bors
32d962d16f Auto merge of #31420 - bluss:deque-equality, r=Gankro
collections: Use slice parts in PartialEq for VecDeque

This improves == for VecDeque by using the slice representation.

This will also improve further if codegen for slice comparison improves.

Benchmark run of 1000 u64 elements, comparing for equality (all equal).
Cpu time to compare the vecdeques is reduced to less than 50% of what it
was before.

```
test test_eq_u64       ... bench:  1,885 ns/iter (+/- 163) = 4244 MB/s
test test_eq_new_u64   ... bench:    802 ns/iter (+/- 100) = 9975 MB/s
```
2016-02-10 10:04:46 +00:00
bors
523fa1331e Auto merge of #31494 - alexcrichton:ar-gnu-by-default, r=brson
The compiler currently vendors its own version of "llvm-ar" (not literally the
binary but rather the library support) and uses it for all major targets by
default (e.g. everything defined in `src/librustc_back/target`). All custom
target specs, however, still search for an `ar` tool by default. This commit
changes this default behavior to using the internally bundled llvm-ar with the
GNU format.

Currently all targets use the GNU format except for OSX which uses the BSD
format (surely makes sense, right?), and custom targets can change the format
via the `archive-format` key in custom target specs.

I suspect that we can outright remove support for invoking an external `ar`
utility, but I figure for now there may be some crazy target relying on that so
we should leave support in for now.
2016-02-10 08:03:06 +00:00
bors
9a20bfc856 Auto merge of #31465 - nagisa:mir-free-fix, r=nikomatsakis
Fixes #31463
2016-02-10 04:34:15 +00:00
Wesley Wiser
75acee2bde Rustdoc - display since version for stable items
Fixes #27607
2016-02-09 21:20:41 -05:00
bors
0542745768 Auto merge of #31438 - aturon:stab-ip-addr, r=alexcrichton
After [considerable pushback](https://github.com/rust-lang/rfcs/issues/1451), it's clear that there is a community consensus around providing `IpAddr` in the standard library, together with other APIs using it.

This commit reverts from deprecated status directly to stable. The deprecation landed in 1.6, which has already been released, so the stabilization is marked for 1.7 (currently in beta; will require a backport).

r? @alexcrichton
2016-02-10 01:05:42 +00:00
bors
32b2ef7add Auto merge of #31523 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #31473, #31513, #31514, #31515, #31516, #31520
- Failed merges:
2016-02-09 22:28:45 +00:00
Steve Klabnik
af1a0a3466 Rollup merge of #31520 - steveklabnik:doc_num, r=alexcrichton
This commit does two things:

* Re-works the module-level documentation.
* Cleaning up wording and adding links to where error types are used.

Part of #29364
2016-02-09 16:58:59 -05:00
Steve Klabnik
4c50d76298 Rollup merge of #31516 - steveklabnik:doc_tuples, r=brson
Fixes #29339
2016-02-09 16:58:59 -05:00
Steve Klabnik
a1a0edc690 Rollup merge of #31515 - steveklabnik:doc_drain, r=alexcrichton
This is the last bit of String docs needed to

Close #29376
2016-02-09 16:58:59 -05:00
Steve Klabnik
6571ae28a8 Rollup merge of #31514 - cgar:spelling, r=alexcrichton 2016-02-09 16:58:59 -05:00
Steve Klabnik
e3bf4a7427 Rollup merge of #31513 - scottrobertwhittaker:fix-typo, r=alexcrichton
"particularly" was misspelled.

r? @steveklabnik
2016-02-09 16:58:58 -05:00
Steve Klabnik
f53a5bbe42 Rollup merge of #31473 - raindev:error-handling-case-study, r=steveklabnik
Remove unnecessary cloning and conversions. Expand tab characters left in code examples.
2016-02-09 16:58:58 -05:00
Steve Klabnik
8fa48573e1 make note of arity and 32-length restriction 2016-02-09 16:00:54 -05:00
Steve Klabnik
4ebc47bad2 Properly document tuples
Fixes #29339
2016-02-09 16:00:50 -05:00
bors
096dbf84c7 Auto merge of #31425 - oli-obk:mir-pass-plugin, r=nagisa
depends on #31324

r? @nagisa
2016-02-09 20:27:03 +00:00
Steve Klabnik
dd0133d836 Some docs for std::num
This commit does two things:

* Re-works the module-level documentation.
* Cleaning up wording and adding links to where error types are used.

Part of #29364
2016-02-09 14:07:51 -05:00
Steve Klabnik
47e81ed3ab Improve docs for Drain on String
This is the last bit of String docs needed to

Close #29376
2016-02-09 12:02:55 -05:00
Carlos E. Garcia
02aa0aff2f Minor spelling fixes 2016-02-09 11:52:39 -05:00
Scott Whittaker
5c3a194034 mod.rs: fix typo
"particularly" was misspelled.
2016-02-09 11:47:42 -05:00
Oliver Schneider
4b067183ba Allow registering MIR-passes through compiler plugins 2016-02-09 16:53:43 +01:00
Oliver Schneider
030b237476 refactor MirPass to always require a tcx 2016-02-09 16:53:42 +01:00
Oliver Schneider
41c892f5e1 make MirMap a struct instead of a type alias for NodeMap 2016-02-09 16:53:42 +01:00
Aaron Turon
2067c570fb Revert deprecation of IpAddr, stabilizing for 1.7
After [considerable
pushback](https://github.com/rust-lang/rfcs/issues/1451), it's clear
that there is a community consensus around providing `IpAddr` in the
standard library, together with other APIs using it.

This commit reverts from deprecated status directly to stable. The
deprecation landed in 1.6, which has already been released, so the
stabilization is marked for 1.7 (currently in beta; will require a backport).
2016-02-09 07:23:12 -08:00
bors
fc1c1183f3 Auto merge of #31510 - dikaiosune:master, r=bluss
Since a lexicographic ordering of a struct could vary based on which struct members are compared first, I ended up doing some testing to ensure that the behavior when deriving these traits was what I expected (ordered based on the top to bottom order of declaration of the members). I wanted to add this little bit of documentation to potentially save someone else the same effort. That is, assuming that my testing correctly reflects the intended behavior of the compiler.

r? @steveklabnik
2016-02-09 15:14:25 +00:00
Adam Perry
e22770beeb Clarifying behavior of #[derive(Ord, PartialOrd)] in doc comments.
Removing redundant statement about lexicographic ordering.
2016-02-09 08:01:28 -07:00
bors
6630a08195 Auto merge of #31493 - mechaxl:master, r=steveklabnik
This pull request fixes a minor typo in the prelude documentation.

r? @steveklabnik
2016-02-09 10:50:04 +00:00
bors
8b95b0a6f9 Auto merge of #31282 - pczarn:mir-trans-builder, r=nagisa
Closes #31003
2016-02-09 08:50:03 +00:00
bors
0d410b8d2a Auto merge of #31492 - alexcrichton:remove-allow-trivial-casts, r=nrc
These were added a long time ago but we long since switched the lint back to
allow-by-default, so these annotations shouldn't be necessary.
2016-02-09 06:49:41 +00:00
bors
43437dda68 Auto merge of #31489 - ben0x539:lock-to-guard, r=alexcrichton
The comment in the next line was already talking about `_guard`, and the scope guard a couple lines further down is also called `guard`, so I assume that was just a typo.

r? @steveklabnik
2016-02-09 04:27:42 +00:00
bors
1cff753f46 Auto merge of #31500 - steveklabnik:fix_cow, r=alexcrichton
When I last did a pass through the string documentation, I focused on
consistency across similar functions. Unfortunately, I missed some
details. This example was _too_ consistent: it wasn't actually accurate!

This commit fixes the docs do both be more accurate and to explain why
the return type is a Cow<'a, str>.

First reported here:
https://www.reddit.com/r/rust/comments/44q9ms/stringfrom_utf8_lossy_doesnt_return_a_string/
2016-02-09 02:27:58 +00:00
bors
75271d8f1a Auto merge of #31278 - alexcrichton:print-cfg, r=brson
This commit is an implementation of the new compiler flags required by [RFC
1361][rfc]. This specifically adds a new `cfg` option to the `--print` flag to
the compiler. This new directive will print the defined `#[cfg]` directives by
the compiler for the target in question.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1361-cargo-cfg-dependencies
2016-02-09 00:19:45 +00:00
Kamal Marhubi
c32c7c2486 driver: Include invalid predicate in error message 2016-02-08 18:47:03 -05:00
Alex Crichton
a1ffe6b6bb rustc: Implement a new --print cfg flag
This commit is an implementation of the new compiler flags required by [RFC
1361][rfc]. This specifically adds a new `cfg` option to the `--print` flag to
the compiler. This new directive will print the defined `#[cfg]` directives by
the compiler for the target in question.

[rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1361-cargo-cfg-dependencies.md
2016-02-08 14:28:46 -08:00
bors
f8fa6140fa Auto merge of #31397 - bradfirj:arc-docfix, r=steveklabnik
The documentation for the `make_mut` function on `Arc<T>` contains a somewhat impenetrable double-negative that I was only able to fully grasp by looking at the implementation. Here's a quick rewrite that reads a lot better.

The sentence "doesn't have one strong reference and no weak references." is a
hard to understand, and it can be much more easily explained. In particular, such a double-negative
could give English as a Second Language users even more trouble than native speakers.

r? @steveklabnik
2016-02-08 22:19:41 +00:00
Kamal Marhubi
6d2c866e22 driver: Disallow predicates in --cfg specs
A spec like `#[cfg(foo(bar))]` is not allowed as an attribute. This
makes the same spec be rejected by the compiler if passed in as a
`--cfg` argument.

Fixes #31495
2016-02-08 17:15:24 -05:00
Kamal Marhubi
4c4bb5ff5c driver: Extract handling of --explain to separate function 2016-02-08 17:15:24 -05:00
Kamal Marhubi
9951ac4be9 driver: Pass session options to CompilerCallbacks::early_callback() 2016-02-08 17:15:24 -05:00
Kamal Marhubi
601e04534f Add compile-fail test for invalid cfg predicate in attribute
Refs #31495
2016-02-08 17:15:24 -05:00
Steve Klabnik
5089b43b45 Fix up docs for String::from_utf8_lossy()
When I last did a pass through the string documentation, I focused on
consistency across similar functions. Unfortunately, I missed some
details. This example was _too_ consistent: it wasn't actually accurate!

This commit fixes the docs do both be more accurate and to explain why
the return type is a Cow<'a, str>.

First reported here:
https://www.reddit.com/r/rust/comments/44q9ms/stringfrom_utf8_lossy_doesnt_return_a_string/
2016-02-08 17:10:55 -05:00
Piotr Czarnecki
38fa06bc95 Cleanup based on review by @nagisa
* We don't have SEH-based unwinding yet.
  For this reason we don't need operand bundles in MIR trans.
* Refactored some uses of fcx.
* Refactored some calls to `with_block`.
2016-02-08 23:08:47 +01:00
Tomasz Miąsko
cecf83f592 Breaking tokens into pieces should behave similar to Parser::bump.
Previously when breaking tokens into smaller pieces, the replace_token
function have been used. It replaced current token and updated span
information, but it did not clear the list of expected tokens, neither
did it update remaining info about last token. This could lead to
incorrect error message, like one described in the issue #24780:

  expected one of ... `>` ...  found `>`
2016-02-08 21:26:48 +01:00
bors
efdde2479b Auto merge of #31324 - nagisa:mir-transforms, r=nikomatsakis
Having a `MirPass` provides literally no benefits over `MutVisitor`. Moreover using `MirPass` for
`EraseRegions` basically makes the programmer to fix breakage from changing repr twice – in the
visitor and eraseregions. Since `MutVisitor` implements all the “walking” inside the trait, that can
be reused for `EraseRegions` too, basically resulting in less code duplication.
2016-02-08 19:04:25 +00:00
Alex Crichton
d66f3948f5 rustc: Use llvm-ar for custom targets by default
The compiler currently vendors its own version of "llvm-ar" (not literally the
binary but rather the library support) and uses it for all major targets by
default (e.g. everything defined in `src/librustc_back/target`). All custom
target specs, however, still search for an `ar` tool by default. This commit
changes this default behavior to using the internally bundled llvm-ar with the
GNU format.

Currently all targets use the GNU format except for OSX which uses the BSD
format (surely makes sense, right?), and custom targets can change the format
via the `archive-format` key in custom target specs.

I suspect that we can outright remove support for invoking an external `ar`
utility, but I figure for now there may be some crazy target relying on that so
we should leave support in for now.
2016-02-08 10:27:03 -08:00
Kenneth Koski
f3014d1301 Fixing typo in prelude documentation 2016-02-08 12:07:55 -06:00
Alex Crichton
696a1da861 Remove old #[allow(trivial_casts)] annotations
These were added a long time ago but we long since switched the lint back to
allow-by-default, so these annotations shouldn't be necessary.
2016-02-08 09:35:09 -08:00
bors
26105b1a37 Auto merge of #31462 - thepowersgang:fix_29946, r=dotdash
Generates drop calls at the end of the Fn/FnMut -> FnOnce closure shim

Fix #29946
2016-02-08 17:05:21 +00:00
bors
04f12ef4f7 Auto merge of #31442 - pnkfelix:issue-30438-sidestep-dummy-node-during-expand-givens-dfs, r=nikomatsakis
Split dummy-idx node to fix expand_givens DFS

(Much more detail in commit comments.)

Fix #30438.
2016-02-08 14:56:24 +00:00