about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-03-03 07:24:11 +0000
committerbors <bors@rust-lang.org>2018-03-03 07:24:11 +0000
commitc9b86a91786ca54e898b54f30a6e11546b8e8026 (patch)
treeff7cd48f4d47920056d504f74758f48ad49d955b /src/test
parent5f1f628765df7b4918df5b8bcbd8d8da93b03494 (diff)
parent40d2a98503b4eb4efe73cf5734e5a13ddcf3ac8a (diff)
downloadrust-c9b86a91786ca54e898b54f30a6e11546b8e8026.tar.gz
rust-c9b86a91786ca54e898b54f30a6e11546b8e8026.zip
Auto merge of #48689 - Manishearth:rollup, r=Manishearth
Rollup (unsupervised)

less risky PRs, to run overnight
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make/reproducible-build/Makefile76
-rw-r--r--src/test/run-make/reproducible-build/reproducible-build.rs2
-rw-r--r--src/test/ui/cross-file-errors/main.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-40006.stderr2
-rw-r--r--src/test/ui/if-without-block.rs18
-rw-r--r--src/test/ui/if-without-block.stderr11
-rw-r--r--src/test/ui/macro-context.stderr2
-rw-r--r--src/test/ui/missing-block-hint.stderr6
-rw-r--r--src/test/ui/resolve/token-error-correct.stderr2
-rw-r--r--src/test/ui/suggestions/missing-comma-in-match.rs19
-rw-r--r--src/test/ui/suggestions/missing-comma-in-match.stderr10
-rw-r--r--src/test/ui/token/issue-10636-2.stderr2
12 files changed, 136 insertions, 16 deletions
diff --git a/src/test/run-make/reproducible-build/Makefile b/src/test/run-make/reproducible-build/Makefile
index 8e799ca1a43..629e6185051 100644
--- a/src/test/run-make/reproducible-build/Makefile
+++ b/src/test/run-make/reproducible-build/Makefile
@@ -1,20 +1,78 @@
 -include ../tools.mk
-all:
+all:  \
+	smoke \
+	debug \
+	opt \
+	link_paths \
+	remap_paths \
+	different_source_dirs \
+	extern_flags
+
+smoke:
+	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
 	$(RUSTC) reproducible-build-aux.rs
 	$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build1"
 	$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build2"
+	$(B2)
 	nm "$(TMPDIR)/reproducible-build1" | sort > "$(TMPDIR)/reproducible-build1.nm"
 	nm "$(TMPDIR)/reproducible-build2" | sort > "$(TMPDIR)/reproducible-build2.nm"
 	cmp "$(TMPDIR)/reproducible-build1.nm" "$(TMPDIR)/reproducible-build2.nm" || exit 1
+
+debug:
+	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
 	$(RUSTC) reproducible-build-aux.rs -g
-	$(RUSTC) reproducible-build.rs -g -o"$(TMPDIR)/reproducible-build1-debug"
-	$(RUSTC) reproducible-build.rs -g -o"$(TMPDIR)/reproducible-build2-debug"
-	nm "$(TMPDIR)/reproducible-build1-debug" | sort > "$(TMPDIR)/reproducible-build1-debug.nm"
-	nm "$(TMPDIR)/reproducible-build2-debug" | sort > "$(TMPDIR)/reproducible-build2-debug.nm"
+	$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build1" -g
+	$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build2" -g
+	nm "$(TMPDIR)/reproducible-build1" | sort > "$(TMPDIR)/reproducible-build1-debug.nm"
+	nm "$(TMPDIR)/reproducible-build2" | sort > "$(TMPDIR)/reproducible-build2-debug.nm"
 	cmp "$(TMPDIR)/reproducible-build1-debug.nm" "$(TMPDIR)/reproducible-build2-debug.nm" || exit 1
+
+opt:
+	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
 	$(RUSTC) reproducible-build-aux.rs -O
-	$(RUSTC) reproducible-build.rs -O -o"$(TMPDIR)/reproducible-build1-opt"
-	$(RUSTC) reproducible-build.rs -O -o"$(TMPDIR)/reproducible-build2-opt"
-	nm "$(TMPDIR)/reproducible-build1-opt" | sort > "$(TMPDIR)/reproducible-build1-opt.nm"
-	nm "$(TMPDIR)/reproducible-build2-opt" | sort > "$(TMPDIR)/reproducible-build2-opt.nm"
+	$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build1" -O
+	$(RUSTC) reproducible-build.rs -o"$(TMPDIR)/reproducible-build2" -O
+	nm "$(TMPDIR)/reproducible-build1" | sort > "$(TMPDIR)/reproducible-build1-opt.nm"
+	nm "$(TMPDIR)/reproducible-build2" | sort > "$(TMPDIR)/reproducible-build2-opt.nm"
 	cmp "$(TMPDIR)/reproducible-build1-opt.nm" "$(TMPDIR)/reproducible-build2-opt.nm" || exit 1
