summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-10-02 19:42:07 +0000
committerbors <bors@rust-lang.org>2020-10-02 19:42:07 +0000
commit8876ffc9235dade728e1fbc4be4c85415fdd0bcd (patch)
tree6620cd20a64fe21bbe2a0dcb57e389315be3801e /src/test
parentbe3808108e15d84881f07af85b3145bcdd626e48 (diff)
parent0c5f0b1c690d108df0951333b1c24f6ebc02dc0c (diff)
downloadrust-8876ffc9235dade728e1fbc4be4c85415fdd0bcd.tar.gz
rust-8876ffc9235dade728e1fbc4be4c85415fdd0bcd.zip
Auto merge of #77462 - jonas-schievink:rollup-m0rqdh5, r=jonas-schievink
Rollup of 12 pull requests

Successful merges:

 - #76101 (Update RELEASES.md for 1.47.0)
 - #76739 (resolve: prohibit anon const non-static lifetimes)
 - #76811 (Doc alias name restriction)
 - #77405 (Add tracking issue of iter_advance_by feature)
 - #77409 (Add example for iter chain struct)
 - #77415 (Better error message for `async` blocks in a const-context)
 - #77423 (Add `-Zprecise-enum-drop-elaboration`)
 - #77432 (Use posix_spawn on musl targets)
 - #77441 (Fix AVR stack corruption bug)
 - #77442 (Clean up on example doc fixes for ptr::copy)
 - #77444 (Fix span for incorrect pattern field and add label)
 - #77453 (Stop running macOS builds on Azure Pipelines)

Failed merges:

r? `@ghost`
Diffstat (limited to 'src/test')
-rw-r--r--src/test/rustdoc-ui/check-doc-alias-attr.rs6
-rw-r--r--src/test/rustdoc-ui/check-doc-alias-attr.stderr34
-rw-r--r--src/test/ui/check-doc-alias-attr.rs6
-rw-r--r--src/test/ui/check-doc-alias-attr.stderr34
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs27
-rw-r--r--src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr21
-rw-r--r--src/test/ui/consts/async-block.rs8
-rw-r--r--src/test/ui/consts/async-block.stderr8
-rw-r--r--src/test/ui/parser/bind-struct-early-modifiers.stderr6
-rw-r--r--src/test/ui/parser/issue-10392.stderr4
-rw-r--r--src/test/ui/parser/issue-63135.stderr4
-rw-r--r--src/test/ui/resolve/issue-54379.stderr6
12 files changed, 156 insertions, 8 deletions
diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.rs b/src/test/rustdoc-ui/check-doc-alias-attr.rs
index b02cc1a4545..c8bec39fad6 100644
--- a/src/test/rustdoc-ui/check-doc-alias-attr.rs
+++ b/src/test/rustdoc-ui/check-doc-alias-attr.rs
@@ -7,4 +7,10 @@ pub struct Bar;
 #[doc(alias)] //~ ERROR
 #[doc(alias = 0)] //~ ERROR
 #[doc(alias("bar"))] //~ ERROR
+#[doc(alias = "\"")] //~ ERROR
+#[doc(alias = "\n")] //~ ERROR
+#[doc(alias = "
+")] //~^ ERROR
+#[doc(alias = " ")] //~ ERROR
+#[doc(alias = "\t")] //~ ERROR
 pub struct Foo;
diff --git a/src/test/rustdoc-ui/check-doc-alias-attr.stderr b/src/test/rustdoc-ui/check-doc-alias-attr.stderr
index 268230ab44a..be7d7b3dbea 100644
--- a/src/test/rustdoc-ui/check-doc-alias-attr.stderr
+++ b/src/test/rustdoc-ui/check-doc-alias-attr.stderr
@@ -16,5 +16,37 @@ error: doc alias attribute expects a string: #[doc(alias = "0")]
 LL | #[doc(alias("bar"))]
    |       ^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: '\"' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:10:7
