File tree Expand file tree Collapse file tree 5 files changed +7
-20
lines changed
compiler/rustc_passes/src Expand file tree Collapse file tree 5 files changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -287,8 +287,9 @@ impl CheckAttrVisitor<'tcx> {
287287 self . doc_alias_str_error ( meta) ;
288288 return false ;
289289 }
290- if let Some ( c) =
291- doc_alias. chars ( ) . find ( |& c| c == '"' || c == '\'' || c. is_whitespace ( ) )
290+ if let Some ( c) = doc_alias
291+ . chars ( )
292+ . find ( |& c| c == '"' || c == '\'' || ( c. is_whitespace ( ) && c != ' ' ) )
292293 {
293294 self . tcx
294295 . sess
Original file line number Diff line number Diff line change @@ -11,6 +11,5 @@ pub struct Bar;
1111#[ doc( alias = "\n " ) ] //~ ERROR
1212#[ doc( alias = "
1313" ) ] //~^ ERROR
14- #[ doc( alias = " " ) ] //~ ERROR
1514#[ doc( alias = "\t " ) ] //~ ERROR
1615pub struct Foo ;
Original file line number Diff line number Diff line change @@ -36,17 +36,11 @@ LL | #[doc(alias = "
3636LL | | ")]
3737 | |_^
3838
39- error: ' ' character isn't allowed in `#[doc(alias = "...")]`
40- --> $DIR/check-doc-alias-attr.rs:14:7
41- |
42- LL | #[doc(alias = " ")]
43- | ^^^^^^^^^^^
44-
4539error: '\t' character isn't allowed in `#[doc(alias = "...")]`
46- --> $DIR/check-doc-alias-attr.rs:15 :7
40+ --> $DIR/check-doc-alias-attr.rs:14 :7
4741 |
4842LL | #[doc(alias = "\t")]
4943 | ^^^^^^^^^^^^
5044
51- error: aborting due to 8 previous errors
45+ error: aborting due to 7 previous errors
5246
Original file line number Diff line number Diff line change @@ -11,6 +11,5 @@ pub struct Bar;
1111#[ doc( alias = "\n " ) ] //~ ERROR
1212#[ doc( alias = "
1313" ) ] //~^ ERROR
14- #[ doc( alias = " " ) ] //~ ERROR
1514#[ doc( alias = "\t " ) ] //~ ERROR
1615pub struct Foo ;
Original file line number Diff line number Diff line change @@ -36,17 +36,11 @@ LL | #[doc(alias = "
3636LL | | ")]
3737 | |_^
3838
39- error: ' ' character isn't allowed in `#[doc(alias = "...")]`
40- --> $DIR/check-doc-alias-attr.rs:14:7
41- |
42- LL | #[doc(alias = " ")]
43- | ^^^^^^^^^^^
44-
4539error: '\t' character isn't allowed in `#[doc(alias = "...")]`
46- --> $DIR/check-doc-alias-attr.rs:15 :7
40+ --> $DIR/check-doc-alias-attr.rs:14 :7
4741 |
4842LL | #[doc(alias = "\t")]
4943 | ^^^^^^^^^^^^
5044
51- error: aborting due to 8 previous errors
45+ error: aborting due to 7 previous errors
5246
You can’t perform that action at this time.
0 commit comments