Skip to content

Rollup of 10 pull requests - #72768

Merged
bors merged 38 commits into
rust-lang:masterfrom
JohnTitor:rollup-6kwokh6
May 30, 2020
Merged

Rollup of 10 pull requests#72768
bors merged 38 commits into
rust-lang:masterfrom
JohnTitor:rollup-6kwokh6

Conversation

@JohnTitor

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost

XAMPPRockyand others added 30 commits May 9, 2020 02:13
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Fixesrust-lang#72590
With PR rust-lang#70551, observing a `ty::Error` guarantees that compilation is
going to fail. Therefore, there are no soundness impliciations to
continuing on when we encounter a `ty::Error` - we can only affect
whether or not additional error messags are emitted.
By not bailing out, we avoid incorrectly determining that types are
`!Sized` when a type error is present, which allows us to avoid emitting
additional spurious error messages.
The original comment mentioned this code being shared by coherence -
howver, this change resulted in no diagnostic changes in any of the
existing tests.
Make sure code in `#[test]` blocks counts as a use of a crate.
fix comment
add newline for tidy fmt error...
edit suggestion message
change the suggestion message to better handle cases with binding modes
Apply suggestions from estebank code review
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
edits to address source review
Apply suggestions from estebank code review #2
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
update test files
This adds new optional methods on `Extend`: `extend_one` add a single
element to the collection, and `extend_reserve` pre-allocates space for
the predicted number of incoming elements. These are used in `Iterator`
for `partition` and `unzip` as they shuffle elements one-at-a-time into
their respective collections.
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Add Extend::{extend_one,extend_reserve}
This adds new optional methods on `Extend`: `extend_one` add a single
element to the collection, and `extend_reserve` pre-allocates space for
the predicted number of incoming elements. These are used in `Iterator`
for `partition` and `unzip` as they shuffle elements one-at-a-time into
their respective collections.
…bk,eddyb
Miri read_discriminant: return a scalar instead of raw underlying bytes
r? @oli-obk@eddyb
…=nikomatsakis
Don't bail out of trait selection when predicate references an error
Fixesrust-lang#72590
With PR rust-lang#70551, observing a `ty::Error` guarantees that compilation is
going to fail. Therefore, there are no soundness impliciations to
continuing on when we encounter a `ty::Error` - we can only affect
whether or not additional error messags are emitted.
By not bailing out, we avoid incorrectly determining that types are
`!Sized` when a type error is present, which allows us to avoid emitting
additional spurious error messages.
The original comment mentioned this code being shared by coherence -
howver, this change resulted in no diagnostic changes in any of the
existing tests.
Fix diagnostics for `@ ..` binding pattern in tuples and tuple structs
Fixesrust-lang#72574
Associated rust-lang#72534rust-lang#72373
Includes a new suggestion with `Applicability::MaybeIncorrect` confidence level.
### Before
#### tuple
```
error: `..` patterns are not allowed here
--> src/main.rs:4:19
|
4 | (_a, _x @ ..) => {}
| ^^
|
= note: only allowed in tuple, tuple struct, and slice patterns
error[E0308]: mismatched types
--> src/main.rs:4:9
|
3 | match x {
| - this expression has type `({integer}, {integer}, {integer})`
4 | (_a, _x @ ..) => {}
| ^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 2 elements
|
= note: expected tuple `({integer}, {integer}, {integer})`
found tuple `(_, _)`
error: aborting due to 2 previous errors
```
#### tuple struct
```
error: `..` patterns are not allowed here
--> src/main.rs:6:25
|
6 | Binder(_a, _x @ ..) => {}
| ^^
|
= note: only allowed in tuple, tuple struct, and slice patterns
error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 3 fields
--> src/main.rs:6:9
|
1 | struct Binder(i32, i32, i32);
| ----------------------------- tuple struct defined here
...
6 | Binder(_a, _x @ ..) => {}
| ^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 2
error: aborting due to 2 previous errors
```
### After
*Note: final output edited during source review discussion, see thread for details*
#### tuple
```
error: `_x @` is not allowed in a tuple
--> src/main.rs:4:14
|
4 | (_a, _x @ ..) => {}
| ^^^^^^^ is only allowed in a slice
|
help: replace with `..` or use a different valid pattern
|
4 | (_a, ..) => {}
| ^^
error[E0308]: mismatched types
--> src/main.rs:4:9
|
3 | match x {
| - this expression has type `({integer}, {integer}, {integer})`
4 | (_a, _x @ ..) => {}
| ^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 1 element
|
= note: expected tuple `({integer}, {integer}, {integer})`
found tuple `(_,)`
error: aborting due to 2 previous errors
```
#### tuple struct
```
error: `_x @` is not allowed in a tuple struct
--> src/main.rs:6:20
|
6 | Binder(_a, _x @ ..) => {}
| ^^^^^^^ is only allowed in a slice
|
help: replace with `..` or use a different valid pattern
|
6 | Binder(_a, ..) => {}
| ^^
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 3 fields
--> src/main.rs:6:9
|
1 | struct Binder(i32, i32, i32);
| ----------------------------- tuple struct defined here
...
6 | Binder(_a, _x @ ..) => {}
| ^^^^^^^^^^^^^^^^^^^ expected 3 fields, found 1
error: aborting due to 2 previous errors
```
r? @estebank
Add test to make sure -Wunused-crate-dependencies works with tests
Make sure code in `#[test]` blocks counts as a use of a crate.
…, r=petrochenkov
Revert recursive `TokenKind::Interpolated` expansion for now
The crater run rust-lang#72622 revealed many root regressions, at least one of which is going to take some time to fix.
For now, let's revert rust-lang#72388 to allow the 709 affected crates to continue building on the latest nightly.
Remove unused mut from long-linker-command-lines test
…, r=petrochenkov
Remove remaining calls to `as_local_node_id`
Split out from rust-lang#72552
cc rust-lang#50928
@JohnTitor

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=10

@bors

bors commented May 30, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 025058f has been approved by JohnTitor

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 30, 2020
@bors

bors commented May 30, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 025058f with merge 7e517c41ccf0f2f2105013840f9a2c3a078672cf...

@JohnTitorJohnTitor added the rollup A PR which is a rollup label May 30, 2020
@bors

bors commented May 30, 2020

Copy link
Copy Markdown
Collaborator

💥 Test timed out

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels May 30, 2020
@JohnTitor

Copy link
Copy Markdown
MemberAuthor

@bors retry

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 30, 2020
@bors

bors commented May 30, 2020

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 025058f with merge 91fb72a...

@bors

bors commented May 30, 2020

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-azure
Approved by: JohnTitor
Pushing 91fb72a to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label May 30, 2020
@bors
bors merged commit 91fb72a into rust-lang:masterMay 30, 2020
@JohnTitor
JohnTitor deleted the rollup-6kwokh6 branch May 30, 2020 11:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.rollupA PR which is a rollupS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

11 participants

@JohnTitor@bors@XAMPPRocky@RalfJung@Aaron1011@jsgf@tmiasko@lcnr@marmeladema@chrissimpkins@cuviper