+   |
+LL | #[doc(alias = "\"")]
+   |       ^^^^^^^^^^^^
+
+error: '\n' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:11:7
+   |
+LL | #[doc(alias = "\n")]
+   |       ^^^^^^^^^^^^
+
+error: '\n' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:12:7
+   |
+LL |   #[doc(alias = "
+   |  _______^
+LL | | ")]
+   | |_^
+
+error: ' ' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:14:7
+   |
+LL | #[doc(alias = " ")]
+   |       ^^^^^^^^^^^
+
+error: '\t' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:15:7
+   |
+LL | #[doc(alias = "\t")]
+   |       ^^^^^^^^^^^^
+
+error: aborting due to 8 previous errors
 
diff --git a/src/test/ui/check-doc-alias-attr.rs b/src/test/ui/check-doc-alias-attr.rs
index b02cc1a4545..c8bec39fad6 100644
--- a/src/test/ui/check-doc-alias-attr.rs
+++ b/src/test/ui/check-doc-alias-attr.rs
@@ -7,4 +7,10 @@ pub struct Bar;
 #[doc(alias)] //~ ERROR
 #[doc(alias = 0)] //~ ERROR
 #[doc(alias("bar"))] //~ ERROR
+#[doc(alias = "\"")] //~ ERROR
+#[doc(alias = "\n")] //~ ERROR
+#[doc(alias = "
+")] //~^ ERROR
+#[doc(alias = " ")] //~ ERROR
+#[doc(alias = "\t")] //~ ERROR
 pub struct Foo;
diff --git a/src/test/ui/check-doc-alias-attr.stderr b/src/test/ui/check-doc-alias-attr.stderr
index 268230ab44a..be7d7b3dbea 100644
--- a/src/test/ui/check-doc-alias-attr.stderr
+++ b/src/test/ui/check-doc-alias-attr.stderr
@@ -16,5 +16,37 @@ error: doc alias attribute expects a string: #[doc(alias = "0")]
 LL | #[doc(alias("bar"))]
    |       ^^^^^^^^^^^^
 
