forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#106183 - matthiaskrgr:rollup-ww6yzhi, r=matth…
…iaskrgr Rollup of 3 pull requests Successful merges: - rust-lang#105817 (Remove unreasonable help message for auto trait) - rust-lang#105994 (Add regression test for rust-lang#99647) - rust-lang#106066 (Always suggest as `MachineApplicable` in `recover_intersection_pat`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
12 changed files
with
105 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
15 changes: 15 additions & 0 deletions
15
src/test/ui/const-generics/generic_const_exprs/issue-99647.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// edition:2018 | ||
// run-pass | ||
|
||
#![allow(incomplete_features)] | ||
#![feature(generic_const_exprs)] | ||
|
||
#[allow(unused)] | ||
async fn foo<'a>() { | ||
let _data = &mut [0u8; { 1 + 4 }]; | ||
bar().await | ||
} | ||
|
||
async fn bar() {} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// This tests the parser recovery in `recover_intersection_pat` | ||
// and serves as a regression test for the diagnostics issue #65400. | ||
// | ||
// The general idea is that for `$pat_lhs @ $pat_rhs` where | ||
// `$pat_lhs` is not generated by `ref? mut? $ident` we want | ||
// to suggest either switching the order or note that intersection | ||
// patterns are not allowed. | ||
|
||
// run-rustfix | ||
|
||
#![allow(unused_variables)] | ||
|
||
fn main() { | ||
let s: Option<u8> = None; | ||
|
||
match s { | ||
y @ Some(x) => {} | ||
//~^ ERROR pattern on wrong side of `@` | ||
//~| pattern on the left, should be on the right | ||
//~| binding on the right, should be on the left | ||
//~| HELP switch the order | ||
//~| SUGGESTION y @ Some(x) | ||
_ => {} | ||
} | ||
|
||
match 2 { | ||
e @ 1..=5 => {} | ||
//~^ ERROR pattern on wrong side of `@` | ||
//~| pattern on the left, should be on the right | ||
//~| binding on the right, should be on the left | ||
//~| HELP switch the order | ||
//~| SUGGESTION e @ 1..=5 | ||
_ => {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// This tests the parser recovery in `recover_intersection_pat` | ||
// and serves as a regression test for the diagnostics issue #65400. | ||
// | ||
// The general idea is that for `$pat_lhs @ $pat_rhs` where | ||
// `$pat_lhs` is not generated by `ref? mut? $ident` we want | ||
// to suggest either switching the order or note that intersection | ||
// patterns are not allowed. | ||
|
||
fn main() { | ||
let s: Option<u8> = None; | ||
|
||
match s { | ||
Some(x) @ Some(y) => {} | ||
//~^ ERROR left-hand side of `@` must be a binding | ||
//~| interpreted as a pattern, not a binding | ||
//~| also a pattern | ||
//~| NOTE bindings are `x`, `mut x`, `ref x`, and `ref mut x` | ||
_ => {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error: left-hand side of `@` must be a binding | ||
--> $DIR/intersection-patterns-2.rs:13:9 | ||
| | ||
LL | Some(x) @ Some(y) => {} | ||
| -------^^^------- | ||
| | | | ||
| | also a pattern | ||
| interpreted as a pattern, not a binding | ||
| | ||
= note: bindings are `x`, `mut x`, `ref x`, and `ref mut x` | ||
|
||
error: aborting due to previous error | ||
|