+
+link_paths:
+	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
+	$(RUSTC) reproducible-build-aux.rs
+	$(RUSTC) reproducible-build.rs --crate-type rlib -L /b
+	cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
+	$(RUSTC) reproducible-build.rs --crate-type rlib -L /a
+	cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
+
+remap_paths:
+	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
+	$(RUSTC) reproducible-build-aux.rs
+	$(RUSTC) reproducible-build.rs --crate-type rlib --remap-path-prefix=/a=/c
+	cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
+	$(RUSTC) reproducible-build.rs --crate-type rlib --remap-path-prefix=/b=/c
+	cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
+
+different_source_dirs:
+	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
+	$(RUSTC) reproducible-build-aux.rs
+	mkdir $(TMPDIR)/test
+	cp reproducible-build.rs $(TMPDIR)/test
+	$(RUSTC) reproducible-build.rs --crate-type rlib --remap-path-prefix=$$PWD=/b
+	cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
+	(cd $(TMPDIR)/test && $(RUSTC) reproducible-build.rs \
+		--remap-path-prefix=$(TMPDIR)/test=/b \
+		--crate-type rlib)
+	cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
+
+extern_flags:
+	rm -rf $(TMPDIR) && mkdir $(TMPDIR)
+	$(RUSTC) reproducible-build-aux.rs
+	$(RUSTC) reproducible-build.rs \
+		--extern reproducible_build_aux=$(TMPDIR)/libreproducible_build_aux.rlib \
+		--crate-type rlib
+	cp $(TMPDIR)/libreproducible_build_aux.rlib $(TMPDIR)/libbar.rlib
+	cp $(TMPDIR)/libreproducible_build.rlib $(TMPDIR)/libfoo.rlib
+	$(RUSTC) reproducible-build.rs \
+		--extern reproducible_build_aux=$(TMPDIR)/libbar.rlib \
+		--crate-type rlib
+	cmp "$(TMPDIR)/libreproducible_build.rlib" "$(TMPDIR)/libfoo.rlib" || exit 1
diff --git a/src/test/run-make/reproducible-build/reproducible-build.rs b/src/test/run-make/reproducible-build/reproducible-build.rs
index b47d780e529..a040c0f858d 100644
--- a/src/test/run-make/reproducible-build/reproducible-build.rs
+++ b/src/test/run-make/reproducible-build/reproducible-build.rs
@@ -28,7 +28,7 @@
 // - Trait object shims
 // - Fn Pointer shims
 
-#![allow(dead_code)]
+#![allow(dead_code, warnings)]
 
 extern crate reproducible_build_aux;
 
diff --git a/src/test/ui/cross-file-errors/main.stderr b/src/test/ui/cross-file-errors/main.stderr
index 9eeea28be8f..a9db5214e6a 100644
--- a/src/test/ui/cross-file-errors/main.stderr
+++ b/src/test/ui/cross-file-errors/main.stderr
@@ -2,7 +2,7 @@ error: expected expression, found `_`
   --> $DIR/underscore.rs:18:9
    |
 LL |         _
-   |         ^
+   |         ^ expected expression
    | 
   ::: $DIR/main.rs:15:5
    |