-error: aborting due to 3 previous errors
+error: '\"' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:10:7
+   |
+LL | #[doc(alias = "\"")]
+   |       ^^^^^^^^^^^^
+
+error: '\n' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:11:7
+   |
+LL | #[doc(alias = "\n")]
+   |       ^^^^^^^^^^^^
+
+error: '\n' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:12:7
+   |
+LL |   #[doc(alias = "
+   |  _______^
+LL | | ")]
+   | |_^
+
+error: ' ' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:14:7
+   |
+LL | #[doc(alias = " ")]
+   |       ^^^^^^^^^^^
+
+error: '\t' character isn't allowed in `#[doc(alias = "...")]`
+  --> $DIR/check-doc-alias-attr.rs:15:7
+   |
+LL | #[doc(alias = "\t")]
+   |       ^^^^^^^^^^^^
+
+error: aborting due to 8 previous errors
 
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
new file mode 100644
index 00000000000..02944e2bff2
--- /dev/null
+++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.rs
@@ -0,0 +1,27 @@
+#![feature(min_const_generics)]
+
+// This test checks that non-static lifetimes are prohibited under `min_const_generics`. It
+// currently emits an error with `min_const_generics`. This will ICE under `const_generics`.
+
+fn test<const N: usize>() {}
+
+fn issue_75323_and_74447_1<'a>() -> &'a () {
+    test::<{ let _: &'a (); 3 },>();
+   //~^ ERROR a non-static lifetime is not allowed in a `const`
+    &()
+}
+
+fn issue_75323_and_74447_2() {
+    test::<{ let _: &(); 3 },>();
+}
+
+fn issue_75323_and_74447_3() {
+    test::<{ let _: &'static (); 3 },>();
+}
+
+fn issue_73375<'a>() {
+    [(); (|_: &'a u8| (), 0).1];
+    //~^ ERROR a non-static lifetime is not allowed in a `const`
+}
+
+fn main() {}
diff --git a/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
new file mode 100644
index 00000000000..cdfd491e395
--- /dev/null
+++ b/src/test/ui/const-generics/min_const_generics/forbid-non-static-lifetimes.stderr
@@ -0,0 +1,21 @@
+error[E0658]: a non-static lifetime is not allowed in a `const`
+  --> $DIR/forbid-non-static-lifetimes.rs:9:22
+   |
+LL |     test::<{ let _: &'a (); 3 },>();
+   |                      ^^
+   |
+   = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
+   = help: add `#![feature(const_generics)]` to the crate attributes to enable
+
+error[E0658]: a non-static lifetime is not allowed in a `const`
+  --> $DIR/forbid-non-static-lifetimes.rs:23:16
+   |
+LL |     [(); (|_: &'a u8| (), 0).1];
+   |                ^^
+   |
+   = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
+   = help: add `#![feature(const_generics)]` to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/consts/async-block.rs b/src/test/ui/consts/async-block.rs
new file mode 100644
index 00000000000..1fa2a616091
--- /dev/null
+++ b/src/test/ui/consts/async-block.rs
@@ -0,0 +1,8 @@
+// From <https://github.com/rust-lang/rust/issues/77361>
+
+// edition:2018
+
+const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 };
+//~^ `async` block
+
+fn main() {}
diff --git a/src/test/ui/consts/async-block.stderr b/src/test/ui/consts/async-block.stderr
new file mode 100644
index 00000000000..99f470623ac
--- /dev/null
+++ b/src/test/ui/consts/async-block.stderr
@@ -0,0 +1,8 @@
+error: `async` blocks are not allowed in constants
+  --> $DIR/async-block.rs:5:47
+   |
+LL | const _: i32 = { core::mem::ManuallyDrop::new(async { 0 }); 4 };
+   |                                               ^^^^^^^^^^^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/parser/bind-struct-early-modifiers.stderr b/src/test/ui/parser/bind-struct-early-modifiers.stderr
index 03482a41f54..b35762a887c 100644
--- a/src/test/ui/parser/bind-struct-early-modifiers.stderr
+++ b/src/test/ui/parser/bind-struct-early-modifiers.stderr
@@ -1,8 +1,10 @@
 error: expected `,`
-  --> $DIR/bind-struct-early-modifiers.rs:4:19
+  --> $DIR/bind-struct-early-modifiers.rs:4:20
    |
 LL |         Foo { ref x: ref x } => {},
-   |                   ^
+   |         ---        ^
+   |         |
+   |         while parsing the fields for this pattern
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/parser/issue-10392.stderr b/src/test/ui/parser/issue-10392.stderr
index 34991151c1e..438ea67d33c 100644
--- a/src/test/ui/parser/issue-10392.stderr
+++ b/src/test/ui/parser/issue-10392.stderr
@@ -2,7 +2,9 @@ error: expected identifier, found `,`
   --> $DIR/issue-10392.rs:6:13
    |
 LL |     let A { , } = a();
-   |             ^ expected identifier
+   |         -   ^ expected identifier
+   |         |
+   |         while parsing the fields for this pattern
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/parser/issue-63135.stderr b/src/test/ui/parser/issue-63135.stderr
index 396aec8335d..80e9ac5bedf 100644
--- a/src/test/ui/parser/issue-63135.stderr
+++ b/src/test/ui/parser/issue-63135.stderr
@@ -35,7 +35,9 @@ error: expected one of `!` or `[`, found `}`
   --> $DIR/issue-63135.rs:3:16
    |
 LL | fn i(n{...,f #
-   |                ^ expected one of `!` or `[`
+   |      -         ^ expected one of `!` or `[`
+   |      |
+   |      while parsing the fields for this pattern
 
 error: aborting due to 5 previous errors
 
diff --git a/src/test/ui/resolve/issue-54379.stderr b/src/test/ui/resolve/issue-54379.stderr
index 2a6b54572de..750727273eb 100644
--- a/src/test/ui/resolve/issue-54379.stderr
+++ b/src/test/ui/resolve/issue-54379.stderr
@@ -8,10 +8,12 @@ LL |         MyStruct { .., Some(_) } => {},
    |                    `..` must be at the end and cannot have a trailing comma
 
 error: expected `,`
-  --> $DIR/issue-54379.rs:9:24
+  --> $DIR/issue-54379.rs:9:28
    |
 LL |         MyStruct { .., Some(_) } => {},
-   |                        ^^^^
+   |         --------           ^
+   |         |
+   |         while parsing the fields for this pattern
 
 error: aborting due to 2 previous errors