mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Normalize type alias in projected_ty
This commit is contained in:
parent
41b8b0b77d
commit
832eb0d94c
2 changed files with 45 additions and 4 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue