Skip to content

Commit

Permalink
compiletest: make path normalization smarter
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed Mar 25, 2019
1 parent 4691471 commit 695dfe7
Show file tree
Hide file tree
Showing 35 changed files with 247 additions and 154 deletions.
Expand Up @@ -9,7 +9,7 @@ note: lint level defined here
|
LL | #![deny(intra_doc_link_resolution_failure)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/intra-doc-alias-ice.stderr
Expand Up @@ -9,7 +9,7 @@ note: lint level defined here
|
LL | #![deny(intra_doc_link_resolution_failure)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

error: aborting due to previous error

2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/intra-link-span-ice-55723.stderr
Expand Up @@ -9,7 +9,7 @@ note: lint level defined here
|
LL | #![deny(intra_doc_link_resolution_failure)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

error: aborting due to previous error

8 changes: 4 additions & 4 deletions src/test/rustdoc-ui/intra-links-warning-crlf.stderr
Expand Up @@ -5,29 +5,29 @@ LL | /// [error]
| ^^^^^ cannot be resolved, ignoring
|
= note: #[warn(intra_doc_link_resolution_failure)] on by default
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error1]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning-crlf.rs:12:11
|
LL | /// docs [error1]
| ^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error2]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning-crlf.rs:14:11
|
LL | /// docs [error2]
| ^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning-crlf.rs:21:20
|
LL | * It also has an [error].
| ^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

44 changes: 22 additions & 22 deletions src/test/rustdoc-ui/intra-links-warning.stderr
Expand Up @@ -5,71 +5,71 @@ LL | //! Test with [Foo::baz], [Bar::foo], ...
| ^^^^^^^^ cannot be resolved, ignoring
|
= note: #[warn(intra_doc_link_resolution_failure)] on by default
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[Bar::foo]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:3:35
|
LL | //! Test with [Foo::baz], [Bar::foo], ...
| ^^^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[Uniooon::X]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:4:13
|
LL | //! , [Uniooon::X] and [Qux::Z].
| ^^^^^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[Qux::Z]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:4:30
|
LL | //! , [Uniooon::X] and [Qux::Z].
| ^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[Uniooon::X]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:6:14
|
LL | //! , [Uniooon::X] and [Qux::Z].
| ^^^^^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[Qux::Z]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:6:31
|
LL | //! , [Uniooon::X] and [Qux::Z].
| ^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[Qux:Y]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:8:13
|
LL | /// [Qux:Y]
| ^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:51:30
|
LL | * time to introduce a link [error]*/
| ^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:57:30
|
LL | * time to introduce a link [error]
| ^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:61:1
Expand All @@ -81,19 +81,19 @@ LL | #[doc = "single line [error]"]

single line [error]
^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:64:1
|
LL | #[doc = "single line with /"escaping/" [error]"]
LL | #[doc = "single line with \"escaping\" [error]"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the link appears in this line:

single line with "escaping" [error]
^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:67:1
Expand All @@ -107,72 +107,72 @@ LL | | /// [error]

[error]
^^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error1]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:73:11
|
LL | /// docs [error1]
| ^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[error2]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:75:11
|
LL | /// docs [error2]
| ^^^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[BarA]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:14:10
|
LL | /// bar [BarA] bar
| ^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[BarB]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:20:9
|
LL | * bar [BarB] bar
| ^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[BarC]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:27:6
|
LL | bar [BarC] bar
| ^^^^ cannot be resolved, ignoring
|
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[BarD]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:38:1
|
LL | #[doc = "Foo/nbar [BarD] bar/nbaz"]
LL | #[doc = "Foo\nbar [BarD] bar\nbaz"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: the link appears in this line:

bar [BarD] bar
^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

warning: `[BarF]` cannot be resolved, ignoring it...
--> $DIR/intra-links-warning.rs:43:9
|
LL | #[doc = $f]
| ^^^^^^^^^^^
...
LL | f!("Foo/nbar [BarF] bar/nbaz");
LL | f!("Foo\nbar [BarF] bar\nbaz");
| ------------------------------- in this macro invocation
|
= note: the link appears in this line:

