Add inlay hints lifetime arg tests
This commit is contained in:
parent
ec1a29b443
commit
10e82da69d
@ -5623,7 +5623,7 @@ fn func<T: Debug>(i: Struct<'_, T>) {
|
||||
fun_name(i);
|
||||
}
|
||||
|
||||
fn $0fun_name(i: Struct<'_, T>) {
|
||||
fn $0fun_name(i: Struct<T>) {
|
||||
foo(i);
|
||||
}
|
||||
"#,
|
||||
|
@ -19,7 +19,7 @@ struct Foo<'lt, T, const C: usize> where $0 {}
|
||||
en Enum Enum
|
||||
ma makro!(…) macro_rules! makro
|
||||
md module
|
||||
st Foo<…> Foo<'{error}, {unknown}, _>
|
||||
st Foo<…> Foo<{unknown}, _>
|
||||
st Record Record
|
||||
st Tuple Tuple
|
||||
st Unit Unit
|
||||
@ -92,7 +92,7 @@ struct Foo<'lt, T, const C: usize> where for<'a> $0 {}
|
||||
en Enum Enum
|
||||
ma makro!(…) macro_rules! makro
|
||||
md module
|
||||
st Foo<…> Foo<'{error}, {unknown}, _>
|
||||
st Foo<…> Foo<{unknown}, _>
|
||||
st Record Record
|
||||
st Tuple Tuple
|
||||
st Unit Unit
|
||||
|
@ -20,8 +20,8 @@ struct Foo<'lt, T, const C: usize> {
|
||||
en Enum Enum
|
||||
ma makro!(…) macro_rules! makro
|
||||
md module
|
||||
sp Self Foo<'{error}, {unknown}, _>
|
||||
st Foo<…> Foo<'{error}, {unknown}, _>
|
||||
sp Self Foo<{unknown}, _>
|
||||
st Foo<…> Foo<{unknown}, _>
|
||||
st Record Record
|
||||
st Tuple Tuple
|
||||
st Unit Unit
|
||||
@ -45,8 +45,8 @@ fn tuple_struct_field() {
|
||||
en Enum Enum
|
||||
ma makro!(…) macro_rules! makro
|
||||
md module
|
||||
sp Self Foo<'{error}, {unknown}, _>
|
||||
st Foo<…> Foo<'{error}, {unknown}, _>
|
||||
sp Self Foo<{unknown}, _>
|
||||
st Foo<…> Foo<{unknown}, _>
|
||||
st Record Record
|
||||
st Tuple Tuple
|
||||
st Unit Unit
|
||||
|
@ -331,6 +331,25 @@ pub fn quux<T: Foo>() -> T::Bar {
|
||||
);
|
||||
}
|
||||
|
||||
#[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…
Reference in New Issue
Block a user