mirror of
https://github.com/rust-lang/rust.git
synced 2025-09-28 05:34:45 +00:00

We have a ui test to ensure we emit an error if we encounter too big enums. Before this fix, compiling the test with `-Cdebuginfo=2` would not include the span of the instantiation site, because the error is then emitted from a different code path that does not include the span. Propagate the span to the error also in the debuginfo case, so the test passes regardless of debuginfo level.
20 lines
670 B
Rust
20 lines
670 B
Rust
// FIXME(#61117): Remove revisions once x86_64-gnu-debug CI job sets rust.debuginfo-level-tests=2
|
|
// NOTE: The .stderr for both revisions shall be identical.
|
|
//@ revisions: no-debuginfo full-debuginfo
|
|
//@ build-fail
|
|
//@ normalize-stderr: "std::option::Option<\[u32; \d+\]>" -> "TYPE"
|
|
//@ normalize-stderr: "\[u32; \d+\]" -> "TYPE"
|
|
//@[no-debuginfo] compile-flags: -Cdebuginfo=0
|
|
//@[full-debuginfo] compile-flags: -Cdebuginfo=2
|
|
|
|
#[cfg(target_pointer_width = "32")]
|
|
type BIG = Option<[u32; (1<<29)-1]>;
|
|
|
|
#[cfg(target_pointer_width = "64")]
|
|
type BIG = Option<[u32; (1<<59)-1]>;
|
|
|
|
fn main() {
|
|
let big: BIG = None;
|
|
//~^ ERROR are too big for the target architecture
|
|
}
|