Commit Graph

63230 Commits

Author SHA1 Message Date
Eduard-Mihai Burtescu
63064ec190 rustc: expose monomorphic const_eval through on-demand. 2017-04-16 01:31:06 +03:00
Eduard-Mihai Burtescu
8854164d0c rustc_const_eval: move ConstEvalErr to the rustc crate. 2017-04-16 01:31:06 +03:00
bors
d5cf1cb64c Auto merge of #41319 - eddyb:demand-adt-sized-constraint, r=arielb1
rustc: provide adt_sized_constraint as an on-demand query.

By using `queries::adt_sized_constraint::try_get`, we can detect cycles without a separate stack.
r? @nikomatsakis
2017-04-15 19:44:17 +00:00
bors
516ca2598c Auto merge of #39881 - king6cong:sys, r=japaric
code format
2017-04-15 17:17:17 +00:00
bors
ae23e65eb8 Auto merge of #41321 - frewsxcv:rollup, r=frewsxcv
Rollup of 2 pull requests

- Successful merges: #41306, #41311
- Failed merges:
2017-04-15 14:42:22 +00:00
Corey Farwell
591f62e8ce Rollup merge of #41311 - tedsta:fuchsia_error_codes, r=eddyb
Update magenta error codes

Update magenta error codes to match recent changes here: https://github.com/fuchsia-mirror/magenta/blob/master/system/public/magenta/errors.h
2017-04-15 10:41:51 -04:00
Corey Farwell
e9bc2b2942 Rollup merge of #41306 - nateozem:support/docs-mir, r=frewsxcv
add 'mir' to rustc help menu and man doc

add 'mir' to '--emit' flag list for 'rustc'.
This is added because 'rustc' can now generate MIR (referencing to
"Teach rustc --emit=mir #39891").
2017-04-15 10:41:50 -04:00
Eduard-Mihai Burtescu
2a17b84cbc rustc: provide adt_sized_constraint as an on-demand query. 2017-04-15 15:40:38 +03:00
bors
c67cf5fddc Auto merge of #41316 - suchithjn225:issue-41272, r=eddyb
Do not desugar if-let-else to match arm guards

Fixes #41272
Changed the desugaring code

**Before**
```rust
match <sub_expr> {
     <pat> => <body>,
     [_ if <else_opt_if_cond> => <else_opt_if_body>,]
     _ => [<else_opt> | ()]
}
```

**After**
```rust
match <sub_expr> {
    <pat> => <body>,
     _       => [<else_opt> | ()]
}
```
With this fix, it doesn't cause E0301
2017-04-15 12:13:27 +00:00
Suchith J N
5649b3796f Aesthetic issue. Corrected indentation 2017-04-15 17:40:54 +05:30
Suchith J N
6fc7d45d64 Fixed aesthetics of if let block 2017-04-15 17:35:30 +05:30
Suchith J N
65b04fa068 Fixed aesthetics and test 2017-04-15 17:21:53 +05:30
Suchith J N
4ac11becc2 [41272] - Fixed to conform to rust project style 2017-04-15 12:17:25 +05:30
bors
5f13a3b540 Auto merge of #41286 - lukaramu:std-collections-docs, r=frewsxcv
Various improvements in std::collections docs

The meat of this PR are:
* changes to (almost all?) iterator struct docs in std::collections such that they use the standard iterator boilerplate and state where they are created
* a bunch of added links (at least as much as possible given std::collections mostly being a facade and whatnot 😅)
* an example for `Bound`
* changed phrasing for some summary sentences to be less redundant as well as more consistant with others in the module

There also are various other fixes, e.g. removing parens from method names in the module docs, changing some imperatives to 3rd person, etc.

r? @steveklabnik
2017-04-15 04:46:27 +00:00
Suchith J N
65fafd9414 [41272] - code for desugaring iflet changed 2017-04-15 10:14:09 +05:30
king6cong
7c8ca80c81 code format 2017-04-15 11:43:35 +08:00
bors
be1a74e4d3 Auto merge of #41312 - frewsxcv:rollup, r=frewsxcv
Rollup of 2 pull requests

- Successful merges: #41125, #41309
- Failed merges:
2017-04-15 02:06:20 +00:00
Corey Farwell
3adcd1c37e Rollup merge of #41309 - frewsxcv:sg-implement-rfc-1268, r=nikomatsakis
Implement RFC 1268.

Rebased version of https://github.com/rust-lang/rust/pull/40097.

Tracking issue: https://github.com/rust-lang/rust/issues/29864.
2017-04-14 22:05:42 -04:00
Corey Farwell
3f79bdc0a9 Rollup merge of #41125 - lukaramu:std-hash-docs, r=frewsxcv
Improve std::hash docs

