File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change @@ -938,6 +938,47 @@ struct Foo(usize);
938
938
impl FooB for Foo {
939
939
$0fn foo< 'lt>(& 'lt self){}
940
940
941
+ }
942
+ "# ,
943
+ )
944
+ }
945
+
946
+ #[ test]
947
+ fn macro_trait_dyn_absolute_path ( ) {
948
+ // https://github.com/rust-analyzer/rust-analyzer/issues/11100
949
+ check_assist (
950
+ add_missing_impl_members,
951
+ r#"
952
+ macro_rules! foo {
953
+ () => {
954
+ trait MacroTrait {
955
+ fn trait_method(_: &dyn ::core::marker::Sized);
956
+ }
957
+ }
958
+ }
959
+ foo!();
960
+ struct Foo;
961
+
962
+ impl MacroTrait for Foo {
963
+ $0
964
+ }
965
+ "# ,
966
+ r#"
967
+ macro_rules! foo {
968
+ () => {
969
+ trait MacroTrait {
970
+ fn trait_method(_: &dyn ::core::marker::Sized);
971
+ }
972
+ }
973
+ }
974
+ foo!();
975
+ struct Foo;
976
+
977
+ impl MacroTrait for Foo {
978
+ fn trait_method(_: &dyn ::core::marker::Sized) {
979
+ ${0:todo!()}
980
+ }
981
+
941
982
}
942
983
"# ,
943
984
)
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ pub fn insert_ws_into(syn: SyntaxNode) -> SyntaxNode {
88
88
LIFETIME_IDENT if is_next ( |it| is_text ( it) , true ) => {
89
89
mods. push ( do_ws ( after, tok) ) ;
90
90
}
91
- AS_KW => {
91
+ AS_KW | DYN_KW => {
92
92
mods. push ( do_ws ( after, tok) ) ;
93
93
}
94
94
T ! [ ; ] => {
You can’t perform that action at this time.
0 commit comments