Normalize type alias in projected_ty

This commit is contained in:
hkalbasi 2023-07-17 01:16:26 +03:30
parent 41b8b0b77d
commit 832eb0d94c
2 changed files with 45 additions and 4 deletions

View file

@ -1084,6 +1084,33 @@ fn f() {
);
}
#[test]
fn regression_15143() {
check_diagnostics(
r#"
trait Tr {
type Ty;
}
struct A;
impl Tr for A {
type Ty = (u32, i64);
}
struct B<T: Tr> {
f: <T as Tr>::Ty,
}
fn main(b: B<A>) {
let f = b.f.0;
f = 5;
//^^^^^ 💡 error: cannot mutate immutable variable `f`
}
"#,
);
}
#[test]
fn allow_unused_mut_for_identifiers_starting_with_underline() {
check_diagnostics(