Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 17 pull requests #74223

Closed
wants to merge 48 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a31f103
Add core::future::{poll_fn, PollFn}
yoshuawuyts May 17, 2020
7e682d3
Stabilize casts and coercions to `&[T]` in const fn
oli-obk Jun 29, 2020
8e256b1
parser: Break float tokens into parts in tuple field positions
petrochenkov Apr 18, 2020
40a2170
Add test of tuple nested indexing
dtolnay Mar 26, 2020
0432f63
Test even deeper nested indexing
dtolnay Mar 26, 2020
776deb6
Test a range, which is not nested indexing
dtolnay Mar 26, 2020
6dfa549
Add tests in which the token really is a float
dtolnay Mar 26, 2020
3814eec
Add test for tuple indexed with float in macro input
dtolnay Mar 26, 2020
63f95a4
Add test for errors triggered on parts of decomposed index
dtolnay Mar 26, 2020
64a88db
Update dtolnay's tests that now work
petrochenkov Apr 19, 2020
52bdaaa
Add some requested tests
petrochenkov Jul 1, 2020
fb9fa5b
adjust ub-enum test to be endianess-independent
RalfJung Jul 3, 2020
bcef848
Explain effects of debugging options from config.toml
tmiasko Jul 5, 2020
6b59cac
Suppress debuginfo on naked function arguments
npmccallum Jul 6, 2020
5702e02
Only allow `repr(i128/u128)` on enum
nbdd0121 Jul 6, 2020
97867bb
Add UI test for issue 74082
nbdd0121 Jul 6, 2020
b50c13c
Update books
ehuss Jul 7, 2020
32025fd
Update rust-installer to latest version
michaelforney May 25, 2020
3c63fba
Correctly mark the ending span of a match arm
ayazhafiz Jul 7, 2020
51b646e
ci: disabled: riscv: minimise docker overlays
tblah Jul 8, 2020
d9fec59
ci: fix context for disabled docker images
tblah Jul 8, 2020
7ca2a4b
Stabilize `transmute` in constants and statics but not const fn
oli-obk Aug 30, 2019
6864546
Add a help to use `in_band_lifetimes` in nightly
JohnTitor Jul 8, 2020
a9b6476
Tweak wording
JohnTitor Jul 9, 2020
0a7d297
Eliminate `rust_input`.
nnethercote Jul 7, 2020
1e8ec2d
Add an explanatory comment to `scoped_thread`.
nnethercote Jul 7, 2020
4ad5de2
Tweak `spawn_thread_pool`.
nnethercote Jul 7, 2020
bf70786
Change some function names.
nnethercote Jul 7, 2020
481988b
Use str::strip* in bootstrap
tesuji Jul 10, 2020
1ca7bfe
Only add cfguard module flag on windows-msvc
ajpaverd Jul 6, 2020
62cf767
Avoid "whitelist"
tamird Jul 7, 2020
83ceb09
Rollup merge of #71322 - petrochenkov:tuple00, r=nikomatsakis
Manishearth Jul 10, 2020
393cb45
Rollup merge of #72303 - yoshuawuyts:future-poll-fn, r=dtolnay
Manishearth Jul 10, 2020
7855cc8
Rollup merge of #72920 - oli-obk:const_transmute, r=RalfJung
Manishearth Jul 10, 2020
0af8781
Rollup merge of #73862 - oli-obk:const_array_to_slice, r=RalfJung
Manishearth Jul 10, 2020
04e9061
Rollup merge of #73989 - RalfJung:ub-enum-test, r=oli-obk
Manishearth Jul 10, 2020
372b6e3
Rollup merge of #74045 - tmiasko:config-debug, r=nikomatsakis
Manishearth Jul 10, 2020
dbd9c58
Rollup merge of #74100 - lzutao:strip-bootstrap, r=Mark-Simulacrum
Manishearth Jul 10, 2020
f254701
Rollup merge of #74103 - ajpaverd:cfguard-msvc-only, r=nikomatsakis
Manishearth Jul 10, 2020
189fd68
Rollup merge of #74105 - npmccallum:naked, r=matthewjasper
Manishearth Jul 10, 2020
1e238fb
Rollup merge of #74109 - nbdd0121:issue-74082, r=petrochenkov
Manishearth Jul 10, 2020
fcc2016
Rollup merge of #74122 - nnethercote:startup-cleanup, r=petrochenkov
Manishearth Jul 10, 2020
740890e
Rollup merge of #74125 - ayazhafiz:i/74050, r=matthewjasper
Manishearth Jul 10, 2020
bdbf1e8
Rollup merge of #74127 - tamird:allowlist, r=oli-obk
Manishearth Jul 10, 2020
d570a0d
Rollup merge of #74135 - ehuss:update-books, r=ehuss
Manishearth Jul 10, 2020
ce397e7
Rollup merge of #74145 - michaelforney:rust-installer, r=Mark-Simulacrum
Manishearth Jul 10, 2020
e9712e2
Rollup merge of #74161 - tblah:riscv64gc-dockerfile-improvment, r=Mar…
Manishearth Jul 10, 2020
da5ad59
Rollup merge of #74168 - JohnTitor:help-for-in-band-lifetimes, r=petr…
Manishearth Jul 10, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Stabilize transmute in constants and statics but not const fn
  • Loading branch information
