forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
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 rust-lang#70246 - Dylan-DPC:rollup-vt9wex2, r=Dylan-DPC
Rollup of 10 pull requests Successful merges: - rust-lang#70003 (symbol_names: treat ReifyShim like VtableShim.) - rust-lang#70051 (Allow `hir().find` to return `None`) - rust-lang#70126 (Fix ICE caused by truncating a negative ZST enum discriminant) - rust-lang#70197 (For issue 53957: revise unit test to focus on underlying bug of 23076.) - rust-lang#70215 (ast: Compress `AttrId` from `usize` to `u32`) - rust-lang#70218 (Fix deprecated Error.description() usage in docs) - rust-lang#70228 (Remove CARGO_BUILD_TARGET from bootstrap.py) - rust-lang#70231 (Add explanation message for E0224) - rust-lang#70232 (Tweak wording for std::io::Read::read function) - rust-lang#70238 (Add a test for out-of-line module passed through a proc macro) Failed merges: r? @ghost
- Loading branch information
Showing
27 changed files
with
208 additions
and
58 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
A trait object was declaired with no traits. | ||
|
||
Erroneous code example: | ||
|
||
```compile_fail,E0224 | ||
type Foo = dyn 'static +; | ||
``` | ||
|
||
Rust does not currently support this. | ||
|
||
To solve ensure the the trait object has at least one trait: | ||
|
||
``` | ||
type Foo = dyn 'static + Copy; | ||
``` |
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
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,47 @@ | ||
// run-pass | ||
// Test a ZST enum whose dicriminant is ~0i128. This caused an ICE when casting to a i32. | ||
|
||
#[derive(Copy, Clone)] | ||
enum Nums { | ||
NegOne = -1, | ||
} | ||
|
||
const NEG_ONE_I8: i8 = Nums::NegOne as i8; | ||
const NEG_ONE_I16: i16 = Nums::NegOne as i16; | ||
const NEG_ONE_I32: i32 = Nums::NegOne as i32; | ||
const NEG_ONE_I64: i64 = Nums::NegOne as i64; | ||
const NEG_ONE_I128: i128 = Nums::NegOne as i128; | ||
|
||
#[inline(never)] | ||
fn identity<T>(t: T) -> T { t } | ||
|
||
fn test_as_arg(n: Nums) { | ||
assert_eq!(-1i8, n as i8); | ||
assert_eq!(-1i16, n as i16); | ||
assert_eq!(-1i32, n as i32); | ||
assert_eq!(-1i64, n as i64); | ||
assert_eq!(-1i128, n as i128); | ||
} | ||
|
||
fn main() { | ||
let kind = Nums::NegOne; | ||
assert_eq!(-1i8, kind as i8); | ||
assert_eq!(-1i16, kind as i16); | ||
assert_eq!(-1i32, kind as i32); | ||
assert_eq!(-1i64, kind as i64); | ||
assert_eq!(-1i128, kind as i128); | ||
|
||
assert_eq!(-1i8, identity(kind) as i8); | ||
assert_eq!(-1i16, identity(kind) as i16); | ||
assert_eq!(-1i32, identity(kind) as i32); | ||
assert_eq!(-1i64, identity(kind) as i64); | ||
assert_eq!(-1i128, identity(kind) as i128); | ||
|
||
test_as_arg(Nums::NegOne); | ||
|
||
assert_eq!(-1i8, NEG_ONE_I8); | ||
assert_eq!(-1i16, NEG_ONE_I16); | ||
assert_eq!(-1i32, NEG_ONE_I32); | ||
assert_eq!(-1i64, NEG_ONE_I64); | ||
assert_eq!(-1i128, NEG_ONE_I128); | ||
} |
Oops, something went wrong.