-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #69854 - pietroalbini:stable-next, r=Centril
[stable] Release 1.42.0 This PR prepares the release artifacts of Rust 1.42.0, and cherry-picks the following PRs: * #69754: Update deprecation version to 1.42 for Error::description * #69753: Do not ICE when matching an uninhabited enum's field * #69522 / #69853: error_derive_forbidden_on_non_adt: be more graceful * #68598: Fix null synthetic_implementors error In addition, the release notes are updated to include the remaining compatibility notes. r? @Centril
- Loading branch information
Showing
9 changed files
with
165 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
91 changes: 91 additions & 0 deletions
91
src/test/ui/consts/issue-69191-ice-on-uninhabited-enum-field.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// build-pass | ||
// | ||
// (this is deliberately *not* check-pass; I have confirmed that the bug in | ||
// question does not replicate when one uses `cargo check` alone.) | ||
|
||
pub enum Void {} | ||
|
||
enum UninhabitedUnivariant { | ||
_Variant(Void), | ||
} | ||
|
||
enum UninhabitedMultivariant2 { | ||
_Variant(Void), | ||
_Warriont(Void), | ||
} | ||
|
||
enum UninhabitedMultivariant3 { | ||
_Variant(Void), | ||
_Warriont(Void), | ||
_Worrynot(Void), | ||
} | ||
|
||
#[repr(C)] | ||
enum UninhabitedUnivariantC { | ||
_Variant(Void), | ||
} | ||
|
||
#[repr(i32)] | ||
enum UninhabitedUnivariant32 { | ||
_Variant(Void), | ||
} | ||
|
||
fn main() { | ||
let _seed: UninhabitedUnivariant = None.unwrap(); | ||
match _seed { | ||
UninhabitedUnivariant::_Variant(_x) => {} | ||
} | ||
|
||
let _seed: UninhabitedMultivariant2 = None.unwrap(); | ||
match _seed { | ||
UninhabitedMultivariant2::_Variant(_x) => {} | ||
UninhabitedMultivariant2::_Warriont(_x) => {} | ||
} | ||
|
||
let _seed: UninhabitedMultivariant2 = None.unwrap(); | ||
match _seed { | ||
UninhabitedMultivariant2::_Variant(_x) => {} | ||
_ => {} | ||
} | ||
|
||
let _seed: UninhabitedMultivariant2 = None.unwrap(); | ||
match _seed { | ||
UninhabitedMultivariant2::_Warriont(_x) => {} | ||
_ => {} | ||
} | ||
|
||
let _seed: UninhabitedMultivariant3 = None.unwrap(); | ||
match _seed { | ||
UninhabitedMultivariant3::_Variant(_x) => {} | ||
UninhabitedMultivariant3::_Warriont(_x) => {} | ||
UninhabitedMultivariant3::_Worrynot(_x) => {} | ||
} | ||
|
||
let _seed: UninhabitedMultivariant3 = None.unwrap(); | ||
match _seed { | ||
UninhabitedMultivariant3::_Variant(_x) => {} | ||
_ => {} | ||
} | ||
|
||
let _seed: UninhabitedMultivariant3 = None.unwrap(); | ||
match _seed { | ||
UninhabitedMultivariant3::_Warriont(_x) => {} | ||
_ => {} | ||
} | ||
|
||
let _seed: UninhabitedMultivariant3 = None.unwrap(); | ||
match _seed { | ||
UninhabitedMultivariant3::_Worrynot(_x) => {} | ||
_ => {} | ||
} | ||
|
||
let _seed: UninhabitedUnivariantC = None.unwrap(); | ||
match _seed { | ||
UninhabitedUnivariantC::_Variant(_x) => {} | ||
} | ||
|
||
let _seed: UninhabitedUnivariant32 = None.unwrap(); | ||
match _seed { | ||
UninhabitedUnivariant32::_Variant(_x) => {} | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/test/ui/malformed/issue-69341-malformed-derive-inert.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
fn main() {} | ||
|
||
struct CLI { | ||
#[derive(parse())] | ||
//~^ ERROR traits in `#[derive(...)]` don't accept arguments | ||
//~| ERROR cannot find derive macro `parse` in this scope | ||
//~| ERROR cannot find derive macro `parse` in this scope | ||
path: (), | ||
//~^ ERROR `derive` may only be applied to structs, enums and unions | ||
} |
26 changes: 26 additions & 0 deletions
26
src/test/ui/malformed/issue-69341-malformed-derive-inert.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
error: traits in `#[derive(...)]` don't accept arguments | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:4:19 | ||
| | ||
LL | #[derive(parse())] | ||
| ^^ help: remove the arguments | ||
|
||
error: `derive` may only be applied to structs, enums and unions | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:8:5 | ||
| | ||
LL | path: (), | ||
| ^^^^^^^^ | ||
|
||
error: cannot find derive macro `parse` in this scope | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:4:14 | ||
| | ||
LL | #[derive(parse())] | ||
| ^^^^^ | ||
|
||
error: cannot find derive macro `parse` in this scope | ||
--> $DIR/issue-69341-malformed-derive-inert.rs:4:14 | ||
| | ||
LL | #[derive(parse())] | ||
| ^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|