Commit Graph

79667 Commits

Author SHA1 Message Date
Pietro Albini
d72a67f3bb
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](f0805a4421/src/librustc/traits/error_reporting.rs (L600)) be a [`Predicate::Trait`](f0805a4421/src/librustc/ty/mod.rs (L962)) variant, whose [`Display` implementation](f0805a4421/src/librustc/util/ppaux.rs (L1309)) calls `.print` on its `PolyTraitPredicate` member, [which is a type alias](f0805a4421/src/librustc/ty/mod.rs (L1112)) for `ty::Binder<TraitPredicate<'tcx>>`, whose [`Display` implementation](f0805a4421/src/librustc/util/ppaux.rs (L975-L985)) ... _&c._— so maybe it's time to pull-request this and see what reviewers think.~~

 Resolves #49277 (?).

r? @nikomatsakis
2018-06-26 11:35:33 +02:00
bors
309fd8a6fb Auto merge of #49469 - Nokel81:allow-irrefutable-let-patterns, r=nikomatsakis
Implementation of RFC 2086 - Allow Irrefutable Let patterns

This is the set of changes for RFC2086. Tracking issue #44495. Rendered [here](https://github.com/rust-lang/rfcs/pull/2086)
2018-06-26 09:20:33 +00:00
bors
773ce53ce7 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.
2018-06-26 07:06:18 +00:00
bors
7d2fa4a4d2 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`.

fixes #50619
2018-06-26 03:49:37 +00:00
bors
fdd9cdc879 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.

Part of #50781.

r? @nikomatsakis
2018-06-26 01:42:14 +00:00
Niko Matsakis
91680347a7
make the while let loop terminate 2018-06-25 17:33:49 -04:00
Guillaume Gomez
f7485df05b Minify css 2018-06-25 23:28:20 +02:00
Esteban Küber
7aab3bf863 Don't ICE when performing lower_pattern_unadjusted on a TyError 2018-06-25 13:49:34 -07:00
Berkus Karchebnyy
07479688b2 Fix typo 2018-06-25 23:44:48 +03:00
bors
2a1c4eec40 Auto merge of #51785 - cuviper:fstatat64, r=Mark-Simulacrum
Use fstatat64 where available

None
2018-06-25 19:40:56 +00:00
Josh Stone
490f49fd2a 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.
2018-06-25 12:34:33 -07:00
Josh Stone
65d31d7269 Use fstatat64 where available 2018-06-25 11:42:27 -07:00
Guillaume Gomez
3c6c18d095 Add missing \[allow(missing_docs)\] 2018-06-25 20:38:29 +02:00
bors
b7c6e8f180 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:

```rust
self.package("llvm-tools", &mut manifest.pkg, TARGETS);
```

There are numerous calls to `self.package()`, and I'm not sure if `TARGETS`, `HOSTS`, or `["*"]` is appropriate for llvm-tools.

Otherwise I mostly copied the example set by `rustfmt-preview`.
2018-06-25 17:22:12 +00:00
varkor
c3d6ee9e7b Make find_breakable_scope non-mutable 2018-06-25 15:27:37 +01:00
bors
8acec1f9d0 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

r? @oli-obk
2018-06-25 13:43:22 +00:00
bors
ecfe37056f Auto merge of #51733 - varkor:ice-match-slice, r=oli-obk
Fix an ICE when matching over const slices

Fixes #51655. I'm not super familiar with this code, so tell me if this is the wrong approach 😅

r? @oli-obk
2018-06-25 11:36:13 +00:00
leonardo.yvens
cc60e01581 Fill in tracking issue for WHERE_CLAUSES_OBJECT_SAFETY future compat lint 2018-06-25 06:57:08 -03:00
leonardo.yvens
a602654a6e Make where clause object safety be a warn-by-default lint 2018-06-25 06:57:08 -03:00
leonardo.yvens
1453b3a67d 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.

Fixes #50781.

r? @nikomatsakis
2018-06-25 06:56:06 -03:00
bors
446aef691e 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.

cc #44113 #49320 #51241

r? @alexcrichton
2018-06-25 08:54:16 +00:00
Benjamin Sago
f85ddfbc3f
Add sentence to compile_error!() docs
It now details why using compile_error!() is different from just not having the final macro_rules!() branch.
2018-06-25 10:34:00 +02:00
Benjamin Sago
2d3c369d87
Link the docs of panic!() and compile_error!()
Fixes #47275. These two macros are similar, but different, and could do with documentation links to each other.
2018-06-25 10:33:54 +02:00
bors
5f9c7f9e6d Auto merge of #51688 - spastorino:error-note-field-after-move, r=nikomatsakis
Fix erroneous error note when using field after move

Closes #51512

r? @nikomatsakis
2018-06-25 06:44:08 +00:00
Alex Kitchens
fdc2275609 Update broken rustc-guide links
Recently, there has been some rearrangement of the content in the Rustc
Guide, and this commit changes the urls the match the updated guide.
2018-06-24 22:00:39 -05:00
mark
16d7f87b6c used debug, not info 2018-06-24 16:16:14 -05:00
mark
997655cf87 actually fix test 2018-06-24 16:16:14 -05:00
mark
e3534028eb fix test 2018-06-24 16:16:14 -05:00
Mark Mansi
08479aabd0 enable fold_mac 2018-06-24 16:16:14 -05:00
Mark Mansi
792772a93b 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
2018-06-24 16:15:13 -05:00
Mark Mansi
5da4ff8180 Attempt to fix hygiene for global_allocator 2018-06-24 16:10:20 -05:00
varkor
f94c075ab4 Add item after attribute 2018-06-24 18:20:25 +01:00
bors
01cc982e93 Auto merge of #51740 - GuillaumeGomez:fix-error-code-numbers, r=cramertj
Fix error code numbers

Fixes issue created by #51580.

r? @cramertj
2018-06-24 15:08:48 +00:00
Zack M. Davis
0b39a82cf4 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.
2018-06-23 22:57:37 -07:00
Zack M. Davis
a417518173 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".
2018-06-23 22:57:37 -07:00
Zack M. Davis
4650361fb6 use structured suggestion for pattern-named-the-same-as-variant warning 2018-06-23 22:57:37 -07:00
Zack M. Davis
4b1808578a add dyn to display of dynamic (trait) type names
The `dyn Trait` syntax was stabilized in 199ee327. Resolves #49277.
2018-06-23 18:10:25 -07:00
bors
3874676dc6 Auto merge of #51726 - petrochenkov:hygclean, r=oli-obk
expansion/hygiene: Some renaming, refactoring and comments

Pure refactoring, no functional changes.
Commits are isolated and self-descriptive.
2018-06-24 01:06:21 +00:00
varkor
82803fd9bd Add backticks to E0558 2018-06-24 00:16:10 +01:00
bors
8fb1180d27 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).
2018-06-23 22:27:30 +00:00
Brad Campbell
f10da5fdb9
build: llvm-tools: replace compiler.host
Use `target` instead.
2018-06-23 17:32:25 -04:00
varkor
74609bca80 Add error for using null characters in export_name 2018-06-23 22:31:31 +01:00
bors
60efbdead6 Auto merge of #51653 - mglagla:option-unreachable, r=dtolnay
Option::get_or_insert(_with): Replace unreachable! with unreachable_unchecked

Optimize codegen for both functions as the None branch is trivially not reachable.
2018-06-23 20:10:35 +00:00
Guillaume Gomez
8f1ef6e3be Fix error code numbers 2018-06-23 22:08:40 +02:00
Vadim Petrochenkov
20ce91076a hygiene: Merge NameAndSpan into ExpnInfo 2018-06-23 21:53:24 +03:00
Amanieu d'Antras
c44be4c231 Update Cargo.lock 2018-06-23 19:15:34 +01:00
Amanieu d'Antras
794acd7047 Update rustfmt submodule 2018-06-23 18:54:42 +01:00
Vadim Petrochenkov
117cb040f1 hygiene: Make sure transparency of Mark::root() is an implementation detail and cannot be inspected outside of hygiene.rs 2018-06-23 20:42:25 +03:00
Vadim Petrochenkov
c00f5af4d6 hygiene: Do not reset expansion info for quote! 2018-06-23 20:40:25 +03:00
Vadim Petrochenkov
fffe9fbb51 hygiene: More descriptive names for things involved in late hygienic name resolution 2018-06-23 20:09:21 +03:00