-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ICE when
indirect_structural_match
is allowed
- Loading branch information
1 parent
3bb9eec
commit 402ebc7
Showing
2 changed files
with
30 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Regression test for the ICE described in #89088. | ||
|
||
// check-pass | ||
|
||
#![allow(indirect_structural_match)] | ||
use std::borrow::Cow; | ||
|
||
const FOO: &A = &A::Field(Cow::Borrowed("foo")); | ||
|
||
#[derive(PartialEq, Eq)] | ||
enum A { | ||
Field(Cow<'static, str>) | ||
} | ||
|
||
fn main() { | ||
let var = A::Field(Cow::Borrowed("bar")); | ||
|
||
match &var { | ||
FOO => todo!(), | ||
_ => todo!() | ||
} | ||
} |