Skip to content

Commit 21d67c4

Browse files
committed
Fix a few tests with target-specific output
Enable one fully ignored test
1 parent 7977250 commit 21d67c4

11 files changed

+51
-31
lines changed

src/libsyntax/parse/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ fn file_to_source_file(sess: &ParseSess, path: &Path, spanopt: Option<Span>)
230230
match sess.source_map().load_file(path) {
231231
Ok(source_file) => source_file,
232232
Err(e) => {
233-
let msg = format!("couldn't read {:?}: {}", path.display(), e);
233+
let msg = format!("couldn't read {}: {}", path.display(), e);
234234
match spanopt {
235235
Some(sp) => sess.span_diagnostic.span_fatal(sp, &msg).raise(),
236236
None => sess.span_diagnostic.fatal(&msg).raise()

src/test/ui/parser/issue-5806.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-windows
12-
// ignore-freebsd
13-
// ignore-openbsd
14-
// ignore-netbsd
15-
// ignore-bitrig
16-
1711
// compile-flags: -Z parse-only
12+
// normalize-stderr-test: "parser:.*\(" -> "parser: $$ACCESS_DENIED_MSG ("
13+
// normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"
1814

19-
#[path = "../compile-fail"]
20-
mod foo; //~ ERROR: a directory
15+
#[path = "../parser"]
16+
mod foo; //~ ERROR couldn't read
2117

2218
fn main() {}

src/test/ui/parser/issue-5806.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: couldn't read $DIR/../parser: $ACCESS_DENIED_MSG (os error $ACCESS_DENIED_CODE)
2+
--> $DIR/issue-5806.rs:16:5
3+
|
4+
LL | mod foo; //~ ERROR couldn't read
5+
| ^^^
6+
7+
error: aborting due to previous error
8+

src/test/ui/parser/mod_file_not_exist.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
// ignore-windows
12-
1312
// compile-flags: -Z parse-only
1413

1514
mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0583]: file not found for module `not_a_real_file`
2+
--> $DIR/mod_file_not_exist.rs:14:5
3+
|
4+
LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= help: name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory "$DIR"
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0583`.

src/test/ui/parser/mod_file_not_exist_windows.rs

+1-15
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// ignore-android
12-
// ignore-bitrig
13-
// ignore-cloudabi
14-
// ignore-dragonfly
15-
// ignore-emscripten
16-
// ignore-freebsd
17-
// ignore-gnu
18-
// ignore-haiku
19-
// ignore-ios
20-
// ignore-linux
21-
// ignore-macos
22-
// ignore-netbsd
23-
// ignore-openbsd
24-
// ignore-solaris
25-
11+
// only-windows
2612
// compile-flags: -Z parse-only
2713

2814
mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0583]: file not found for module `not_a_real_file`
2+
--> $DIR/mod_file_not_exist_windows.rs:14:5
3+
|
4+
LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
5+
| ^^^^^^^^^^^^^^^
6+
|
7+
= help: name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory "$DIR"
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0583`.

src/test/ui/parser/mod_file_with_path_attr.rs

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
// compile-flags: -Z parse-only
12+
// normalize-stderr-test: "not_a_real_file.rs:.*\(" -> "not_a_real_file.rs: $$FILE_NOT_FOUND_MSG ("
1213

1314
#[path = "not_a_real_file.rs"]
1415
mod m; //~ ERROR not_a_real_file.rs

src/test/ui/parser/mod_file_with_path_attr.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
error: couldn't read "C:/msys64/home/we/rust/src/test/ui/parser/not_a_real_file.rs": The system cannot find the file specified. (os error 2)
2-
--> $DIR/mod_file_with_path_attr.rs:14:5
1+
error: couldn't read $DIR/not_a_real_file.rs: $FILE_NOT_FOUND_MSG (os error 2)
2+
--> $DIR/mod_file_with_path_attr.rs:15:5
33
|
44
LL | mod m; //~ ERROR not_a_real_file.rs
55
| ^

src/test/ui/parser/regions-out-of-scope-slice.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// compile-flags: -Z parse-only
11+
// blk region isn't supported in the front-end
1212

13-
// ignore-test blk region isn't supported in the front-end
13+
// compile-flags: -Z parse-only
1414

1515
fn foo(cond: bool) {
1616
// Here we will infer a type that uses the
1717
// region of the if stmt then block, but in the scope:
18-
let mut x; //~ ERROR foo
18+
let mut x;
1919

2020
if cond {
21-
x = &'blk [1,2,3];
21+
x = &'blk [1,2,3]; //~ ERROR expected `:`, found `[`
2222
}
2323
}
2424

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: expected `:`, found `[`
2+
--> $DIR/regions-out-of-scope-slice.rs:21:19
3+
|
4+
LL | x = &'blk [1,2,3]; //~ ERROR expected `:`, found `[`
5+
| ^ expected `:`
6+
7+
error: aborting due to previous error
8+

0 commit comments

Comments
 (0)