Commit Graph

64116 Commits

Author SHA1 Message Date
Mark Simulacrum
6b4f3a73d2 Rollup merge of #42005 - jseyfried:fix_macro_regression, r=nrc
Fix regression in `macro_rules!` name matching

Fixes #41803.
r? @nrc
2017-05-16 08:18:34 -06:00
Mark Simulacrum
4bf04704c3 Rollup merge of #42001 - ollie27:rustdoc_extern_fn, r=GuillaumeGomez
rustdoc: Display `extern "C" fn` instead of `extern fn`

It was decided in rust-lang-nursery/fmt-rfcs#52 to be explicit about the ABI so rustdoc should follow suit.
2017-05-16 08:18:32 -06:00
Mark Simulacrum
4c72793a20 Rollup merge of #41995 - gamazeps:thread-localkey, r=frewsxcv
[Doc] Add links to the `thread::LocalKey` doc.

Part of #29378 .

I do not know exactly what should be done for the `cleanup` part, if you have any idea I'll gladly do it.

r? @rust-lang/docs
2017-05-16 08:18:31 -06:00
Mark Simulacrum
18171a8861 Rollup merge of #41994 - gamazeps:thread-builder, r=GuillaumeGomez
[Doc] Implrove `thread::Builder`'s doc.

Part of #29378 .

- Explains *why* we would use the builder instead ofthe free function.
- Changes the parent-child explanation for a spawned-caller in `thread::Builder::spawn`
- Adds a link to `io::Result` in `thread::Builder`
- Corrects the return type doc in `thread::Builder::spawn`

r? @rust-lang/docs
2017-05-16 08:18:30 -06:00
Mark Simulacrum
efe285e0ff Rollup merge of #41982 - gamazeps:thread-yield-now, r=GuillaumeGomez
[Doc] Explain why `thread::yield_now` could be used.

Part of #29378.

r? @steveklabnik
2017-05-16 08:18:29 -06:00
Mark Simulacrum
7a9cf929d5 Rollup merge of #41489 - estebank:trait-bounds-diagnosstic, r=arielb1
Make unsatisfied trait bounds note multiline

Make diagnostic note for existing method with unsatisfied trait bounds
multiline for cleaner output.