Fixes #29357.

For details on what exactly I've done, see the commit descriptions.

There are some things I'm not sure about, but would like to address before merging this so the issue can be closed; any feedback on these points would really be appriciated:
* [x] ~I didn't touch the module level docs at all. On the one hand, I think they could use a short overview over the module; on the other hand, the module really isn't that big and I don't know if I could really do anything beyond just duplicating the type's summaries...~
* [x] ~I feel like the module-level examples are quite long-winded and not to the point, but I couldn't really think of anything better. Any ideas?~
* [x] ~Should `Hasher` get an example for implementing it? There is one in the module documentation, but it only "implements" it via `unimplemented!` and I'm not sure what the value of that is.~
* [x] ~Should `Hasher`'s `write_{int}` methods get examples?~

If there's anything else you'd like to see in std::hash's docs, please let me know!

r? @rust-lang/docs
2017-04-14 22:05:41 -04:00
Corey Farwell
ae9f571cd1 Add Unstable Book entry for 'overlapping-marker-traits'. 2017-04-14 22:05:11 -04:00
Niko Matsakis
805704c346 update tests slightly 2017-04-14 22:05:11 -04:00
Sean Griffin
5a9c25b91e Name files what tidy wants them to be namd 2017-04-14 22:05:11 -04:00
Sean Griffin
adcdd605be Put overlapping impls behind feature gate, add tests
I've added some explicit tests that negative impls are allowed to
overlap, and also to make sure that the feature doesn't interfere with
specialization. I've not added an explicit test for positive overlapping
with negative, as that's already tested elsewhere.
2017-04-14 22:05:11 -04:00
Sean Griffin
c81c958e98 Further update with response to feedback 2017-04-14 22:04:53 -04:00
Sean Griffin
ddcca79d25 Update with response to feedback 2017-04-14 22:04:53 -04:00
Sean Griffin
4aca540018 Implement RFC 1268
This patch allows overlap to occur between any two impls of a trait for
traits which have no associated items.

Several compile-fail tests around coherence had to be changed to add at
least one item to the trait they test against.

Ref #29864
2017-04-14 22:04:53 -04:00
Theodore DeRego
1d05a0237c Update magenta error codes 2017-04-14 18:37:57 -07:00
bors
f0ca5d4bad Auto merge of #41305 - frewsxcv:rollup, r=frewsxcv
Rollup of 4 pull requests

- Successful merges: #40702, #41172, #41249, #41303
- Failed merges:
2017-04-14 23:15:31 +00:00
nate
63ed7843bb add 'mir' as part of the --emit flag list in rustc --help menu and man doc.
This is added because 'rustc' can now generate MIR (referencing to
"Teach rustc --emit=mir #39891").
2017-04-14 15:33:48 -07:00
Corey Farwell
13dc855cc3 Rollup merge of #41303 - CryZe:patch-5, r=japaric
Compile WASM as WASM instead of asm.js

Looks like the LinkerFlavor change introduced in #40018 accidentally uses GCC for the WebAssembly target, causing Rust to never actually pass the post link args to emscripten. This then causes the code to be compiled as asm.js instead of WebAssembly, because the Binaryen tools never run due to the missing linker argument.
2017-04-14 17:41:06 -04:00
Corey Farwell
5aa96024e3 Rollup merge of #41249 - GuillaumeGomez:rustdoc-render, r=steveklabnik,frewsxcv
Fix invalid associated type rendering in rustdoc

Fixes #41036.

r? @rust-lang/docs
2017-04-14 17:41:05 -04:00
Corey Farwell
5d7467acf6 Rollup merge of #41172 - Aaron1011:rustdoc-overflow, r=frewsxcv
Fix rustdoc infinitely recursing when an external crate reexports itself

Previously, rustdoc's LibEmbargoVisitor unconditionally visited the
child modules of an external crate. If a module re-exported its parent
via `pub use super::*`, rustdoc would re-walk the parent, leading to
infinite recursion.

This commit makes LibEmbargoVisitor store already visited modules in an
FxHashSet, ensuring that each module is only walked once.

Fixes #40936
2017-04-14 17:41:04 -04:00
Corey Farwell
e6f6b445aa Rollup merge of #40702 - mrhota:global_asm, r=nagisa
Implement global_asm!() (RFC 1548)

This is a first attempt. ~~One (potential) problem I haven't solved is how to handle multiple usages of `global_asm!` in a module/crate. It looks like `LLVMSetModuleInlineAsm` overwrites module asm, and `LLVMAppendModuleInlineAsm` is not provided in LLVM C headers 😦~~

I can provide more detail as needed, but honestly, there's not a lot going on here.

r? @eddyb

