about summary refs log tree commit diff
path: root/src/test/ui/parser
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-10-21 03:21:16 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-10-21 14:06:29 +0300
commit21d67c45a3d032b3f0d421e6f882f11ea43d1f9c (patch)
tree1056ff7db31d9e29e717227138364d5407ed7496 /src/test/ui/parser
parent7977250fb4c4c939132c28efd5dc58213535c454 (diff)
downloadrust-21d67c45a3d032b3f0d421e6f882f11ea43d1f9c.tar.gz
rust-21d67c45a3d032b3f0d421e6f882f11ea43d1f9c.zip
Fix a few tests with target-specific output
Enable one fully ignored test
Diffstat (limited to 'src/test/ui/parser')
-rw-r--r--src/test/ui/parser/issue-5806.rs12
-rw-r--r--src/test/ui/parser/issue-5806.stderr8
-rw-r--r--src/test/ui/parser/mod_file_not_exist.rs1
-rw-r--r--src/test/ui/parser/mod_file_not_exist.stderr11
-rw-r--r--src/test/ui/parser/mod_file_not_exist_windows.rs16
-rw-r--r--src/test/ui/parser/mod_file_not_exist_windows.stderr11
-rw-r--r--src/test/ui/parser/mod_file_with_path_attr.rs1
-rw-r--r--src/test/ui/parser/mod_file_with_path_attr.stderr4
-rw-r--r--src/test/ui/parser/regions-out-of-scope-slice.rs8
-rw-r--r--src/test/ui/parser/regions-out-of-scope-slice.stderr8
10 files changed, 50 insertions, 30 deletions
diff --git a/src/test/ui/parser/issue-5806.rs b/src/test/ui/parser/issue-5806.rs
index f6606a58eca..3622d59a514 100644
--- a/src/test/ui/parser/issue-5806.rs
+++ b/src/test/ui/parser/issue-5806.rs
@@ -8,15 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-windows
-// ignore-freebsd
-// ignore-openbsd
-// ignore-netbsd
-// ignore-bitrig
-
 // compile-flags: -Z parse-only
+// normalize-stderr-test: "parser:.*\(" -> "parser: $$ACCESS_DENIED_MSG ("
+// normalize-stderr-test: "os error \d+" -> "os error $$ACCESS_DENIED_CODE"
 
-#[path = "../compile-fail"]
-mod foo; //~ ERROR: a directory
+#[path = "../parser"]
+mod foo; //~ ERROR couldn't read
 
 fn main() {}
diff --git a/src/test/ui/parser/issue-5806.stderr b/src/test/ui/parser/issue-5806.stderr
new file mode 100644
index 00000000000..63beed2873f
--- /dev/null
+++ b/src/test/ui/parser/issue-5806.stderr
@@ -0,0 +1,8 @@
+error: couldn't read $DIR/../parser: $ACCESS_DENIED_MSG (os error $ACCESS_DENIED_CODE)
+  --> $DIR/issue-5806.rs:16:5
+   |
+LL | mod foo; //~ ERROR couldn't read
+   |     ^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/mod_file_not_exist.rs b/src/test/ui/parser/mod_file_not_exist.rs
index 4bc6e706d42..59b2ebe9f86 100644
--- a/src/test/ui/parser/mod_file_not_exist.rs
+++ b/src/test/ui/parser/mod_file_not_exist.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 // ignore-windows
-
 // compile-flags: -Z parse-only
 
 mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