bar [BarF] bar
^^^^
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

22 changes: 11 additions & 11 deletions src/test/rustdoc-ui/invalid-syntax.stderr
Expand Up @@ -3,11 +3,11 @@ warning: could not parse code block as Rust code
|
LL | /// ```
| _____^
LL | | /// /__________pkt->size___________/ /_result->size_/ /__pkt->size__/
LL | | /// \__________pkt->size___________/ \_result->size_/ \__pkt->size__/
LL | | /// ```
| |_______^
|
= note: error from rustc: unknown start of token: /
= note: error from rustc: unknown start of token: \
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
Expand Down Expand Up @@ -35,11 +35,11 @@ warning: could not parse code block as Rust code
|
LL | /// ```
| _____^
LL | | /// /_
LL | | /// \_
LL | | /// ```
| |_______^
|
= note: error from rustc: unknown start of token: /
= note: error from rustc: unknown start of token: \
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
Expand All @@ -50,21 +50,21 @@ warning: could not parse code block as Rust code
|
LL | /// ```rust
| _____^
LL | | /// /_
LL | | /// \_
LL | | /// ```
| |_______^
|
= note: error from rustc: unknown start of token: /
= note: error from rustc: unknown start of token: \

warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:41:9
|
LL | /// code with bad syntax
| _________^
LL | | /// /_
LL | | /// \_
| |__________^
|
= note: error from rustc: unknown start of token: /
= note: error from rustc: unknown start of token: \

warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:55:9
Expand All @@ -79,17 +79,17 @@ warning: could not parse code block as Rust code
|
LL | /// ```edition2018
| _____^
LL | | /// /_
LL | | /// \_
LL | | /// ```
| |_______^
|
= note: error from rustc: unknown start of token: /
= note: error from rustc: unknown start of token: \

warning: doc comment contains an invalid Rust code block
--> $DIR/invalid-syntax.rs:63:1
|
LL | / #[doc = "```"]
LL | | /// /_
LL | | /// \_
LL | | #[doc = "```"]
| |______________^
|
Expand Down
2 changes: 1 addition & 1 deletion src/test/rustdoc-ui/lint-group.stderr
Expand Up @@ -27,7 +27,7 @@ note: lint level defined here
LL | #![deny(rustdoc)]
| ^^^^^^^
= note: #[deny(intra_doc_link_resolution_failure)] implied by #[deny(rustdoc)]
= help: to escape `[` and `]` characters, just add '/' before them like `/[` or `/]`
= help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

error: Missing code example in this documentation
--> $DIR/lint-group.rs:16:1
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/cast_char.stderr
Expand Up @@ -2,7 +2,7 @@ error: only u8 can be cast into char
--> $DIR/cast_char.rs:4:23
|
LL | const XYZ: char = 0x1F888 as char;
| ^^^^^^^^^^^^^^^ help: use a char literal instead: `'/u{1F888}'`
| ^^^^^^^^^^^^^^^ help: use a char literal instead: `'\u{1F888}'`
|
note: lint level defined here
--> $DIR/cast_char.rs:1:9
Expand All @@ -14,7 +14,7 @@ error: only u8 can be cast into char
--> $DIR/cast_char.rs:6:22
|
LL | const XY: char = 129160 as char;
| ^^^^^^^^^^^^^^ help: use a char literal instead: `'/u{1F888}'`
| ^^^^^^^^^^^^^^ help: use a char literal instead: `'\u{1F888}'`

error: aborting due to 2 previous errors

2 changes: 1 addition & 1 deletion src/test/ui/error-codes/E0648.stderr
@@ -1,7 +1,7 @@
error[E0648]: `export_name` may not contain null characters
--> $DIR/E0648.rs:1:1
|
LL | #[export_name="/0foo"]
LL | #[export_name="\0foo"]
| ^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error
Expand Down

0 comments on commit 695dfe7

Please sign in to comment.