X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Ftest%2Fui%2Fconsts%2Fconst-eval%2Fub-ref.rs;h=0d8f30159b3160fb19958338d5f2fa95d5c15208;hb=947d7cf16db583bae255260696f022fb0e7ea4db;hp=c0dd94a375bcbb0c69d36886fa3e582b51a63619;hpb=1c57f0ab9c58d8394b531de15423fbb4c57a2613;p=rust.git diff --git a/src/test/ui/consts/const-eval/ub-ref.rs b/src/test/ui/consts/const-eval/ub-ref.rs index c0dd94a375b..0d8f30159b3 100644 --- a/src/test/ui/consts/const-eval/ub-ref.rs +++ b/src/test/ui/consts/const-eval/ub-ref.rs @@ -1,13 +1,4 @@ -// Copyright 2018 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - +// ignore-tidy-linelength #![feature(const_transmute)] #![allow(const_err)] // make sure we cannot allow away the errors tested here @@ -15,6 +6,7 @@ const UNALIGNED: &u16 = unsafe { mem::transmute(&[0u8; 4]) }; //~^ ERROR it is undefined behavior to use this value +//~^^ type validation failed: encountered unaligned reference (required 2 byte alignment but found 1) const NULL: &u16 = unsafe { mem::transmute(0usize) }; //~^ ERROR it is undefined behavior to use this value