File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ fn get_param_name_hints(
162162 . zip ( args)
163163 . filter_map ( |( ( param, _ty) , arg) | {
164164 let param_name = match param? {
165- Either :: Left ( self_param ) => self_param . to_string ( ) ,
165+ Either :: Left ( _ ) => "self" . to_string ( ) ,
166166 Either :: Right ( pat) => match pat {
167167 ast:: Pat :: IdentPat ( it) => it. name ( ) ?. to_string ( ) ,
168168 _ => return None ,
@@ -809,7 +809,7 @@ fn main() {
809809 t.method(123);
810810 //^^^ param
811811 Test::method(&t, 3456);
812- //^^ & self ^^^^ param
812+ //^^ self ^^^^ param
813813 Test::from_syntax(
814814 FileId {},
815815 //^^^^^^^^^ file_id
@@ -1360,4 +1360,25 @@ fn main() {
13601360 "# ,
13611361 ) ;
13621362 }
1363+
1364+ #[ test]
1365+ fn self_param_hints ( ) {
1366+ check (
1367+ r#"
1368+ struct Foo;
1369+
1370+ impl Foo {
1371+ fn foo(self: Self) {}
1372+ fn bar(self: &Self) {}
1373+ }
1374+
1375+ fn main() {
1376+ Foo::foo(Foo);
1377+ //^^^ self
1378+ Foo::bar(&Foo);
1379+ //^^^^ self
1380+ }
1381+ "# ,
1382+ )
1383+ }
13631384}
You can’t perform that action at this time.
0 commit comments