about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-07-27 13:31:40 +0000
committerbors <bors@rust-lang.org>2021-07-27 13:31:40 +0000
commit3bc9dd0dd293ab82945e35888ed6d7ab802761ef (patch)
tree402059c4b8c50e38d886784306f72494a7488771 /src/test
parent99d6692f6c1cebd6c56a67eb21f6aae26c12a145 (diff)
parentaf6c95f14ddd146e918b28a710f4d514b5091f20 (diff)
downloadrust-3bc9dd0dd293ab82945e35888ed6d7ab802761ef.tar.gz
rust-3bc9dd0dd293ab82945e35888ed6d7ab802761ef.zip
Auto merge of #87509 - JohnTitor:rollup-8iqn6cl, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #86450 (Add flag to configure `large_assignments` lint)
 - #86764 (Avoid ICE on type error recovery)
 - #87354 (Update VxWork's UNIX support)
 - #87427 (get rid of NoMirFor error variant)
 - #87446 (macos current_exe using directly libc instead.)
 - #87494 (fix typo: whenver -> whenever)
 - #87497 (Add long explanation for E0544.)
 - #87499 (Remove ASCII fast path from `rustc_lexer::{is_id_continue, is_id_start}`)
 - #87502 (Update cargo)
 - #87503 (Update books)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/async-await/large_moves.attribute.stderr (renamed from src/test/ui/async-await/large_moves.stderr)8
