about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-19 12:49:32 +0000
committerbors <bors@rust-lang.org>2018-12-19 12:49:32 +0000
commit6f839fbb0d407956777529b029fbb0d6cc6e4318 (patch)
tree7efc541878cc49a26d67b9eb036d16657c6a5937 /src/test
parent74ebf026fe927ffa99d541479454f45791806802 (diff)
parent1ba6ec4a327d978471cdac31d17d9202106b15bd (diff)
downloadrust-6f839fbb0d407956777529b029fbb0d6cc6e4318.tar.gz
rust-6f839fbb0d407956777529b029fbb0d6cc6e4318.zip
Auto merge of #56977 - pietroalbini:rollup, r=pietroalbini
Rollup of 15 pull requests

Successful merges:

 - #56363 (Defactored Bytes::read)
 - #56663 (Remove lifetime from Resolver)
 - #56689 (add a lint group for lints emitted by rustdoc)
 - #56772 (fix issue 54153 by not testing issue-18804 on Windows nor OS X.)
 - #56820 (format-related tweaks)
 - #56881 (Implement Eq, PartialEq and Hash for atomic::Ordering)
 - #56907 (Fix grammar in compiler error for array iterators)
 - #56908 (rustc: Don't ICE on usage of two new target features)
 - #56910 (Do not point at delim spans for complete correct blocks)
 - #56913 (Enable stack probes for UEFI images)
 - #56918 (Profiler: simplify total_duration, improve readability)
 - #56931 (Update release notes for Rust 1.31.1)
 - #56947 (Add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf)
 - #56948 (Update LLVM submodule)
 - #56959 (Fix mobile menu rendering collision with tooltip.)

Failed merges:

 - #56914 (Ignore ui/target-feature-gate on sparc, sparc64, powerpc, powerpc64 and powerpc64le)

r? @ghost
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-make-fulldeps/atomic-lock-free/Makefile2
-rw-r--r--src/test/run-pass/issues/issue-18804/main.rs5
-rw-r--r--src/test/rustdoc-ui/lint-group.rs34
-rw-r--r--src/test/rustdoc-ui/lint-group.stderr44
-rw-r--r--src/test/ui/iterators/array-of-ranges.stderr2
-rw-r--r--src/test/ui/iterators/array.stderr6
-rw-r--r--src/test/ui/parser/unmatched-delimiter-at-end-of-file.rs11
-rw-r--r--src/test/ui/parser/unmatched-delimiter-at-end-of-file.stderr8
-rw-r--r--src/test/ui/target-feature-gate.rs3
-rw-r--r--src/test/ui/target-feature-gate.stderr2
10 files changed, 112 insertions, 5 deletions
diff --git a/src/test/run-make-fulldeps/atomic-lock-free/Makefile b/src/test/run-make-fulldeps/atomic-lock-free/Makefile
index a7df821f92d..9e8b4fabf17 100644
--- a/src/test/run-make-fulldeps/atomic-lock-free/Makefile
+++ b/src/test/run-make-fulldeps/atomic-lock-free/Makefile
@@ -18,6 +18,8 @@ ifeq ($(filter arm,$(LLVM_COMPONENTS)),arm)
 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add
 	$(RUSTC) --target=armv7-unknown-linux-gnueabihf atomic_lock_free.rs
 	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add
+	$(RUSTC) --target=thumbv7neon-unknown-linux-gnueabihf atomic_lock_free.rs
+	nm "$(TMPDIR)/libatomic_lock_free.rlib" | $(CGREP) -v __atomic_fetch_add
 endif
 ifeq ($(filter aarch64,$(LLVM_COMPONENTS)),aarch64)
 	$(RUSTC) --target=aarch64-unknown-linux-gnu atomic_lock_free.rs
diff --git a/src/test/run-pass/issues/issue-18804/main.rs b/src/test/run-pass/issues/issue-18804/main.rs
index 2abcd4b7ba9..4b32cc12dfd 100644
--- a/src/test/run-pass/issues/issue-18804/main.rs
+++ b/src/test/run-pass/issues/issue-18804/main.rs
@@ -14,9 +14,14 @@
 
 // ignore-asmjs no weak symbol support
 // ignore-emscripten no weak symbol support
