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#72506 - Nadrieril:fix-72476, r=matthewjasper
Exhaustiveness checking: work around type normalization issues This should resolve rust-lang#72476 and probably rust-lang#72467. This is a bit hacky but that's actually what the code was doing before rust-lang#71930. I'm essentially reverting rust-lang@e5a2cd5. So despite being hacky, it's been tried and tested (so much so that code relies on it now x)). Only the third commit does anything interesting.
- Loading branch information
Showing
2 changed files
with
52 additions
and
19 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
22 changes: 22 additions & 0 deletions
22
src/test/ui/pattern/usefulness/issue-72476-associated-type.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,22 @@ | ||
// check-pass | ||
|
||
// From https://github.com/rust-lang/rust/issues/72476 | ||
|
||
trait A { | ||
type Projection; | ||
} | ||
|
||
impl A for () { | ||
type Projection = bool; | ||
} | ||
|
||
struct Next<T: A>(T::Projection); | ||
|
||
fn f(item: Next<()>) { | ||
match item { | ||
Next(true) => {} | ||
Next(false) => {} | ||
} | ||
} | ||
|
||
fn main() {} |