@@ -36,13 +36,13 @@ pub enum LifetimeElisionHints {
36
36
37
37
#[ derive( Clone , Debug , PartialEq , Eq ) ]
38
38
pub enum InlayKind {
39
- ImplicitReborrow ,
40
- TypeHint ,
41
- ParameterHint ,
42
- ClosureReturnTypeHint ,
43
39
ChainingHint ,
40
+ ClosureReturnTypeHint ,
44
41
GenericParamListHint ,
42
+ ImplicitReborrow ,
45
43
LifetimeHint ,
44
+ ParameterHint ,
45
+ TypeHint ,
46
46
}
47
47
48
48
#[ derive( Debug ) ]
@@ -110,11 +110,11 @@ fn hints(
110
110
config : & InlayHintsConfig ,
111
111
node : SyntaxNode ,
112
112
) {
113
- let krate = match sema. scope ( & node) {
114
- Some ( it) => it. krate ( ) ,
113
+ let famous_defs = match sema. scope ( & node) {
114
+ Some ( it) => FamousDefs ( sema , it. krate ( ) ) ,
115
115
None => return ,
116
116
} ;
117
- let famous_defs = FamousDefs ( sema , krate ) ;
117
+
118
118
if let Some ( expr) = ast:: Expr :: cast ( node. clone ( ) ) {
119
119
chaining_hints ( hints, sema, & famous_defs, config, & expr) ;
120
120
match expr {
@@ -1637,10 +1637,7 @@ fn main() {
1637
1637
fn skip_constructor_and_enum_type_hints ( ) {
1638
1638
check_with_config (
1639
1639
InlayHintsConfig {
1640
- render_colons : true ,
1641
1640
type_hints : true ,
1642
- parameter_hints : true ,
1643
- chaining_hints : true ,
1644
1641
hide_named_constructor_hints : true ,
1645
1642
..DISABLED_CONFIG
1646
1643
} ,
@@ -2147,33 +2144,36 @@ impl () {
2147
2144
#[ test]
2148
2145
fn hints_implicit_reborrow ( ) {
2149
2146
check_with_config (
2150
- InlayHintsConfig { reborrow_hints : true , ..DISABLED_CONFIG } ,
2147
+ InlayHintsConfig { reborrow_hints : true , parameter_hints : true , ..DISABLED_CONFIG } ,
2151
2148
r#"
2152
2149
fn __() {
2153
2150
let unique = &mut ();
2154
2151
let r_mov = unique;
2155
2152
let foo: &mut _ = unique;
2156
2153
//^^^^^^ &mut *
2157
2154
ref_mut_id(unique);
2155
+ //^^^^^^ mut_ref
2158
2156
//^^^^^^ &mut *
2159
2157
let shared = ref_id(unique);
2158
+ //^^^^^^ shared_ref
2160
2159
//^^^^^^ &*
2161
2160
let mov = shared;
2162
2161
let r_mov: &_ = shared;
2163
2162
ref_id(shared);
2163
+ //^^^^^^ shared_ref
2164
2164
2165
2165
identity(unique);
2166
2166
identity(shared);
2167
2167
}
2168
2168
fn identity<T>(t: T) -> T {
2169
2169
t
2170
2170
}
2171
- fn ref_mut_id(x : &mut ()) -> &mut () {
2172
- x
2173
- //^ &mut *
2171
+ fn ref_mut_id(mut_ref : &mut ()) -> &mut () {
2172
+ mut_ref
2173
+ //^^^^^^^ &mut *
2174
2174
}
2175
- fn ref_id(x : &()) -> &() {
2176
- x
2175
+ fn ref_id(shared_ref : &()) -> &() {
2176
+ shared_ref
2177
2177
}
2178
2178
"# ,
2179
2179
) ;
0 commit comments