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`
This commit is contained in:
bors 2020-10-02 19:42:07 +00:00
commit 8876ffc923
32 changed files with 409 additions and 212 deletions

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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() {}

View file

@ -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`.

View file

@ -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() {}

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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