Skip to content

Commit a3409fd

Browse files
authored
Rollup merge of #148554 - chenyukang:test-issue-148542, r=jieyouxu
Add regression test for issue 148542 Closes #148542
2 parents 320af6b + 55b0125 commit a3409fd

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ edition: 2021
2+
3+
// Regression test for #148542
4+
// Ensure we don't ICE with "Invalid `ConstKind` for `const_to_pat`: {const error}"
5+
6+
fn foo() where &str:, {
7+
//~^ ERROR `&` without an explicit lifetime name cannot be used here
8+
match 42_u8 {
9+
-10.. => {}
10+
}
11+
}
12+
13+
fn main() {}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error[E0637]: `&` without an explicit lifetime name cannot be used here
2+
--> $DIR/const-error-ice-issue-148542.rs:6:16
3+
|
4+
LL | fn foo() where &str:, {
5+
| ^ explicit lifetime name needed here
6+
|
7+
help: consider introducing a higher-ranked lifetime here
8+
|
9+
LL | fn foo() where for<'a> &'a str:, {
10+
| +++++++ ++
11+
12+
error: aborting due to 1 previous error
13+
14+
For more information about this error, try `rustc --explain E0637`.

0 commit comments

Comments
 (0)