-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #94997 - michaelwoerister:fix-enum-type-name-layout-e…
…rror, r=wesleywiser debuginfo: Fix ICE when generating name for type that produces a layout error. Fixes #94961.
- Loading branch information
Showing
5 changed files
with
67 additions
and
2 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
16 changes: 16 additions & 0 deletions
16
src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.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,16 @@ | ||
// Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that | ||
// causes a layout error. See https://github.com/rust-lang/rust/issues/94961. | ||
|
||
// compile-flags:-C debuginfo=2 | ||
// build-fail | ||
// error-pattern: too big for the current architecture | ||
// normalize-stderr-64bit "18446744073709551615" -> "SIZE" | ||
// normalize-stderr-32bit "4294967295" -> "SIZE" | ||
|
||
#![crate_type = "rlib"] | ||
|
||
pub struct Foo<T>([T; usize::MAX]); | ||
|
||
pub fn foo() -> usize { | ||
std::mem::size_of::<Foo<u8>>() | ||
} |
4 changes: 4 additions & 0 deletions
4
src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-1.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,4 @@ | ||
error: values of the type `[u8; SIZE]` are too big for the current architecture | ||
|
||
error: aborting due to previous error | ||
|
20 changes: 20 additions & 0 deletions
20
src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.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,20 @@ | ||
// Make sure the compiler does not ICE when trying to generate the debuginfo name of a type that | ||
// causes a layout error. | ||
// This version of the test already ICE'd before the commit that introduce the ICE described in | ||
// https://github.com/rust-lang/rust/issues/94961. | ||
|
||
// compile-flags:-C debuginfo=2 | ||
// build-fail | ||
// error-pattern: too big for the current architecture | ||
// normalize-stderr-64bit "18446744073709551615" -> "SIZE" | ||
// normalize-stderr-32bit "4294967295" -> "SIZE" | ||
|
||
#![crate_type = "rlib"] | ||
|
||
pub enum Foo<T> { | ||
Bar([T; usize::MAX]), | ||
} | ||
|
||
pub fn foo() -> usize { | ||
std::mem::size_of::<Foo<u8>>() | ||
} |
4 changes: 4 additions & 0 deletions
4
src/test/ui/debuginfo/debuginfo-type-name-layout-ice-94961-2.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,4 @@ | ||
error: values of the type `[u8; SIZE]` are too big for the current architecture | ||
|
||
error: aborting due to previous error | ||
|