oli-obk committed Jul 9, 2020

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit 7ca2a4bdd1119aaad526c4743afa1f4dc9c9f607
4 changes: 3 additions & 1 deletion src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
@@ -1285,7 +1285,9 @@ extern "rust-intrinsic" {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_transmute", issue = "53605")]
// NOTE: While this makes the intrinsic const stable, we have some custom code in const fn
// checks that prevent its use within `const fn`.
#[rustc_const_stable(feature = "const_transmute", since = "1.46.0")]
pub fn transmute<T, U>(e: T) -> U;

/// Returns `true` if the actual type given as `T` requires drop
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
@@ -140,7 +140,7 @@
#![feature(rtm_target_feature)]
#![feature(f16c_target_feature)]
#![feature(hexagon_target_feature)]
#![feature(const_transmute)]
#![cfg_attr(not(bootstrap), feature(const_fn_transmute))]
#![feature(abi_unadjusted)]
#![feature(adx_target_feature)]
#![feature(maybe_uninit_slice)]
2 changes: 1 addition & 1 deletion src/librustc_ast/lib.rs
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
#![cfg_attr(bootstrap, feature(const_if_match))]
#![feature(const_fn)] // For the `transmute` in `P::new`
#![feature(const_panic)]
#![feature(const_transmute)]
#![cfg_attr(not(bootstrap), feature(const_fn_transmute))]
#![feature(crate_visibility_modifier)]
#![feature(label_break_value)]
#![feature(nll)]
3 changes: 3 additions & 0 deletions src/librustc_feature/active.rs
Original file line number Diff line number Diff line change
@@ -573,6 +573,9 @@ declare_features! (
/// Lazily evaluate constants. This allows constants to depend on type parameters.
(active, lazy_normalization_consts, "1.46.0", Some(72219), None),

/// Alloc calling `transmute` in const fn
(active, const_fn_transmute, "1.46.0", Some(53605), None),

// -------------------------------------------------------------------------
// feature-group-end: actual feature gates
// -------------------------------------------------------------------------
2 changes: 1 addition & 1 deletion src/librustc_middle/lib.rs
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
#![cfg_attr(bootstrap, feature(const_if_match))]
#![feature(const_fn)]
#![feature(const_panic)]
#![feature(const_transmute)]
#![cfg_attr(not(bootstrap), feature(const_fn_transmute))]
#![feature(core_intrinsics)]
#![feature(discriminant_kind)]
#![feature(drain_filter)]
15 changes: 15 additions & 0 deletions src/librustc_mir/transform/qualify_min_const_fn.rs
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ use rustc_middle::ty::subst::GenericArgKind;
use rustc_middle::ty::{self, adjustment::PointerCast, Ty, TyCtxt};
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use rustc_target::spec::abi::Abi::RustIntrinsic;
use std::borrow::Cow;

type McfResult = Result<(), (Span, Cow<'static, str>)>;
@@ -409,6 +410,20 @@ fn check_terminator(
));
}

// HACK: This is to "unstabilize" the `transmute` intrinsic
// within const fns. `transmute` is allowed in all other const contexts.
// This won't really scale to more intrinsics or functions. Let's allow const
// transmutes in const fn before we add more hacks to this.
if tcx.fn_sig(fn_def_id).abi() == RustIntrinsic
&& tcx.item_name(fn_def_id) == sym::transmute
&& !feature_allowed(tcx, def_id, sym::const_fn_transmute)
{
return Err((
span,
"can only call `transmute` from const items, not `const fn`".into(),
));
}

check_operand(tcx, func, span, fn_def_id, body)?;

for arg in args {
1 change: 1 addition & 0 deletions src/librustc_span/symbol.rs
Original file line number Diff line number Diff line change
@@ -848,6 +848,7 @@ symbols! {
track_caller,
trait_alias,
transmute,
const_fn_transmute,
transparent,
transparent_enums,
transparent_unions,
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/dangling.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(const_transmute, const_raw_ptr_deref)]
#![feature(const_raw_ptr_deref)]

use std::{mem, usize};

2 changes: 2 additions & 0 deletions src/test/ui/consts/const-eval/double_check.rs
Original file line number Diff line number Diff line change
@@ -20,4 +20,6 @@ static FOO: (&Foo, &Bar) = unsafe {(
Union { u8: &BAR }.bar,
)};

static FOO2: (&Foo, &Bar) = unsafe {(std::mem::transmute(&BAR), std::mem::transmute(&BAR))};

fn main() {}
2 changes: 2 additions & 0 deletions src/test/ui/consts/const-eval/double_check2.rs
Original file line number Diff line number Diff line change
@@ -17,5 +17,7 @@ static FOO: (&Foo, &Bar) = unsafe {( //~ undefined behavior
Union { u8: &BAR }.foo,
Union { u8: &BAR }.bar,
)};
static FOO2: (&Foo, &Bar) = unsafe {(std::mem::transmute(&BAR), std::mem::transmute(&BAR))};
//~^ undefined behavior

fn main() {}
10 changes: 9 additions & 1 deletion src/test/ui/consts/const-eval/double_check2.stderr
Original file line number Diff line number Diff line change
@@ -9,6 +9,14 @@ LL | | )};
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error: aborting due to previous error
error[E0080]: it is undefined behavior to use this value
--> $DIR/double_check2.rs:20:1
|
LL | static FOO2: (&Foo, &Bar) = unsafe {(std::mem::transmute(&BAR), std::mem::transmute(&BAR))};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x05 at .1.<deref>.<enum-tag>, but expected a valid enum tag
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0080`.
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/issue-55541.rs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

// Test that we can handle newtypes wrapping extern types

#![feature(extern_types, const_transmute)]
#![feature(extern_types)]

use std::marker::PhantomData;

2 changes: 0 additions & 2 deletions src/test/ui/consts/const-eval/transmute-const.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(const_transmute)]

use std::mem;

static FOO: bool = unsafe { mem::transmute(3u8) };
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/transmute-const.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
--> $DIR/transmute-const.rs:5:1
--> $DIR/transmute-const.rs:3:1
|
LL | static FOO: bool = unsafe { mem::transmute(3u8) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered 0x03, but expected a boolean
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/ub-enum.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// normalize-stderr-64bit "0x0000000000" -> "0x00"
#![feature(const_transmute, never_type)]
#![feature(never_type)]
#![allow(const_err)] // make sure we cannot allow away the errors tested here

use std::mem;
1 change: 0 additions & 1 deletion src/test/ui/consts/const-eval/ub-int-array.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(const_transmute)]
#![allow(const_err)] // make sure we cannot allow away the errors tested here

//! Test the "array of int" fast path in validity checking, and in particular whether it
6 changes: 3 additions & 3 deletions src/test/ui/consts/const-eval/ub-int-array.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:15:1
--> $DIR/ub-int-array.rs:14:1
|
LL | / const UNINIT_INT_0: [u32; 3] = unsafe {
LL | |
@@ -13,7 +13,7 @@ LL | | };
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:24:1
--> $DIR/ub-int-array.rs:23:1
|
LL | / const UNINIT_INT_1: [u32; 3] = unsafe {
LL | |
@@ -27,7 +27,7 @@ LL | | };
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-int-array.rs:44:1
--> $DIR/ub-int-array.rs:43:1
|
LL | / const UNINIT_INT_2: [u32; 3] = unsafe {
LL | |
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/ub-nonnull.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(rustc_attrs, const_transmute)]
#![feature(rustc_attrs)]
#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here

use std::mem;
1 change: 0 additions & 1 deletion src/test/ui/consts/const-eval/ub-ref.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-tidy-linelength
#![feature(const_transmute)]
#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here

use std::mem;
18 changes: 9 additions & 9 deletions src/test/ui/consts/const-eval/ub-ref.stderr
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:7:1
--> $DIR/ub-ref.rs:6:1
|
LL | const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered an unaligned reference (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:11:1
--> $DIR/ub-ref.rs:10:1
|
LL | const UNALIGNED_BOX: Box<u16> = unsafe { mem::transmute(&[0u8; 4]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered an unaligned box (required 2 byte alignment but found 1)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:15:1
--> $DIR/ub-ref.rs:14:1
|
LL | const NULL: &u16 = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a NULL reference
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:18:1
--> $DIR/ub-ref.rs:17:1
|
LL | const NULL_BOX: Box<u16> = unsafe { mem::transmute(0usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a NULL box
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:24:1
--> $DIR/ub-ref.rs:23:1
|
LL | const REF_AS_USIZE: usize = unsafe { mem::transmute(&0) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered pointer to alloc16, but expected initialized plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:27:1
--> $DIR/ub-ref.rs:26:1
|
LL | const REF_AS_USIZE_SLICE: &[usize] = &[unsafe { mem::transmute(&0) }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<deref>, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:30:1
--> $DIR/ub-ref.rs:29:1
|
LL | const REF_AS_USIZE_BOX_SLICE: Box<[usize]> = unsafe { mem::transmute::<&[usize], _>(&[mem::transmute(&0)]) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a pointer at .<deref>, but expected plain (non-pointer) bytes
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:33:1
--> $DIR/ub-ref.rs:32:1
|
LL | const USIZE_AS_REF: &'static u8 = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling reference (created from integer)
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-ref.rs:36:1
--> $DIR/ub-ref.rs:35:1
|
LL | const USIZE_AS_BOX: Box<u8> = unsafe { mem::transmute(1337usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a dangling box (created from integer)
1 change: 0 additions & 1 deletion src/test/ui/consts/const-eval/ub-uninhabit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(const_transmute)]
#![allow(const_err)] // make sure we cannot allow away the errors tested here

use std::mem;
6 changes: 3 additions & 3 deletions src/test/ui/consts/const-eval/ub-uninhabit.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:15:1
--> $DIR/ub-uninhabit.rs:14:1
|
LL | const BAD_BAD_BAD: Bar = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:18:1
--> $DIR/ub-uninhabit.rs:17:1
|
LL | const BAD_BAD_REF: &Bar = unsafe { mem::transmute(1usize) };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar at .<deref>
|
= note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.

error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-uninhabit.rs:21:1
--> $DIR/ub-uninhabit.rs:20:1
|
LL | const BAD_BAD_ARRAY: [Bar; 1] = unsafe { MaybeUninit { uninit: () }.init };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type validation failed: encountered a value of uninhabited type Bar at [0]
1 change: 0 additions & 1 deletion src/test/ui/consts/const-eval/ub-upvars.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(const_transmute)]
#![allow(const_err, invalid_value)] // make sure we cannot allow away the errors tested here

use std::mem;
2 changes: 1 addition & 1 deletion src/test/ui/consts/const-eval/ub-upvars.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0080]: it is undefined behavior to use this value
--> $DIR/ub-upvars.rs:6:1
--> $DIR/ub-upvars.rs:5:1
|
LL | / const BAD_UPVAR: &dyn FnOnce() = &{
LL | | let bad_ref: &'static u16 = unsafe { mem::transmute(0usize) };
1 change: 0 additions & 1 deletion src/test/ui/consts/const-eval/ub-wide-ptr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// ignore-tidy-linelength
#![feature(const_transmute)]
#![allow(unused)]
#![allow(const_err)] // make sure we cannot allow away the errors tested here

Loading