File tree 5 files changed +7
-20
lines changed
compiler/rustc_passes/src
5 files changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -287,8 +287,9 @@ impl CheckAttrVisitor<'tcx> {
287
287
self . doc_alias_str_error ( meta) ;
288
288
return false ;
289
289
}
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 != ' ' ) )
292
293
{
293
294
self . tcx
294
295
. sess
Original file line number Diff line number Diff line change @@ -11,6 +11,5 @@ pub struct Bar;
11
11
#[ doc( alias = "\n " ) ] //~ ERROR
12
12
#[ doc( alias = "
13
13
" ) ] //~^ ERROR
14
- #[ doc( alias = " " ) ] //~ ERROR
15
14
#[ doc( alias = "\t " ) ] //~ ERROR
16
15
pub struct Foo ;
Original file line number Diff line number Diff line change @@ -36,17 +36,11 @@ LL | #[doc(alias = "
36
36
LL | | ")]
37
37
| |_^
38
38
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
-
45
39
error: '\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
47
41
|
48
42
LL | #[doc(alias = "\t")]
49
43
| ^^^^^^^^^^^^
50
44
51
- error: aborting due to 8 previous errors
45
+ error: aborting due to 7 previous errors
52
46
Original file line number Diff line number Diff line change @@ -11,6 +11,5 @@ pub struct Bar;
11
11
#[ doc( alias = "\n " ) ] //~ ERROR
12
12
#[ doc( alias = "
13
13
" ) ] //~^ ERROR
14
- #[ doc( alias = " " ) ] //~ ERROR
15
14
#[ doc( alias = "\t " ) ] //~ ERROR
16
15
pub struct Foo ;
Original file line number Diff line number Diff line change @@ -36,17 +36,11 @@ LL | #[doc(alias = "
36
36
LL | | ")]
37
37
| |_^
38
38
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
-
45
39
error: '\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
47
41
|
48
42
LL | #[doc(alias = "\t")]
49
43
| ^^^^^^^^^^^^
50
44
51
- error: aborting due to 8 previous errors
45
+ error: aborting due to 7 previous errors
52
46
You can’t perform that action at this time.
0 commit comments