diff --git a/src/test/ui/did_you_mean/issue-40006.stderr b/src/test/ui/did_you_mean/issue-40006.stderr
index 301441c5622..e576393500f 100644
--- a/src/test/ui/did_you_mean/issue-40006.stderr
+++ b/src/test/ui/did_you_mean/issue-40006.stderr
@@ -19,7 +19,7 @@ error: expected `[`, found `#`
   --> $DIR/issue-40006.rs:20:17
    |
 LL |     fn xxx() { ### } //~ ERROR missing
-   |                 ^
+   |                 ^ expected `[`
 
 error: missing `fn`, `type`, or `const` for trait-item declaration
   --> $DIR/issue-40006.rs:20:21
diff --git a/src/test/ui/if-without-block.rs b/src/test/ui/if-without-block.rs
new file mode 100644
index 00000000000..ce3de3b302d
--- /dev/null
+++ b/src/test/ui/if-without-block.rs
@@ -0,0 +1,18 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    let n = 1;
+    if 5 == {
+    //~^ NOTE this `if` statement has a condition, but no block
+        println!("five");
+    }
+}
+//~^ ERROR expected `{`, found `}`
diff --git a/src/test/ui/if-without-block.stderr b/src/test/ui/if-without-block.stderr
new file mode 100644
index 00000000000..bc8e7310ce3
--- /dev/null
+++ b/src/test/ui/if-without-block.stderr
@@ -0,0 +1,11 @@
+error: expected `{`, found `}`
+  --> $DIR/if-without-block.rs:17:1
+   |
+LL |     if 5 == {
+   |     -- this `if` statement has a condition, but no block
+...
+LL | }
+   | ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/macro-context.stderr b/src/test/ui/macro-context.stderr
index 65bbe09a212..4dc6bbe4d65 100644
--- a/src/test/ui/macro-context.stderr
+++ b/src/test/ui/macro-context.stderr
@@ -38,7 +38,7 @@ error: expected expression, found reserved keyword `typeof`
   --> $DIR/macro-context.rs:13:17
    |
 LL |     () => ( i ; typeof );   //~ ERROR expected expression, found reserved keyword `typeof`
-   |                 ^^^^^^
+   |                 ^^^^^^ expected expression
 ...
 LL |     m!();
    |     ----- in this macro invocation
diff --git a/src/test/ui/missing-block-hint.stderr b/src/test/ui/missing-block-hint.stderr
index 54f394a4220..a48eff890b3 100644
--- a/src/test/ui/missing-block-hint.stderr
+++ b/src/test/ui/missing-block-hint.stderr
@@ -2,11 +2,15 @@ error: expected `{`, found `=>`
   --> $DIR/missing-block-hint.rs:13:18
    |
 LL |         if (foo) => {} //~ ERROR expected `{`, found `=>`
-   |                  ^^
+   |         --       ^^
+   |         |
+   |         this `if` statement has a condition, but no block
 
 error: expected `{`, found `bar`
   --> $DIR/missing-block-hint.rs:17:13
    |
+LL |         if (foo)
+   |         -- this `if` statement has a condition, but no block
 LL |             bar; //~ ERROR expected `{`, found `bar`
    |             ^^^-
    |             |
diff --git a/src/test/ui/resolve/token-error-correct.stderr b/src/test/ui/resolve/token-error-correct.stderr
index 344c288b596..c6d32c6726e 100644
--- a/src/test/ui/resolve/token-error-correct.stderr
+++ b/src/test/ui/resolve/token-error-correct.stderr
@@ -26,7 +26,7 @@ error: expected expression, found `;`
   --> $DIR/token-error-correct.rs:14:13
    |
 LL |     foo(bar(;
-   |             ^
+   |             ^ expected expression
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/suggestions/missing-comma-in-match.rs b/src/test/ui/suggestions/missing-comma-in-match.rs
new file mode 100644
index 00000000000..6f86cdea3cf
--- /dev/null
+++ b/src/test/ui/suggestions/missing-comma-in-match.rs
@@ -0,0 +1,19 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main() {
+    match &Some(3) {
+        &None => 1
+        &Some(2) => { 3 }
+        //~^ ERROR expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
+        //~| NOTE expected one of `,`, `.`, `?`, `}`, or an operator here
+        _ => 2
+    };
+}
diff --git a/src/test/ui/suggestions/missing-comma-in-match.stderr b/src/test/ui/suggestions/missing-comma-in-match.stderr
new file mode 100644
index 00000000000..b71a50b6631
--- /dev/null
+++ b/src/test/ui/suggestions/missing-comma-in-match.stderr
@@ -0,0 +1,10 @@
+error: expected one of `,`, `.`, `?`, `}`, or an operator, found `=>`
+  --> $DIR/missing-comma-in-match.rs:14:18
+   |
+LL |         &None => 1
+   |                   - help: missing a comma here to end this `match` arm
+LL |         &Some(2) => { 3 }
+   |                  ^^ expected one of `,`, `.`, `?`, `}`, or an operator here
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/token/issue-10636-2.stderr b/src/test/ui/token/issue-10636-2.stderr
index fcd2c10594a..26816ca0ca2 100644
--- a/src/test/ui/token/issue-10636-2.stderr
+++ b/src/test/ui/token/issue-10636-2.stderr
@@ -20,7 +20,7 @@ error: expected expression, found `)`
   --> $DIR/issue-10636-2.rs:18:1
    |
 LL | } //~ ERROR: incorrect close delimiter
-   | ^
+   | ^ expected expression
 
 error[E0601]: main function not found