diff --git a/src/test/ui/parser/mod_file_not_exist.stderr b/src/test/ui/parser/mod_file_not_exist.stderr
new file mode 100644
index 00000000000..a745fc2847b
--- /dev/null
+++ b/src/test/ui/parser/mod_file_not_exist.stderr
@@ -0,0 +1,11 @@
+error[E0583]: file not found for module `not_a_real_file`
+  --> $DIR/mod_file_not_exist.rs:14:5
+   |
+LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
+   |     ^^^^^^^^^^^^^^^
+   |
+   = help: name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory "$DIR"
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0583`.
diff --git a/src/test/ui/parser/mod_file_not_exist_windows.rs b/src/test/ui/parser/mod_file_not_exist_windows.rs
index 5cf821749e9..6ee6792a8a2 100644
--- a/src/test/ui/parser/mod_file_not_exist_windows.rs
+++ b/src/test/ui/parser/mod_file_not_exist_windows.rs
@@ -8,21 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// ignore-android
-// ignore-bitrig
-// ignore-cloudabi
-// ignore-dragonfly
-// ignore-emscripten
-// ignore-freebsd
-// ignore-gnu
-// ignore-haiku
-// ignore-ios
-// ignore-linux
-// ignore-macos
-// ignore-netbsd
-// ignore-openbsd
-// ignore-solaris
-
+// only-windows
 // compile-flags: -Z parse-only
 
 mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
diff --git a/src/test/ui/parser/mod_file_not_exist_windows.stderr b/src/test/ui/parser/mod_file_not_exist_windows.stderr
new file mode 100644
index 00000000000..695038f8e4d
--- /dev/null
+++ b/src/test/ui/parser/mod_file_not_exist_windows.stderr
@@ -0,0 +1,11 @@
+error[E0583]: file not found for module `not_a_real_file`
+  --> $DIR/mod_file_not_exist_windows.rs:14:5
+   |
+LL | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file`
+   |     ^^^^^^^^^^^^^^^
+   |
+   = help: name the file either not_a_real_file.rs or not_a_real_file/mod.rs inside the directory "$DIR"
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0583`.
diff --git a/src/test/ui/parser/mod_file_with_path_attr.rs b/src/test/ui/parser/mod_file_with_path_attr.rs
index 993232e70ab..03aa8edc229 100644
--- a/src/test/ui/parser/mod_file_with_path_attr.rs
+++ b/src/test/ui/parser/mod_file_with_path_attr.rs
@@ -9,6 +9,7 @@
 // except according to those terms.
 
 // compile-flags: -Z parse-only
+// normalize-stderr-test: "not_a_real_file.rs:.*\(" -> "not_a_real_file.rs: $$FILE_NOT_FOUND_MSG ("
 
 #[path = "not_a_real_file.rs"]
 mod m; //~ ERROR not_a_real_file.rs
diff --git a/src/test/ui/parser/mod_file_with_path_attr.stderr b/src/test/ui/parser/mod_file_with_path_attr.stderr
index 9b8e8d25550..f4247b60f68 100644
--- a/src/test/ui/parser/mod_file_with_path_attr.stderr
+++ b/src/test/ui/parser/mod_file_with_path_attr.stderr
@@ -1,5 +1,5 @@
-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)
-  --> $DIR/mod_file_with_path_attr.rs:14:5
+error: couldn't read $DIR/not_a_real_file.rs: $FILE_NOT_FOUND_MSG (os error 2)
+  --> $DIR/mod_file_with_path_attr.rs:15:5
    |
 LL | mod m; //~ ERROR not_a_real_file.rs
    |     ^
diff --git a/src/test/ui/parser/regions-out-of-scope-slice.rs b/src/test/ui/parser/regions-out-of-scope-slice.rs
index c4601b4de17..0ff0f9bbf87 100644
--- a/src/test/ui/parser/regions-out-of-scope-slice.rs
+++ b/src/test/ui/parser/regions-out-of-scope-slice.rs
@@ -8,17 +8,17 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -Z parse-only
+// blk region isn't supported in the front-end
 
-// ignore-test blk region isn't supported in the front-end
+// compile-flags: -Z parse-only
 
 fn foo(cond: bool) {
     // Here we will infer a type that uses the
     // region of the if stmt then block, but in the scope:
-    let mut x; //~ ERROR foo
+    let mut x;
 
     if cond {
-        x = &'blk [1,2,3];
+        x = &'blk [1,2,3]; //~ ERROR expected `:`, found `[`
     }
 }
 
diff --git a/src/test/ui/parser/regions-out-of-scope-slice.stderr b/src/test/ui/parser/regions-out-of-scope-slice.stderr
new file mode 100644
index 00000000000..2eabc59882a
--- /dev/null
+++ b/src/test/ui/parser/regions-out-of-scope-slice.stderr
@@ -0,0 +1,8 @@
+error: expected `:`, found `[`
+  --> $DIR/regions-out-of-scope-slice.rs:21:19
+   |
+LL |         x = &'blk [1,2,3]; //~ ERROR expected `:`, found `[`
+   |                   ^ expected `:`
+
+error: aborting due to previous error
+