Commit Graph

63520 Commits

Author SHA1 Message Date
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
Aidan Hobson Sayers
bb843582ca Add a comment for disabling errexit 2017-04-14 15:30:01 +01: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
Evgeny Safronov
3ae20deac7 fix: add missing link in SUMMARY.md 2017-04-14 09:46:43 +03:00
Evgeny Safronov
4cea3f7403 docs: track newly introduced unstable feature 2017-04-14 09:46:03 +03:00
Evgeny Safronov
0eecd5150d refactor: add reason string 2017-04-14 09:46:03 +03:00
Evgeny Safronov
4cb9de48fb fix: add feature to doc tests 2017-04-14 09:46:03 +03:00
Evgeny Safronov
5a09d7c3de Add as_bytes() for FromUtf8Error.
This change allows to obtain an underlying invalid UTF-8 bytes
without `FromUtf8Error` destruction. Such method may be useful
for example in a library that attempts to save both valid and
invalid UTF-8 strings in some struct and to be able to provide
immutable access to it without destruction.
2017-04-14 09:46:03 +03: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
Niko Matsakis
c22fdf9a3a use tcx.crate_name(LOCAL_CRATE) rather than LinkMeta::crate_name 2017-04-13 18:37:47 -04:00
Niko Matsakis
3f59079f8a kill CrateContextList as a thing 2017-04-13 18:33:09 -04:00
Niko Matsakis
863927c712 rewrite post-processing routines not to require a CrateContext
These do some low-level munging on the LLVM data structures. Unclear
that they need to operate as a "second pass" but leave it for now.
2017-04-13 18:33:09 -04:00
Niko Matsakis
bc79f01a58 create ModuleTranslation all in one big loop 2017-04-13 18:33:09 -04:00
Niko Matsakis
6cb516ad7b move assert_module_sources call down below 2017-04-13 18:33:09 -04:00
Niko Matsakis
fe78b546ed merge the "predeclare" and "declare" phases so we run them per-CGU 2017-04-13 18:33:09 -04:00
Niko Matsakis
33875055f0 redirect exported_symbols through shared 2017-04-13 18:33:09 -04:00
Niko Matsakis
7b429242a5 remove unused link_meta 2017-04-13 18:33:09 -04:00
Niko Matsakis
b078ecefcd rewrite to pass a ref, not slice + index 2017-04-13 18:33:09 -04:00
Niko Matsakis
15507bcb64 remove metadata_* from SharedCrateContext
No good reason for them to be in there.
2017-04-13 18:33:09 -04:00
steveklabnik
537eb45b9d Update various bookshelf repositories.
The book and the reference have both had changes lately; this integrates
them upstream.
2017-04-13 18:15:40 -04:00
lukaramu
89ac8654e1 Various consistency and phrasing fixes in std::collections' docs
* Changed btree_map's and hash_map's Entry (etc.) docs to be consistent
* Changed VecDeque's type and module summary sentences to be consistent
  with each other as well as with other summary sentences in the module
* Changed HashMap's and HashSet's summary sentences to be less redundantly
  phrased and also more consistant with the other summary sentences in the
  module
* Also, added an example to Bound
2017-04-13 22:51:05 +02:00
lukaramu
d688c4d806 Various fixes throughout std::collections' docs
* Added links where possible (limited because of facading)
* Changed references to methods from `foo()` to `foo` in module docs
* Changed references to methods from `HashMap::foo` to just `foo` in
  top-level docs for `HashMap` and the `default` doc for `DefaultHasher`
* Various small other fixes
2017-04-13 22:51:05 +02:00
lukaramu
d64de94efa Update std::collections' docs to use iterator (etc.) boilerplate
This greatly improves consistency.
2017-04-13 22:51:05 +02:00
bors
28a7429977 Auto merge of #41227 - alexcrichton:compiletest, r=aturon
rustbuild: Fix recompilation of stage0 tools dir

This commit knocks out a longstanding FIXME in rustbuild which should correctly
recompile stage0 compiletest and such whenever libstd itself changes. The
solution implemented here was to implement a notion of "order only" dependencies
and then add a new dependency stage for clearing out the tools dir, using
order-only deps to ensure that it happens correctly.

The dependency drawing for tools is a bit wonky now but I think this'll get the
job done.

Closes #39396
2017-04-13 20:21:12 +00:00
Ariel Ben-Yehuda
03b0d99556 rustc_typeck: consolidate adjustment composition
Fixes #41213.
2017-04-13 21:27:35 +03:00
bors
ea376822a1 Auto merge of #41277 - frewsxcv:rollup, r=frewsxcv
Rollup of 3 pull requests

- Successful merges: #41240, #41250, #41266
- Failed merges:
2017-04-13 17:32:22 +00:00
Corey Farwell
6afb2c48d9 Rollup merge of #41266 - projektir:weak_docs_rc, r=alexcrichton
Updating docs for std::rc::Rc

The same changes as PR [#41240 ](https://github.com/rust-lang/rust/pull/41240), but for [`std::rc::Weak`](https://doc.rust-lang.org/std/rc/struct.Weak.html). At least, as far as I am aware, the Weak pointer is the same for both, and they're basically the same, just one is thread-safe and the other is not.

r? @alexcrichton
2017-04-13 13:04:16 -04:00
Corey Farwell
6dfd8f6e12 Rollup merge of #41250 - kennytm:fix-41228, r=nikomatsakis
Fix invalid 128-bit division on 32-bit target (#41228)

The bug of #41228 is a typo, this line: 1dca19ae3f/src/libcompiler_builtins/lib.rs (L183)

```rust
            // 1 <= sr <= u64::bits() - 1
            q = n.wrapping_shl(64u32.wrapping_sub(sr));
```

The **64** should be **128**.

(Compare with 280d19f112/src/int/udiv.rs (L213-L214):

```rust
            // 1 <= sr <= <hty!($ty)>::bits() - 1
            q = n << (<$ty>::bits() - sr);
```

Or compare with the C implementation https://github.com/llvm-mirror/compiler-rt/blob/master/lib/builtins/udivmodti4.c#L113-L116

```c
        /* 1 <= sr <= n_udword_bits - 1 */
        /* q.all = n.all << (n_utword_bits - sr); */
        q.s.low = 0;
        q.s.high = n.s.low << (n_udword_bits - sr);
```
)

Added a bunch of randomly generated division test cases to try to cover every described branch of `udivmodti4`.
2017-04-13 13:04:15 -04:00
Corey Farwell
9eb3468e2f Rollup merge of #41240 - projektir:weak_docs, r=alexcrichton
Updating docs for std::sync::Weak #29377

I will duplicate these changes for [`std::rc::Weak`] if they are approved.

[`std::rc::Weak`]: https://doc.rust-lang.org/std/rc/struct.Weak.html

r? @jonathandturner
2017-04-13 13:04:14 -04:00
Alex Crichton
2a33559207 rustbuild: Fix recompilation of stage0 tools dir
This commit knocks out a longstanding FIXME in rustbuild which should correctly
recompile stage0 compiletest and such whenever libstd itself changes. The
solution implemented here was to implement a notion of "order only" dependencies
and then add a new dependency stage for clearing out the tools dir, using
order-only deps to ensure that it happens correctly.

The dependency drawing for tools is a bit wonky now but I think this'll get the
job done.

Closes #39396
2017-04-13 09:47:00 -07:00