CC @Amanieu @jackpot51

Tracking issue: #35119
2017-04-14 17:41:03 -04:00
lukaramu
2a23e6e277 std::collections docs: Address issues that came up in PR #41286
* Bound:
  * Added another example using RangeArgument to illustrate how Bound maps
    to range endpoints.
  * Added a note to the existing example that says that it's better to use
    range syntax in most cases
  * Added missing /// line
* binary_heap::PeakMut: s/Object representing/Structure wrapping
* added collections/hash_set/struct.HashSet.html to linkchecker whitelist
2017-04-14 23:36:27 +02:00
bors
bbdaad0dc8 Auto merge of #41302 - rkruppe:dec2flt-assoc-consts, r=BurntSushi
Use associated constants in core::num::dec2flt
2017-04-14 19:33:28 +00:00
Christopher Serr
ec27aa97b9 Compile WASM as WASM instead of asm.js
Looks like the LinkerFlavor change introduced in #40018 accidentally uses GCC for the WebAssembly target, causing Rust to never actually pass the post link args to emscripten. This then causes the code to be compiled as asm.js instead of WebAssembly, because the Binaryen tools never run due to the missing linker argument.
2017-04-14 19:17:03 +02:00
bors
ba377982a3 Auto merge of #41153 - petrochenkov:umove, r=pnkfelix
Fix move checking for nested union fields

Fixes https://github.com/rust-lang/rust/issues/41126
r? @arielb1
2017-04-14 16:28:14 +00:00
Robin Kruppe
e9c74bc42d Use associated constants in core::num::dec2flt 2017-04-14 17:31:33 +02:00
bors
5637ed7566 Auto merge of #41122 - palango:mod-desc-floats, r=frewsxcv
Improve module description for std::f32 and std::f64

Fixes #29353, see discussion there.
2017-04-14 13:24:27 +00:00
A.J. Gardner
a35c4e354a Comply with windows symbol name conventions 2017-04-13 23:41:03 -05:00
bors
4f32e0dfb2 Auto merge of #41294 - frewsxcv:rollup, r=frewsxcv
Rollup of 4 pull requests

- Successful merges: #41279, #41281, #41287, #41292
- Failed merges:
2017-04-14 02:02:13 +00:00
Corey Farwell
c04ae0f0cf Rollup merge of #41292 - est31:master, r=BurntSushi
Avoid to use floating point match

Its going to be forbidden, see issue #41255.
2017-04-13 22:01:28 -04:00
Corey Farwell
adc2b10399 Rollup merge of #41287 - nikomatsakis:incr-comp-refactor-trans, r=eddyb
Miscellneous refactorings of trans

This doesn't achieve any particular goal yet, but it's a collection of refactorings with the common goal of turning `SharedCrateContext` etc into stuff that we can use with on-demand and actually expect to hash in a stable fashion for incremental. Not there yet, clearly.

r? @eddyb
cc @michaelwoerister
2017-04-13 22:01:27 -04:00
Corey Farwell
017e3e94d0 Rollup merge of #41281 - steveklabnik:update-submodules2, r=guillaumegomez
bump book repos

Not ready to merge yet; I'd like to see what tidy says.
2017-04-13 22:01:26 -04:00
Corey Farwell
187f339c91 Rollup merge of #41279 - arielb1:adjustment-composition, r=nikomatsakis
rustc_typeck: consolidate adjustment composition

Instead of having `write_adjustment` overwrite the previous adjustment, have `apply_adjustment` compose a new adjustment on top of the previous one. This is important because `NeverToAny` adjustments can be present on expressions during coercion.

Fixes #41213.

r? @nikomatsakis
2017-04-13 22:01:25 -04:00
est31
baeec7b8eb Avoid to use floating point match
Its going to be forbidden, see issue 41255.
2017-04-14 03:39:03 +02:00
Niko Matsakis
07fb93e65a make write_metadata take tcx intead of SharedCrateContext 2017-04-13 18:38:23 -04:00
Niko Matsakis
f2487b8152 refactor metadata_symbol_name 2017-04-13 18:37:47 -04:00
Niko Matsakis
8e26983c86 pull stats out of SharedCrateContext
shared mutable state is bad
2017-04-13 18:37:47 -04:00
Niko Matsakis
f227187cb8 remove LinkMeta from SharedCrateContext
A number of things were using `crate_hash` that really ought to be using
`crate_disambiguator` (e.g., to create the plugin symbol names). They
have been updated.

It is important to remove `LinkMeta` from `SharedCrateContext` since it
contains a hash of the entire crate, and hence it will change
whenever **anything** changes (which would then require
rebuilding **everything**).
2017-04-13 18:37:47 -04:00