File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
src/tools/rust-analyzer/crates
ide-completion/src/completions Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -207,6 +207,14 @@ struct Display<'a> {
207207impl fmt:: Display for Display < ' _ > {
208208 fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
209209 let mut symbol = self . name . symbol . as_str ( ) ;
210+
211+ if symbol == "'static" {
212+ // FIXME: '`static` can also be a label, and there it does need escaping.
213+ // But knowing where it is will require adding a parameter to `display()`,
214+ // and that is an infectious change.
215+ return f. write_str ( symbol) ;
216+ }
217+
210218 if let Some ( s) = symbol. strip_prefix ( '\'' ) {
211219 f. write_str ( "'" ) ?;
212220 symbol = s;
Original file line number Diff line number Diff line change @@ -116,13 +116,13 @@ fn foo<'lifetime>(foo: &'a$0) {}
116116 check (
117117 r#"
118118struct Foo;
119- impl<'impl> Foo {
119+ impl<'r# impl> Foo {
120120 fn foo<'func>(&'a$0 self) {}
121121}
122122"# ,
123123 expect ! [ [ r#"
124124 lt 'func
125- lt 'impl
125+ lt 'r# impl
126126 lt 'static
127127 "# ] ] ,
128128 ) ;
You can’t perform that action at this time.
0 commit comments