+// ignore-windows no extern_weak linkage
+// ignore-macos no extern_weak linkage
 
 // aux-build:lib.rs
 
+// rust-lang/rust#56772: nikic says we need this to be proper test.
+// compile-flags: -C no-prepopulate-passes -C passes=name-anon-globals
+
 extern crate lib;
 
 fn main() {
diff --git a/src/test/rustdoc-ui/lint-group.rs b/src/test/rustdoc-ui/lint-group.rs
new file mode 100644
index 00000000000..f82bfb52246
--- /dev/null
+++ b/src/test/rustdoc-ui/lint-group.rs
@@ -0,0 +1,34 @@
+// 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.
+
+//! Documenting the kinds of lints emitted by rustdoc.
+//!
+//! ```
+//! println!("sup");
+//! ```
+
+#![deny(rustdoc)]
+
+/// what up, let's make an [error]
+///
+/// ```
+/// println!("sup");
+/// ```
+pub fn link_error() {} //~^^^^^ ERROR cannot be resolved, ignoring it
+
+/// wait, this doesn't have a doctest?
+pub fn no_doctest() {} //~^ ERROR Missing code example in this documentation
+
+/// wait, this *does* have a doctest?
+///
+/// ```
+/// println!("sup");
+/// ```
+fn private_doctest() {} //~^^^^^ ERROR Documentation test in private item
diff --git a/src/test/rustdoc-ui/lint-group.stderr b/src/test/rustdoc-ui/lint-group.stderr
new file mode 100644
index 00000000000..2fd760d54c2
--- /dev/null
+++ b/src/test/rustdoc-ui/lint-group.stderr
@@ -0,0 +1,44 @@
+error: Documentation test in private item
+  --> $DIR/lint-group.rs:29:1
+   |
+LL | / /// wait, this *does* have a doctest?
+LL | | ///
+LL | | /// ```
+LL | | /// println!("sup");
+LL | | /// ```
+   | |_______^
+   |
+note: lint level defined here
+  --> $DIR/lint-group.rs:17:9
+   |
+LL | #![deny(rustdoc)]
+   |         ^^^^^^^
+   = note: #[deny(private_doc_tests)] implied by #[deny(rustdoc)]
+
+error: `[error]` cannot be resolved, ignoring it...
+  --> $DIR/lint-group.rs:19:29
+   |
+LL | /// what up, let's make an [error]
+   |                             ^^^^^ cannot be resolved, ignoring
+   |
+note: lint level defined here
+  --> $DIR/lint-group.rs:17:9
+   |
+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 `/]`
+
+error: Missing code example in this documentation
+  --> $DIR/lint-group.rs:26:1
+   |
+LL | /// wait, this doesn't have a doctest?
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+note: lint level defined here
+  --> $DIR/lint-group.rs:17:9
+   |
+LL | #![deny(rustdoc)]
+   |         ^^^^^^^
+   = note: #[deny(missing_doc_code_examples)] implied by #[deny(rustdoc)]
+
diff --git a/src/test/ui/iterators/array-of-ranges.stderr b/src/test/ui/iterators/array-of-ranges.stderr
index 495659720c3..3dbed9a1065 100644
--- a/src/test/ui/iterators/array-of-ranges.stderr
+++ b/src/test/ui/iterators/array-of-ranges.stderr
@@ -75,7 +75,7 @@ LL |     for _ in [0..1, 2..3] {}
    |              ^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
    |
    = help: the trait `std::iter::Iterator` is not implemented for `[std::ops::Range<{integer}>; 2]`
-   = note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
+   = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
    = note: required by `std::iter::IntoIterator::into_iter`
 
 error[E0277]: `[std::ops::RangeInclusive<{integer}>; 1]` is not an iterator
diff --git a/src/test/ui/iterators/array.stderr b/src/test/ui/iterators/array.stderr
index 582c812a8d6..94731f1c745 100644
--- a/src/test/ui/iterators/array.stderr
+++ b/src/test/ui/iterators/array.stderr
@@ -5,7 +5,7 @@ LL |     for _ in [1, 2] {}
    |              ^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
    |
    = help: the trait `std::iter::Iterator` is not implemented for `[{integer}; 2]`
-   = note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
+   = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
    = note: required by `std::iter::IntoIterator::into_iter`
 
 error[E0277]: `[{integer}; 2]` is not an iterator
@@ -15,7 +15,7 @@ LL |     for _ in x {}
    |              ^ borrow the array with `&` or call `.iter()` on it to iterate over it
    |
    = help: the trait `std::iter::Iterator` is not implemented for `[{integer}; 2]`
-   = note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
+   = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
    = note: required by `std::iter::IntoIterator::into_iter`
 
 error[E0277]: `[{float}; 2]` is not an iterator
@@ -25,7 +25,7 @@ LL |     for _ in [1.0, 2.0] {}
    |              ^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it
    |
    = help: the trait `std::iter::Iterator` is not implemented for `[{float}; 2]`
-   = note: arrays are not an iterators, but slices like the following are: `&[1, 2, 3]`
+   = note: arrays are not iterators, but slices like the following are: `&[1, 2, 3]`
    = note: required by `std::iter::IntoIterator::into_iter`
 
 error: aborting due to 3 previous errors
diff --git a/src/test/ui/parser/unmatched-delimiter-at-end-of-file.rs b/src/test/ui/parser/unmatched-delimiter-at-end-of-file.rs
new file mode 100644
index 00000000000..3eef75bafd3
--- /dev/null
+++ b/src/test/ui/parser/unmatched-delimiter-at-end-of-file.rs
@@ -0,0 +1,11 @@
+struct S {
+    x: usize,
+    y: usize,
+}
+
+fn main() {
+    S { x: 4,
+        y: 5 };
+}
+
+fn foo() { //~ ERROR this file contains an un-closed delimiter
diff --git a/src/test/ui/parser/unmatched-delimiter-at-end-of-file.stderr b/src/test/ui/parser/unmatched-delimiter-at-end-of-file.stderr
new file mode 100644
index 00000000000..442837e5808
--- /dev/null
+++ b/src/test/ui/parser/unmatched-delimiter-at-end-of-file.stderr
@@ -0,0 +1,8 @@
+error: this file contains an un-closed delimiter
+  --> $DIR/unmatched-delimiter-at-end-of-file.rs:11:64
+   |
+LL | fn foo() { //~ ERROR this file contains an un-closed delimiter
+   |          - un-closed delimiter                                 ^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/target-feature-gate.rs b/src/test/ui/target-feature-gate.rs
index 2d0fb78897d..4207a3285c4 100644
--- a/src/test/ui/target-feature-gate.rs
+++ b/src/test/ui/target-feature-gate.rs
@@ -24,6 +24,9 @@
 // gate-test-mips_target_feature
 // gate-test-mmx_target_feature
 // gate-test-wasm_target_feature
+// gate-test-adx_target_feature
+// gate-test-cmpxchg16b_target_feature
+// min-llvm-version 6.0
 
 #[target_feature(enable = "avx512bw")]
 //~^ ERROR: currently unstable
diff --git a/src/test/ui/target-feature-gate.stderr b/src/test/ui/target-feature-gate.stderr
index 24141d0064f..54589536010 100644
--- a/src/test/ui/target-feature-gate.stderr
+++ b/src/test/ui/target-feature-gate.stderr
@@ -1,5 +1,5 @@
 error[E0658]: the target feature `avx512bw` is currently unstable (see issue #44839)
-  --> $DIR/target-feature-gate.rs:28:18
+  --> $DIR/target-feature-gate.rs:31:18
    |
 LL | #[target_feature(enable = "avx512bw")]
    |                  ^^^^^^^^^^^^^^^^^^^