mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 13:51:31 +00:00
Add some more adjustment test annotations
This commit is contained in:
parent
349f2535fb
commit
e968d834ca
1 changed files with 8 additions and 0 deletions
|
@ -51,7 +51,9 @@ fn let_stmt_coerce() {
|
|||
//- minicore: coerce_unsized
|
||||
fn test() {
|
||||
let x: &[isize] = &[1];
|
||||
// ^^^^ adjustments: Deref(None), Borrow(Ref(Not)), Pointer(Unsize)
|
||||
let x: *const [isize] = &[1];
|
||||
// ^^^^ adjustments: Deref(None), Borrow(RawPtr(Not)), Pointer(Unsize)
|
||||
}
|
||||
",
|
||||
);
|
||||
|
@ -171,9 +173,12 @@ fn test() {
|
|||
2 => t as &i32,
|
||||
//^^^^^^^^^ expected *mut i32, got &i32
|
||||
_ => t as *const i32,
|
||||
// ^^^^^^^^^^^^^^^ adjustments: Pointer(MutToConstPointer)
|
||||
|
||||
};
|
||||
x;
|
||||
//^ type: *const i32
|
||||
|
||||
}
|
||||
",
|
||||
);
|
||||
|
@ -258,6 +263,9 @@ fn coerce_fn_item_to_fn_ptr() {
|
|||
fn foo(x: u32) -> isize { 1 }
|
||||
fn test() {
|
||||
let f: fn(u32) -> isize = foo;
|
||||
// ^^^ adjustments: Pointer(ReifyFnPointer)
|
||||
let f: unsafe fn(u32) -> isize = foo;
|
||||
// ^^^ adjustments: Pointer(ReifyFnPointer)
|
||||
}",
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue