Closed
Description
I'm working in a test with //@ build-fail
, and I am getting the following error from compiletest:
error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/r/src/rust/rustc.2/tests/ui/asm/x86_64/type-check-4.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/r/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/r/src/rust/rustc.2/vendor" "--sysroot" "/home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/test/ui/asm/x86_64/type-check-4" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/home/r/src/rust/rustc.2/build/x86_64-unknown-linux-gnu/test/ui/asm/x86_64/type-check-4/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0015]: cannot call non-const fn `non_const_fn` in constants
--> /home/r/src/rust/rustc.2/tests/ui/asm/x86_64/type-check-4.rs:12:25
|
LL | global_asm!("{}", const non_const_fn(0));
| ^^^^^^^^^^^^^^^
|
= note: calls in constants are limited to constant functions, tuple structs and tuple variants
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0015`.
------------------------------------------
This error clearly makes no sense -- test compilation should indeed fail, it's a build-fail test after all!
But I assume what happens is what because it says "build-fail", it expects that a "check" build (--emit=metadata
) should succeed, and that's the cause of the error. But then it should say so very clearly.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done