bors [Tue, 26 Jun 2018 18:55:09 +0000 (18:55 +0000)]
Auto merge of #51756 - nielx:fix/librustdoc, r=GuillaumeGomez
Haiku: set stack size to 16 MB on Haiku, use 32 MB on other platforms
The maximum stack size on Haiku is set to 16 MB (see [the Haiku source](https://git.haiku-os.org/haiku/tree/headers/private/system/thread_defs.h#n17)). With this change rustdoc will also work on Haiku.
bors [Tue, 26 Jun 2018 16:26:00 +0000 (16:26 +0000)]
Auto merge of #51725 - Mark-Simulacrum:no-llvm, r=kennytm
Do not build LLVM tools for any of the tools
None of the tools in the list should need LLVM tools themselves as far as I can
tell; if this is incorrect, we can re-enable the tool building later.
The primary reason for doing this is that rust-central-station uses the
BuildManifest tool and building LLVM there is not cached: it takes ~1.5
hours on the 2 core machine. This commit should make nightlies and
stable releases much faster.
Followup to https://github.com/rust-lang/rust/pull/51459, r? @kennytm
I'm mostly relying on CI to test this so probably don't roll it up; I'm not sure how to (and not particularly inclined to) wait for multiple hours to test this locally. I imagine that the failures should be fairly obvious when/if encountered.
Pietro Albini [Tue, 26 Jun 2018 09:35:41 +0000 (11:35 +0200)]
Rollup merge of #51786 - cuviper:stat64-pointers, r=Mark-Simulacrum
Remove unnecessary stat64 pointer casts
In effect, these just casted `&mut stat64` to `*mut stat64`, twice.
That's harmless, but it masked a problem when this was copied to new
code calling `fstatat`, which takes a pointer to `struct stat`. That
will be fixed by #51785, but let's remove the unnecessary casts here
too.
Pietro Albini [Tue, 26 Jun 2018 09:35:34 +0000 (11:35 +0200)]
Rollup merge of #51153 - ogham:panic-and-compile_error-docs, r=GuillaumeGomez
Link panic and compile_error docs
This adds documentation links between `panic!()` and `compile_error!()` as per #47275, which points out that they’re similar. It also adds a sentence to the `compile_error()` docs I thought could be added.
Pietro Albini [Tue, 26 Jun 2018 09:35:33 +0000 (11:35 +0200)]
Rollup merge of #51104 - zackmdavis:dynamo, r=nikomatsakis
add `dyn ` to display of dynamic (trait) types
~~I'm not sure we want the `dyn` in the E0277 "trait bound [...] is not satisfied" messages ("bound" sounds like a different thing in contrast to the names of specific trait-object types like `Box<dyn Trait>`), but I'm finding the code I would need to change that hard to follow—the [display object seems to](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/traits/error_reporting.rs#L600) be a [`Predicate::Trait`](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L962) variant, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L1309) calls `.print` on its `PolyTraitPredicate` member, [which is a type alias](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L1112) for `ty::Binder<TraitPredicate<'tcx>>`, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L975-L985) ... _&c._— so maybe it's time to pull-request this and see what reviewers think.~~
bors [Tue, 26 Jun 2018 07:06:18 +0000 (07:06 +0000)]
Auto merge of #51613 - nnethercote:ob-forest-cleanup, r=nikomatsakis
Obligation forest cleanup
While looking at this code I was scratching my head about whether a node could appear in both `parent` and `dependents`. Turns out it can, but it's not useful to do so, so this PR cleans things up so it's no longer possible.
bors [Tue, 26 Jun 2018 03:49:37 +0000 (03:49 +0000)]
Auto merge of #50630 - sharkdp:fix-50619, r=sfackler
Fix possibly endless loop in ReadDir iterator
Certain directories in `/proc` can cause the `ReadDir` iterator to loop indefinitely. We get an error code (22) when calling libc's `readdir_r` on these directories, but `entry_ptr` is `NULL` at the same time, signalling the end of the directory stream.
This change introduces an internal state to the iterator such that the `Some(Err(..))` value will only be returned once when calling `next`. Subsequent calls will return `None`.
bors [Tue, 26 Jun 2018 01:42:14 +0000 (01:42 +0000)]
Auto merge of #50966 - leodasvacas:self-in-where-clauses-is-not-object-safe, r=nikomatsakis
`Self` in where clauses may not be object safe
Needs crater, virtually certain to cause regressions.
In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.
This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.
Mark Simulacrum [Sat, 23 Jun 2018 01:42:22 +0000 (19:42 -0600)]
Do not build LLVM tools for any of the tools
None of the tools in the list should need LLVM tools themselves as far as I can
tell; if this is incorrect, we can re-enable the tool building later.
The primary reason for doing this is that rust-central-station uses the
BuildManifest tool and building LLVM there is not cached: it takes ~1.5
hours on the 2 core machine. This commit should make nightlies and
stable releases much faster.
Josh Stone [Mon, 25 Jun 2018 19:34:33 +0000 (12:34 -0700)]
Remove unnecessary stat64 pointer casts
In effect, these just casted `&mut stat64` to `*mut stat64`, twice.
That's harmless, but it masked a problem when this was copied to new
code calling `fstatat`, which takes a pointer to `struct stat`. That
will be fixed by #51785, but let's remove the unnecessary casts here
too.
bors [Mon, 25 Jun 2018 17:22:12 +0000 (17:22 +0000)]
Auto merge of #51728 - bradjc:llvm-tools2, r=kennytm
build: add llvm-tools to manifest
This commit expands on a previous commit to build llvm-tools as a rustup component. It causes the llvm-tools component to be built if the extended step is active. It also adds llvm-tools to the build manifest so rustup can find it.
I tested this as far as I could, but had to hack `build-manifest/src/main.rs` a bit as it is not supported on MacOS. The main change I am not sure about is this line:
bors [Mon, 25 Jun 2018 13:43:22 +0000 (13:43 +0000)]
Auto merge of #51750 - zackmdavis:superstructure, r=oli-obk
three diagnostics upgrades
* reword `...` expression syntax error to not imply that you should use it in patterns either (#51043) and make it a structured suggestion
* shorten the top-line message for the trivial-casts lint by tucking the advisory sentence into a help note
* structured suggestion for pattern-named-the-same-as-variant warning
leonardo.yvens [Tue, 22 May 2018 15:09:35 +0000 (12:09 -0300)]
`Self` in where clauses may not be object safe
This is virtually certain to cause regressions, needs crater.
In #50781 it was discovered that our object safety rules are not sound because we allow `Self` in where clauses without restrain. This PR is a direct fix to the rules so that we disallow methods with unsound where clauses.
This currently uses hard error to measure impact, but we will want to downgrade it to a future compat error.
bors [Mon, 25 Jun 2018 08:54:16 +0000 (08:54 +0000)]
Auto merge of #51335 - mark-i-m:allocator, r=oli-obk
Prohibit `global_allocator` in submodules
Background: #44113 is caused by weird interactions with hygiene. Hygiene is hard. After a lot of playing around, we decided that the best path forward would be to prohibit `global_allocator`s from being in submodules for now. When somebody gets it working, we can re-enable it.
This PR contains the following
- Some hygiene "fixes" -- things I suspect are the correct thing to do that will make life easier in the future. This includes using call_site hygiene for the generated module and passing the correct crate name to the expansion config.
- Comments and minor formatting fixes
- Some debugging code
- Code to prohibit `global_allocator` in submodules
- Test checking that the proper error occurs.
Mark Mansi [Sun, 20 May 2018 22:04:00 +0000 (17:04 -0500)]
Prohibit global_allocator in submodules for now
- we need to figure out hygiene first
- change the test to check that the prohibition works with a good error
msg
- leaves some comments and debugging code
- leaves some of our supposed fixes
Zack M. Davis [Sat, 23 Jun 2018 23:57:23 +0000 (16:57 -0700)]
in which the trivial-casts word to the wise is tucked into a help note
The top level message shouldn't be too long; the
replaced-by-coercion/temporary-variable advice can live in a note. Also,
don't mention type ascription when it's not actually available as a real
thing. (The current state of discussion on the type ascription tracking
issue #23416 makes one rather suspect it will never be a stable thing in
its current form, but that's not for us to adjudicate in this commit.)
While we're here, yank out the differentiating parts of the
numeric/other conditional and only have one codepath emitting the
diagnostic.
Zack M. Davis [Sat, 23 Jun 2018 23:49:09 +0000 (16:49 -0700)]
structured suggestion and rewording for `...` expression syntax error
Now that `..=` inclusive ranges are stabilized, people probably
shouldn't be using `...` even in patterns, even if it's still legal
there (see #51043). To avoid drawing attention to `...` being a real
thing, let's reword this message to just say "unexpected token" rather
"cannot be used in expressions".
bors [Sat, 23 Jun 2018 22:27:30 +0000 (22:27 +0000)]
Auto merge of #51739 - Amanieu:update_rustfmt, r=Mark-Simulacrum
Update rustfmt submodule
The version of rustfmt currently shipped with nightly breaks code that uses `break 'label`. This PR updates the submodule to include the fix (https://github.com/rust-lang-nursery/rustfmt/pull/2774).
bors [Sat, 23 Jun 2018 14:33:10 +0000 (14:33 +0000)]
Auto merge of #51727 - varkor:expragain-to-exprcontinue, r=petrochenkov
Rename hir::ExprAgain to hir::ExprContinue
The current name is confusing and historical.
I also used this PR to clean up the annoying indentation in `check/mod.rs`. If that's viewed as too tangential a change, I'll split it up, but it seemed reasonable to slip it in to reduce @bors's work. It's easy to compare for the two commits individually.
Brad Campbell [Sat, 23 Jun 2018 09:49:02 +0000 (05:49 -0400)]
build: add llvm-tools to manifest
This commit expands on a previous commit to build llvm-tools as a rustup
component. It causes the llvm-tools component to be built if the
extended step is active. It also adds llvm-tools to the build manifest
so rustup can find it.
bors [Sat, 23 Jun 2018 09:02:45 +0000 (09:02 +0000)]
Auto merge of #51580 - cramertj:async-await, r=eddyb
async/await
This PR implements `async`/`await` syntax for `async fn` in Rust 2015 and `async` closures and `async` blocks in Rust 2018 (tracking issue: https://github.com/rust-lang/rust/issues/50547). Limitations: non-`move` async closures with arguments are currently not supported, nor are `async fn` with multiple different input lifetimes. These limitations are not fundamental and will be removed in the future, however I'd like to go ahead and get this PR merged so we can start experimenting with this in combination with futures 0.3.
Based on https://github.com/rust-lang/rust/pull/51414.
cc @petrochenkov for parsing changes.
r? @eddyb
bors [Sat, 23 Jun 2018 00:06:54 +0000 (00:06 +0000)]
Auto merge of #51697 - estebank:once-used-lifetime-label, r=oli-obk
Add label to lint for lifetimes used once
```
error: lifetime parameter `'a` only used once
--> $DIR/fn-types.rs:19:10
|
LL | a: for<'a> fn(&'a u32), //~ ERROR `'a` only used once
| ^^ -- ...is used only here
| |
| this lifetime...
```
bors [Fri, 22 Jun 2018 19:55:30 +0000 (19:55 +0000)]
Auto merge of #51681 - varkor:rustc_deprecated-future-deprecation, r=petrochenkov
Support future deprecation for rustc_deprecated
Follow-up to #49179 to allow `since` parameters to be set to future versions of Rust and correspondingly to not be treated as deprecated until that version. This is required for #30459 to be completed (though we'll need to wait until this hits beta).