```
  = note: the method `count` exists but the following trait bounds were not satisfied:
          `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>`
          `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>> [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator`
```

Before:

```
  = note: the method `count` exists but the following trait bounds were not satisfied: `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>`, `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator`
```
2017-05-16 08:18:28 -06:00
bors
4d09a0eb5d Auto merge of #41771 - clarcharr:resize_default, r=nikomatsakis
Add Vec::resize_default.

As suggested by #41758.
2017-05-16 08:14:29 +00:00
bors
fa78d5bb87 Auto merge of #41565 - rkruppe:llvm-sys, r=eddyb
Make only rustc_trans depend on rustc_llvm

With these changes, only rustc_trans depends directly on rustc_llvm (and no crate gained a new dependency on trans). This means changing LLVM doesn't rebuild librustc or rustc_metadata, only rustc_trans, rustc_driver and the rustc executable
Also, rustc_driver technically doesn't know about LLVM any more (of course, it still handles a ton of options that conceptually refer to LLVM, but it delegates their implementation to trans).

What I *didn't* implement was merging most or all of rustc_llvm into rustc_trans. I ran into a nasty bug, which was probably just a silly typo somewhere but I probably won't have the time to figure it out in the next week or two. I opened #41699 for that step.

Fixes #41473
2017-05-16 05:41:11 +00:00
bors
ae33d99bcd Auto merge of #41996 - alexcrichton:more-retry, r=Mark-Simulacrum
appveyor: Wrap handle.exe download in a retry

Should help deal with spurious download failures.
2017-05-16 01:01:31 +00:00
bors
abe1183135 Auto merge of #41843 - cuviper:oxidized-installer, r=alexcrichton
Update to the Rusty rust-installer

This updates the rust-installer submodule to the new version written in Rust (rust-lang/rust-installer#62), now moved to `src/tools/rust-installer` and invoked in `dist.rs` as a cargo-based tool command.  All of the former shell-script invocations now invoke the tool, otherwise keeping the same arguments as before.

As a small bonus, `rustc-src` now also uses the same tarball generator, so it gains a smaller `.tar.xz` too.

Fixes #41569.  r? @alexcrichton
2017-05-15 21:55:14 +00:00
Alex Crichton
7644508b4e appveyor: Wrap handle.exe download in a retry
Should help deal with spurious download failures.
2017-05-15 12:01:09 -07:00
Robin Kruppe
04a16ff5ac Fix run-make/llvm-pass 2017-05-15 15:09:05 +02:00
bors
75b0568123 Auto merge of #41992 - ollie27:linkchecker_base, r=alexcrichton
linkchecker: Add support for <base> tag

Add support for the HTML <base> tag as used by mdBook so The Unstable
Book can be checked.

Also cleanup a few things:
* Stop checking the name attribute. It should never have been used and
mdBook has since been fixed not to use it.
* Make sure we only check html files.
* Remove a few unnecessary allocations.

Finally, dead links in The Unstable Book have been fixed.
2017-05-15 12:59:31 +00:00
Jeffrey Seyfried
9f4e1e10a4 Fix regression in macro_rules! name matching. 2017-05-15 09:26:26 +00:00
Robin Kruppe
acdeedc192 Use AtomicBool instead of a 'static mut' for LLVM init posioning 2017-05-15 11:13:33 +02:00
Robin Kruppe
e3f6e68d63 Remove (direct) rustc_llvm dependency from rustc_driver
This does not actually improve build times, since it still depends
on rustc_trans, but is better layering and fits the multi-backend
future slightly better.
2017-05-15 11:13:32 +02:00
Robin Kruppe
8e4f315116 Remove rustc_llvm dependency from librustc
Consequently, session creation can no longer initialize LLVM.
The few places that use the compiler without going through
rustc_driver/CompilerCalls thus need to be careful to manually
initialize LLVM (via rustc_trans!) immediately after session
creation.

This means librustc is not rebuilt when LLVM changes.
2017-05-15 11:13:30 +02:00
bors
ac254fbe79 Auto merge of #41859 - froydnj:align-float-parts, r=sfackler
fix confusion about parts required for float formatting

The documentation for flt2dec doesn't match up with the actual
implementation, so fix the documentation to align with reality.
Presumably due to the mismatch, the formatting code for floats in
std::fmt can use correspondingly shorter arrays in some places, so fix
those places up as well.

Fixes #41304.
2017-05-15 08:42:10 +00:00
Felix Raimundo
f92bd3dbd0 Add links to the thread::LocalKey doc.
Part of #29378 .
2017-05-15 08:10:22 +02:00
Josh Stone
1e709fcff3 Don't use sanitize_sh with rust-installer
There's no shell interpreting the file paths under the new Rusty
rust-installer, so we don't need to use `sanitize_sh` for it.  Plus,
the drive-letter transformation is actually harmful for the now-native
Windows rust-installer to understand those paths.
2017-05-14 21:06:23 -07:00
Josh Stone
3d6ee0a14b Force tool-rust-installer deps to build-only 2017-05-14 21:06:23 -07:00
Josh Stone
6edb4e22c4 Use "rust-installer tarball" to create rustc-src too
This gives us an extra rustc-src.tar.xz, which is 33% smaller than the .tar.gz!
2017-05-14 21:06:23 -07:00
Josh Stone
020c5ecca7 Update to the oxidized rust-installer 2017-05-14 21:06:23 -07:00
Esteban Küber
c0d5aa8aaf Make unsatisfied trait bounds note multiline
Make diagnostic note for existing method with unsatisfied trait bounds
multiline for cleaner output.

```
  = note: the method `count` exists but the following trait bounds were not satisfied:
          `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>`
          `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>> [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator`

Before:

```
  = note: the method `count` exists but the following trait bounds were not satisfied: `[closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53] : std::ops::FnMut<(&_,)>`, `std::iter::Filter<std::iter::Fuse<std::iter::Once<&str>>, [closure@../../src/test/compile-fail/issue-36053-2.rs:17:39: 17:53]> : std::iter::Iterator`
```
2017-05-14 20:38:26 -07:00
Oliver Middleton
93f78bc45e rustdoc: Display extern "C" fn instead of extern fn 2017-05-15 00:52:17 +01:00
Robin Kruppe
1a24a591dd Remove rustc_llvm dependency from rustc_metadata
Move the code for loading metadata from rlibs and dylibs from
rustc_metadata into rustc_trans, and introduce a trait to avoid
introducing a direct dependency on rustc_trans.

This means rustc_metadata is no longer rebuilt when LLVM changes.
2017-05-14 20:30:22 +02:00
Felix Raimundo
a51777ec87 Improve thread::Builder documentation.
Part of #29378 .

- In particular explains *why* we would use the builder instead of
  the free function.
- Changes the parent-child explanation for a spawned-caller.
- Add link to `io::Result` in `thread::Builder`
- Corrects the `thread::Builder::spawn` documentation.
2017-05-14 20:13:32 +02:00
Oliver Middleton
d4f20eb7e3 linkchecker: Add support for <base> tag
Add support for the HTML <base> tag as used by mdBook so The Unstable
Book can be checked.

Also cleanup a few things:
* Stop checking the name attribute. It should never have been used and
mdBook has since been fixed not to use it.
* Make sure we only check html files.
* Remove a few unnecessary allocations.

Finally, dead links in The Unstable Book have been fixed.
2017-05-14 18:06:35 +01:00
Oliver Middleton
21ca9cab7d Fix some dead links in The Unstable Book 2017-05-14 18:06:13 +01:00
bors
386b0b9d39 Auto merge of #41978 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update the Cargo submodule

Brings some nice updates like faster index clones/updates, retries on 500 from
crates.io, etc.
2017-05-14 16:16:17 +00:00
Felix Raimundo
a9cb094879 Explain why thread::yield_now could be used.
Part of #29378.
2017-05-14 14:05:10 +02:00
bors
9f15631c36 Auto merge of #41969 - Enet4:update-rls-313, r=Mark-Simulacrum
Update RLS to solve serious crash

As a follow-up to rust-lang-nursery/rls#312, this PR contains the fix to the latest experienced RLS crashes, which should hopefully reach the nightly release as soon as possible.
2017-05-14 05:57:38 +00:00
bors
94497b73a7 Auto merge of #41987 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 7 pull requests

- Successful merges: #41612, #41826, #41939, #41946, #41950, #41975, #41979
- Failed merges:
2017-05-14 03:00:34 +00:00
Mark Simulacrum
7294ce10b6 Rollup merge of #41979 - pftbest:msp430_libcalls, r=alexcrichton
LLVM: Add support for EABI-compliant libcalls on MSP430.

This change will allow rust code to have proper support for division
and multiplication using libgcc.

r? @alexcrichton
cc @awygle
2017-05-13 20:55:13 -06:00
Mark Simulacrum
6764ae13be Rollup merge of #41975 - liranringel:pass-static-crt-to-llvm-cmake-config, r=alexcrichton
Pass static crt to llvm cmake configuration

Solves https://github.com/rust-lang/rust/issues/40246
2017-05-13 20:55:13 -06:00
Mark Simulacrum
24aba55805 Rollup merge of #41950 - GuillaumeGomez:rustdoc-links, r=frewsxcv
Fix anchor invalid redirection to search

Fixes #41933.

r? @rust-lang/docs
2017-05-13 20:55:12 -06:00
Mark Simulacrum
e71d4404bd Rollup merge of #41946 - qnighy:disallow-dot-underscore-in-float, r=petrochenkov
Disallow ._ in float literal.

This patch makes lexer stop parsing number literals before `._`, as well as before `.a`. Underscore itself is still allowed like in `4_000_000.000_000_`.

Fixes a half part of #41723. The other is `""_`.
2017-05-13 20:55:11 -06:00
Mark Simulacrum
cfea522226 Rollup merge of #41939 - eddyb:trait-assoc-const-default, r=petrochenkov
rustc_resolve: don't deny outer type parameters in embedded constants.

This solves a problem noted at https://github.com/rust-lang/rust/issues/29646#issuecomment-300929548, where an associated const default in a trait couldn't refer to `Self` or type parameters, due to inaccuracies in lexical scoping.

I've also allowed "embedded expressions" (`[T; expr]`,  `[x; expr]`, `typeof expr`) to refer to type parameters in scope. *However*, the typesystem still doesn't handle #34344.
Fully resolving that issue requires breaking cycles more aggressively (e.g. lazy evaluation), *even* in when the expression doesn't depend on type parameters, to type-check it at all, and then also type-level "constant projections" (in the vein of `{expr}` from const generics).
2017-05-13 20:55:10 -06:00
Mark Simulacrum
27ea129dd3 Rollup merge of #41826 - GuillaumeGomez:add-markdown-content, r=frewsxcv
Add markdown-[before|after]-content options

cc @nical

r? @rust-lang/docs
2017-05-13 20:55:09 -06:00
Mark Simulacrum
c75ccd7b4e Rollup merge of #41612 - mandeep:add-ops-generics, r=GuillaumeGomez,frewsxcv
Added generic example of std::ops::Add in doc comments

We discussed on IRC how the std::ops examples were potentially missing examples using generics. This PR adds an example to std::ops::Add that shows the use of a generic type T. I'm not sure this is ready for merge as I think the two examples now make the documentation a bit verbose, but I think it's a good starting point. I'd love to hear others thoughts on this. This is in relation to the last item in issue #29365.
2017-05-13 20:55:08 -06:00
Eduardo Pinho
b8684347ae Update rls submodule with important fixes
- Updates ls_types to "0.10.0", which prevents RLS crashes
2017-05-14 01:25:58 +01:00
bors
93dd1cab5d Auto merge of #41919 - nrc:save-crate, r=eddyb
Include the crate's root module in save-analysis

r? @eddyb
2017-05-13 22:58:04 +00:00
Vadzim Dambrouski
51cebb3e63 LLVM: Add support for EABI-compliant libcalls on MSP430.
This change will allow rust code to have proper support for division
and multiplication using libgcc libcalls.
2017-05-13 21:23:00 +03:00
Alex Crichton
d0a6af37e7 Update the Cargo submodule
Brings some nice updates like faster index clones/updates, retries on 500 from
crates.io, etc.
2017-05-13 11:07:33 -07:00
bors
826d8f3850 Auto merge of #41914 - eddyb:region-refactor, r=nikomatsakis
rustc: simpler ParameterEnvironment and free regions.

The commits describe the slow transformation but the highlights are:
* `ReEarlyBound` is considered free, with a scope based on the item that defined the lifetime parameter, and the root body of the `RegionMaps` in use, removing the need for `free_substs`
* `liberate_late_bound_regions` and `implicit_region_bound` moved to typeck
* `CodeExtent` not interned at all now - ideally it would be 2 `u32` but it's small anyway

Future work building up on this could include:
* `ParameterEnvironment` becoming just the result of `predicates_of`
  * interning makes my "parent chain" scheme unnecessary
* `implicit_region_bound` could be retrieved from `RegionMaps`
* renaming `CodeExtent` to `Scope`
  * generalizing "call site" to "use site" or something better to include constants
* renaming `RegionMaps` to `ScopeTree` and its API to talk about "parents" explicitly
2017-05-13 17:56:09 +00:00
Liran Ringel
1163f2cc23 Pass static crt to llvm cmake configuration 2017-05-13 17:12:19 +02:00
Eduard-Mihai Burtescu
dc7ffbeca4 rustc_resolve: don't deny outer type parameters in embedded constants. 2017-05-13 17:45:54 +03:00
Eduard-Mihai Burtescu
6da4123f5f rustc: don't keep a second reference to the HIR map in middle::region. 2017-05-13 17:43:32 +03:00
Eduard-Mihai Burtescu
ea1c6df81e rustc: stop interning CodeExtent, it's small enough. 2017-05-13 17:43:32 +03:00
Eduard-Mihai Burtescu
da8b6e276e rustc: remove redundant fn_id's from CodeExtentData. 2017-05-13 17:42:59 +03:00