-rw-r--r--src/test/ui/async-await/large_moves.option.stderr38
-rw-r--r--src/test/ui/async-await/large_moves.rs4
-rw-r--r--src/test/ui/issues/issue-86756.rs12
-rw-r--r--src/test/ui/issues/issue-86756.stderr46
-rw-r--r--src/test/ui/stability-attribute/stability-attribute-sanity.stderr2
6 files changed, 104 insertions, 6 deletions
diff --git a/src/test/ui/async-await/large_moves.stderr b/src/test/ui/async-await/large_moves.attribute.stderr
index 8c47ec0ed9d..39b7e7cb345 100644
--- a/src/test/ui/async-await/large_moves.stderr
+++ b/src/test/ui/async-await/large_moves.attribute.stderr
@@ -1,5 +1,5 @@
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:10:13
+  --> $DIR/large_moves.rs:12:13
    |
 LL |       let x = async {
    |  _____________^
@@ -17,19 +17,19 @@ LL | #![deny(large_assignments)]
    |         ^^^^^^^^^^^^^^^^^
 
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:16:14
+  --> $DIR/large_moves.rs:18:14
    |
 LL |     let z = (x, 42);
    |              ^ value moved from here
 
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:16:13
+  --> $DIR/large_moves.rs:18:13
    |
 LL |     let z = (x, 42);
    |             ^^^^^^^ value moved from here
 
 error: moving 10024 bytes
-  --> $DIR/large_moves.rs:18:13
+  --> $DIR/large_moves.rs:20:13
    |
 LL |     let a = z.0;
    |             ^^^ value moved from here
diff --git a/src/test/ui/async-await/large_moves.option.stderr b/src/test/ui/async-await/large_moves.option.stderr
new file mode 100644
index 00000000000..39b7e7cb345
--- /dev/null
+++ b/src/test/ui/async-await/large_moves.option.stderr
@@ -0,0 +1,38 @@
+error: moving 10024 bytes
+  --> $DIR/large_moves.rs:12:13
+   |
+LL |       let x = async {
+   |  _____________^
+LL | |         let y = [0; 9999];
+LL | |         dbg!(y);
+LL | |         thing(&y).await;
+LL | |         dbg!(y);
+LL | |     };
+   | |_____^ value moved from here
+   |
+note: the lint level is defined here
+  --> $DIR/large_moves.rs:1:9
+   |
+LL | #![deny(large_assignments)]
+   |         ^^^^^^^^^^^^^^^^^
+
+error: moving 10024 bytes
+  --> $DIR/large_moves.rs:18:14
+   |
+LL |     let z = (x, 42);
+   |              ^ value moved from here
+
+error: moving 10024 bytes
+  --> $DIR/large_moves.rs:18:13
+   |
+LL |     let z = (x, 42);
+   |             ^^^^^^^ value moved from here
+
+error: moving 10024 bytes
+  --> $DIR/large_moves.rs:20:13
+   |
+LL |     let a = z.0;
+   |             ^^^ value moved from here
+
+error: aborting due to 4 previous errors
+
diff --git a/src/test/ui/async-await/large_moves.rs b/src/test/ui/async-await/large_moves.rs
index 4fac046beef..18bb538a81e 100644
--- a/src/test/ui/async-await/large_moves.rs
+++ b/src/test/ui/async-await/large_moves.rs
@@ -1,8 +1,10 @@
 #![deny(large_assignments)]
 #![feature(large_assignments)]
-#![move_size_limit = "1000"]
+#![cfg_attr(attribute, move_size_limit = "1000")]
 // build-fail
 // only-x86_64
+// revisions: attribute option
+// [option]compile-flags: -Zmove-size-limit=1000
 
 // edition:2018
 
diff --git a/src/test/ui/issues/issue-86756.rs b/src/test/ui/issues/issue-86756.rs
new file mode 100644
index 00000000000..7f864eb2850
--- /dev/null
+++ b/src/test/ui/issues/issue-86756.rs
@@ -0,0 +1,12 @@
+trait Foo<T, T = T> {}
+//~^ ERROR the name `T` is already used for a generic parameter in this item's generic parameters
+
+fn eq<A, B>() {
+    eq::<dyn, Foo>
+    //~^ ERROR cannot find type `dyn` in this scope
+    //~| ERROR missing generics for trait `Foo`
+    //~| WARN trait objects without an explicit `dyn` are deprecated
+    //~| WARN this is accepted in the current edition
+}
+
+fn main() {}
diff --git a/src/test/ui/issues/issue-86756.stderr b/src/test/ui/issues/issue-86756.stderr
new file mode 100644
index 00000000000..1ef21986726
--- /dev/null
+++ b/src/test/ui/issues/issue-86756.stderr
@@ -0,0 +1,46 @@
+error[E0403]: the name `T` is already used for a generic parameter in this item's generic parameters
+  --> $DIR/issue-86756.rs:1:14
+   |
+LL | trait Foo<T, T = T> {}
+   |           -  ^ already used
+   |           |
+   |           first use of `T`
+
+error[E0412]: cannot find type `dyn` in this scope
+  --> $DIR/issue-86756.rs:5:10
+   |
+LL | fn eq<A, B>() {
+   |           - help: you might be missing a type parameter: `, dyn`
+LL |     eq::<dyn, Foo>
+   |          ^^^ not found in this scope
+
+warning: trait objects without an explicit `dyn` are deprecated
+  --> $DIR/issue-86756.rs:5:15
+   |
+LL |     eq::<dyn, Foo>
+   |               ^^^ help: use `dyn`: `dyn Foo`
+   |
+   = note: `#[warn(bare_trait_objects)]` on by default
+   = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
+   = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+
+error[E0107]: missing generics for trait `Foo`
+  --> $DIR/issue-86756.rs:5:15
+   |
+LL |     eq::<dyn, Foo>
+   |               ^^^ expected at least 1 generic argument
+   |
+note: trait defined here, with at least 1 generic parameter: `T`
+  --> $DIR/issue-86756.rs:1:7
+   |
+LL | trait Foo<T, T = T> {}
+   |       ^^^ -
+help: add missing generic argument
+   |
+LL |     eq::<dyn, Foo<T>>
+   |               ^^^^^^
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0107, E0403, E0412.
+For more information about an error, try `rustc --explain E0107`.
diff --git a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr
index ddf65f3a7ee..4dc68662033 100644
--- a/src/test/ui/stability-attribute/stability-attribute-sanity.stderr
+++ b/src/test/ui/stability-attribute/stability-attribute-sanity.stderr
@@ -122,5 +122,5 @@ LL | #[rustc_deprecated(since = "a", reason = "text")]
 
 error: aborting due to 19 previous errors
 
-Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0546, E0547, E0549, E0550.
+Some errors have detailed explanations: E0539, E0541, E0542, E0543, E0544, E0546, E0547, E0549, E0550.
 For more information about an error, try `rustc --explain E0539`.