-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #133520 - compiler-errors:structurally-resolve-mir-bo…
…rrowck, r=lcnr Structurally resolve before applying projection in borrowck As far as I can tell, all other `.normalize` calls in borrowck are noops and can remain that way. This is the only one that actually requires structurally resolving the type. r? lcnr
- Loading branch information
Showing
3 changed files
with
72 additions
and
2 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
32 changes: 32 additions & 0 deletions
32
tests/ui/traits/next-solver/structurally-normalize-in-borrowck-field-projection.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,32 @@ | ||
//@ check-pass | ||
//@ compile-flags: -Znext-solver | ||
|
||
trait Interner: Sized { | ||
type Value; | ||
} | ||
|
||
enum Kind<I: Interner> { | ||
Value(I::Value), | ||
} | ||
|
||
struct Intern; | ||
|
||
impl Interner for Intern { | ||
type Value = Wrap<u32>; | ||
} | ||
|
||
struct Wrap<T>(T); | ||
|
||
type KindAlias = Kind<Intern>; | ||
|
||
trait PrettyPrinter: Sized { | ||
fn hello(c: KindAlias) { | ||
match c { | ||
KindAlias::Value(Wrap(v)) => { | ||
println!("{v:?}"); | ||
} | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |