mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Add inlay hints lifetime arg tests
This commit is contained in:
parent
31304ad1ad
commit
ec941e599a
4 changed files with 27 additions and 8 deletions
|
@ -331,6 +331,25 @@ fn main(a: SliceIter<'_, Container>) {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn lt_hints() {
|
||||
check_types(
|
||||
r#"
|
||||
struct S<'lt>;
|
||||
|
||||
fn f<'a>() {
|
||||
let x = S::<'static>;
|
||||
//^ S<'static>
|
||||
let y = S::<'_>;
|
||||
//^ S
|
||||
let z = S::<'a>;
|
||||
//^ S<'a>
|
||||
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fn_hints() {
|
||||
check_types(
|
||||
|
@ -341,7 +360,7 @@ fn foo1() -> impl Fn(f64) { loop {} }
|
|||
fn foo2() -> impl Fn(f64, f64) { loop {} }
|
||||
fn foo3() -> impl Fn(f64, f64) -> u32 { loop {} }
|
||||
fn foo4() -> &'static dyn Fn(f64, f64) -> u32 { loop {} }
|
||||
fn foo5() -> &'static dyn Fn(&'static dyn Fn(f64, f64) -> u32, f64) -> u32 { loop {} }
|
||||
fn foo5() -> &'static for<'a> dyn Fn(&'a dyn Fn(f64, f64) -> u32, f64) -> u32 { loop {} }
|
||||
fn foo6() -> impl Fn(f64, f64) -> u32 + Sized { loop {} }
|
||||
fn foo7() -> *const (impl Fn(f64, f64) -> u32 + Sized) { loop {} }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue