Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tests/ui/pattern/const-error-ice-issue-148542.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//@ edition: 2021

// Regression test for #148542
// Ensure we don't ICE with "Invalid `ConstKind` for `const_to_pat`: {const error}"

fn foo() where &str:, {
//~^ ERROR `&` without an explicit lifetime name cannot be used here
match 42_u8 {
-10.. => {}
}
}

fn main() {}
14 changes: 14 additions & 0 deletions tests/ui/pattern/const-error-ice-issue-148542.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
error[E0637]: `&` without an explicit lifetime name cannot be used here
--> $DIR/const-error-ice-issue-148542.rs:6:16
|
LL | fn foo() where &str:, {
| ^ explicit lifetime name needed here
|
help: consider introducing a higher-ranked lifetime here
|
LL | fn foo() where for<'a> &'a str:, {
| +++++++ ++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0637`.
Loading