Fix tests and bless

This commit is contained in:
Gary Guo 2024-04-19 16:54:41 +01:00
parent 94c1920497
commit cfee72aa24
64 changed files with 117 additions and 171 deletions

View File

@ -1,7 +1,5 @@
//@ compile-flags: --crate-type=lib -Copt-level=0 -Zmir-opt-level=0 -C debuginfo=2
#![feature(inline_const)]
// Test that we don't generate a memory allocation for the constant
// and read the fields from that, but instead just create the value pair directly.
pub fn foo() -> (i32, i32) {

View File

@ -4,7 +4,6 @@
#![crate_type = "lib"]
#![feature(core_intrinsics)]
#![feature(custom_mir)]
#![feature(inline_const)]
#![allow(unreachable_code)]
use std::intrinsics::{transmute, transmute_unchecked};

View File

@ -1,7 +1,6 @@
//@ compile-flags: -O
#![crate_type = "lib"]
#![feature(inline_const)]
use std::mem::MaybeUninit;

View File

@ -5,7 +5,7 @@
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
#![crate_type="lib"]
#![feature(inline_const, type_alias_impl_trait)]
#![feature(type_alias_impl_trait)]
extern crate core;

View File

@ -4,7 +4,6 @@
#![crate_type = "lib"]
#![allow(non_camel_case_types)]
#![feature(repr_simd, intrinsics)]
#![feature(inline_const)]
#[repr(simd)]
#[derive(Copy, Clone)]

View File

@ -1,5 +1,5 @@
// skip-filecheck
#![feature(custom_mir, core_intrinsics, inline_const)]
#![feature(custom_mir, core_intrinsics)]
extern crate core;
use core::intrinsics::mir::*;

View File

@ -1,5 +1,5 @@
// skip-filecheck
#![feature(custom_mir, core_intrinsics, inline_const)]
#![feature(custom_mir, core_intrinsics)]
extern crate core;
use core::intrinsics::mir::*;

View File

@ -1,6 +1,6 @@
// skip-filecheck
//@ compile-flags: --crate-type=lib
#![feature(custom_mir, core_intrinsics, inline_const)]
#![feature(custom_mir, core_intrinsics)]
use std::intrinsics::mir::*;
// EMIT_MIR operators.f.built.after.mir

View File

@ -4,7 +4,6 @@
// Verify that we can pretty print invalid constants.
#![feature(adt_const_params)]
#![feature(inline_const)]
#![allow(incomplete_features)]
#[derive(Copy, Clone)]

View File

@ -1,6 +1,5 @@
//@ pp-exact
#![feature(inline_const)]
#![feature(inline_const_pat)]
#![feature(rustc_attrs)]
#![feature(stmt_expr_attributes)]

View File

@ -1,4 +1,4 @@
#![feature(inline_const, generic_const_exprs)]
#![feature(generic_const_exprs)]
//~^ WARN the feature `generic_const_exprs` is incomplete
fn foo<T>() {

View File

@ -1,8 +1,8 @@
warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
--> $DIR/const-block-is-poly.rs:1:26
--> $DIR/const-block-is-poly.rs:1:12
|
LL | #![feature(inline_const, generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
LL | #![feature(generic_const_exprs)]
| ^^^^^^^^^^^^^^^^^^^
|
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
= note: `#[warn(incomplete_features)]` on by default

View File

@ -1,5 +1,5 @@
//@ check-pass
#![feature(inline_const, generic_const_exprs)]
#![feature(generic_const_exprs)]
#![allow(incomplete_features)]
use std::marker::PhantomData;

View File

@ -1,7 +1,6 @@
//@ check-pass
#![feature(generic_const_exprs)]
#![feature(inline_const)]
#![allow(incomplete_features)]
pub struct ConstDefaultUnstable<const N: usize = { const { 3 } }>;

View File

@ -1,7 +1,5 @@
//@ run-pass
#![feature(inline_const)]
// Makes sure we don't propagate generic instances of `Self: ?Sized` blanket impls.
// This is relevant when we have an overlapping impl and builtin dyn instance.
// See <https://github.com/rust-lang/rust/pull/114941> for more context.

View File

@ -1,6 +1,5 @@
// Regression test for issue 90013.
//@ check-pass
#![feature(inline_const)]
fn main() {
const { || {} };

View File

@ -1,7 +1,7 @@
//@ known-bug: #103507
#![allow(unused)]
#![feature(const_trait_impl, inline_const, negative_impls)]
#![feature(const_trait_impl, negative_impls)]
use std::marker::Destruct;

View File

@ -1,6 +1,5 @@
//@ run-pass
#![feature(inline_const)]
#![allow(unused)]
// Some type that is not copyable.

View File

@ -1,7 +1,6 @@
//@ run-pass
#![feature(core_intrinsics)]
#![feature(const_heap)]
#![feature(inline_const)]
use std::intrinsics;

View File

@ -1,7 +1,6 @@
//@ run-pass
#![feature(core_intrinsics)]
#![feature(const_heap)]
#![feature(inline_const)]
use std::intrinsics;

View File

@ -1,4 +1,4 @@
#![feature(inline_const, const_type_id)]
#![feature(const_type_id)]
use std::alloc::Layout;
use std::any::TypeId;

View File

@ -3,7 +3,6 @@
#![feature(type_alias_impl_trait)]
#![feature(const_trait_impl)]
#![feature(const_refs_to_cell)]
#![feature(inline_const)]
use std::marker::Destruct;

View File

@ -1,11 +1,11 @@
error: `~const` can only be applied to `#[const_trait]` traits
--> $DIR/normalize-tait-in-const.rs:25:42
--> $DIR/normalize-tait-in-const.rs:24:42
|
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
| ^^^^^^^^^^^^^^^^^
error[E0015]: cannot call non-const closure in constant functions
--> $DIR/normalize-tait-in-const.rs:26:5
--> $DIR/normalize-tait-in-const.rs:25:5
|
LL | fun(filter_positive());
| ^^^^^^^^^^^^^^^^^^^^^^
@ -21,7 +21,7 @@ LL + #![feature(effects)]
|
error[E0493]: destructor of `F` cannot be evaluated at compile-time
--> $DIR/normalize-tait-in-const.rs:25:79
--> $DIR/normalize-tait-in-const.rs:24:79
|
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
| ^^^ the destructor for this type cannot be evaluated in constant functions

View File

@ -1,7 +1,5 @@
//@ build-pass
#![feature(inline_const)]
use std::cell::Cell;
fn main() {

View File

@ -1,7 +1,5 @@
//@ run-pass
#![feature(inline_const)]
fn foo() -> i32 {
const {
let x = 5 + 10;

View File

@ -1,5 +1,4 @@
//@ build-fail
#![feature(inline_const)]
fn foo<T>() {
const { assert!(std::mem::size_of::<T>() == 0); } //~ ERROR E0080

View File

@ -1,37 +1,37 @@
error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
--> $DIR/const-expr-generic-err.rs:5:13
--> $DIR/const-expr-generic-err.rs:4:13
|
LL | const { assert!(std::mem::size_of::<T>() == 0); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/const-expr-generic-err.rs:5:13
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/const-expr-generic-err.rs:4:13
|
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
note: erroneous constant encountered
--> $DIR/const-expr-generic-err.rs:5:5
--> $DIR/const-expr-generic-err.rs:4:5
|
LL | const { assert!(std::mem::size_of::<T>() == 0); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: the above error was encountered while instantiating `fn foo::<i32>`
--> $DIR/const-expr-generic-err.rs:13:5
--> $DIR/const-expr-generic-err.rs:12:5
|
LL | foo::<i32>();
| ^^^^^^^^^^^^
error[E0080]: evaluation of `bar::<0>::{constant#0}` failed
--> $DIR/const-expr-generic-err.rs:9:13
--> $DIR/const-expr-generic-err.rs:8:13
|
LL | const { N - 1 }
| ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
note: erroneous constant encountered
--> $DIR/const-expr-generic-err.rs:9:5
--> $DIR/const-expr-generic-err.rs:8:5
|
LL | const { N - 1 }
| ^^^^^^^^^^^^^^^
note: erroneous constant encountered
--> $DIR/const-expr-generic-err.rs:9:5
--> $DIR/const-expr-generic-err.rs:8:5
|
LL | const { N - 1 }
| ^^^^^^^^^^^^^^^
@ -39,7 +39,7 @@ LL | const { N - 1 }
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
note: the above error was encountered while instantiating `fn bar::<0>`
--> $DIR/const-expr-generic-err.rs:14:5
--> $DIR/const-expr-generic-err.rs:13:5
|
LL | bar::<0>();
| ^^^^^^^^^^

View File

@ -1,5 +1,3 @@
#![feature(inline_const)]
fn foo<T>() {
let _ = [0u8; const { std::mem::size_of::<T>() }];
//~^ ERROR: constant expression depends on a generic parameter

View File

@ -1,5 +1,5 @@
error: constant expression depends on a generic parameter
--> $DIR/const-expr-generic-err2.rs:4:19
--> $DIR/const-expr-generic-err2.rs:2:19
|
LL | let _ = [0u8; const { std::mem::size_of::<T>() }];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,4 @@
//@ check-pass
#![feature(inline_const)]
fn foo<T>() -> usize {
const { std::mem::size_of::<T>() }

View File

@ -1,7 +1,5 @@
//@ check-pass
#![feature(inline_const)]
pub fn todo<T>() -> T {
const { todo!() }
}

View File

@ -1,5 +1,4 @@
#![feature(const_mut_refs)]
#![feature(inline_const)]
use std::marker::PhantomData;

View File

@ -1,5 +1,5 @@
error[E0597]: `y` does not live long enough
--> $DIR/const-expr-lifetime-err.rs:23:30
--> $DIR/const-expr-lifetime-err.rs:22:30
|
LL | fn foo<'a>() {
| -- lifetime `'a` defined here

View File

@ -1,7 +1,6 @@
//@ run-pass
#![feature(const_mut_refs)]
#![feature(inline_const)]
use std::marker::PhantomData;

View File

@ -1,7 +1,5 @@
//@ run-pass
#![feature(inline_const)]
macro_rules! do_const_block{
($val:block) => { const $val }
}

View File

@ -1,7 +1,5 @@
//@ run-pass
#![feature(inline_const)]
const fn bar() -> i32 {
const {
2 + 3

View File

@ -1,7 +1,6 @@
//@ run-pass
#![feature(const_mut_refs)]
#![feature(inline_const)]
#![feature(inline_const_pat)]
use std::marker::PhantomData;

View File

@ -1,7 +1,5 @@
//@ check-pass
#![feature(inline_const)]
fn main() {
let _my_usize = const {
let a = 10_usize;

View File

@ -1,4 +1,3 @@
#![feature(inline_const)]
const unsafe fn require_unsafe() -> usize {
1
}

View File

@ -1,5 +1,5 @@
error[E0133]: call to unsafe function `require_unsafe` is unsafe and requires unsafe function or block
--> $DIR/expr-unsafe-err.rs:8:9
--> $DIR/expr-unsafe-err.rs:7:9
|
LL | require_unsafe();
| ^^^^^^^^^^^^^^^^ call to unsafe function

View File

@ -1,7 +1,7 @@
//@ check-pass
#![warn(unused_unsafe)]
#![feature(inline_const)]
const unsafe fn require_unsafe() -> usize { 1 }
fn main() {

View File

@ -1,5 +1,3 @@
#![feature(inline_const)]
fn main() {
const { 2 } - const { 1 };
//~^ ERROR mismatched types

View File

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/expr-with-block-err.rs:4:13
--> $DIR/expr-with-block-err.rs:2:13
|
LL | const { 2 } - const { 1 };
| ^ expected `()`, found integer

View File

@ -1,5 +1,5 @@
//@ check-pass
#![feature(inline_const)]
fn main() {
match true {
true => const {}

View File

@ -1,8 +1,6 @@
//@ check-pass
// issue: 114660
#![feature(inline_const)]
fn main() {
const { core::mem::transmute::<u8, u8> };
// Don't resolve the instance of this inline constant to be an intrinsic,

View File

@ -1,7 +1,5 @@
//@ check-pass
#![feature(inline_const)]
// This used to be unsupported since the parser first tries to check if we have
// any nested items, and then checks for statements (and expressions). The heuristic
// that we were using to detect the beginning of a const item was incorrect, so

View File

@ -1,4 +1,3 @@
#![feature(inline_const)]
#![allow(arithmetic_overflow, unconditional_panic)]
// The only way to have promoteds that fail is in `const fn` called from `const`/`static`.

View File

@ -1,5 +1,5 @@
error[E0716]: temporary value dropped while borrowed
--> $DIR/promotion.rs:17:37
--> $DIR/promotion.rs:16:37
|
LL | let _x: &'static i32 = &div_by_zero();
| ------------ ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use

View File

@ -1,6 +1,5 @@
//@ build-fail
//@ compile-flags: -Zmir-opt-level=3
#![feature(inline_const)]
fn foo<T>() {
if false {

View File

@ -1,13 +1,13 @@
error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
--> $DIR/required-const.rs:7:17
--> $DIR/required-const.rs:6:17
|
LL | const { panic!() }
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/required-const.rs:7:17
| ^^^^^^^^ the evaluated program panicked at 'explicit panic', $DIR/required-const.rs:6:17
|
= note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)
note: erroneous constant encountered
--> $DIR/required-const.rs:7:9
--> $DIR/required-const.rs:6:9
|
LL | const { panic!() }
| ^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,3 @@
#![feature(inline_const)]
struct S<'a>(&'a u8);
fn foo() {}

View File

@ -1,11 +1,11 @@
error[E0106]: missing lifetime specifier
--> $DIR/unusual-rib-combinations.rs:24:15
--> $DIR/unusual-rib-combinations.rs:22:15
|
LL | fn d<const C: S>() {}
| ^ expected named lifetime parameter
error[E0770]: the type of const parameters must not depend on other generic parameters
--> $DIR/unusual-rib-combinations.rs:29:22
--> $DIR/unusual-rib-combinations.rs:27:22
|
LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
| ^^ the type must not depend on the parameter `'a`
@ -13,25 +13,25 @@ LL | struct Bar<const N: &'a (dyn for<'a> Foo<'a>)>;
= note: lifetime parameters may not be used in the type of const parameters
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/unusual-rib-combinations.rs:7:16
--> $DIR/unusual-rib-combinations.rs:5:16
|
LL | fn a() -> [u8; foo::()] {
| ^^^^^^^ only `Fn` traits may use parentheses
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/unusual-rib-combinations.rs:14:15
--> $DIR/unusual-rib-combinations.rs:12:15
|
LL | fn b<const C: u8()>() {}
| ^^^^ only `Fn` traits may use parentheses
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/unusual-rib-combinations.rs:18:10
--> $DIR/unusual-rib-combinations.rs:16:10
|
LL | fn c<T = u8()>() {}
| ^^^^ only `Fn` traits may use parentheses
error: defaults for type parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/unusual-rib-combinations.rs:18:6
--> $DIR/unusual-rib-combinations.rs:16:6
|
LL | fn c<T = u8()>() {}
| ^^^^^^^^
@ -41,7 +41,7 @@ LL | fn c<T = u8()>() {}
= note: `#[deny(invalid_type_param_default)]` on by default
error[E0308]: mismatched types
--> $DIR/unusual-rib-combinations.rs:7:16
--> $DIR/unusual-rib-combinations.rs:5:16
|
LL | fn a() -> [u8; foo::()] {
| ^^^^^^^ expected `usize`, found fn item
@ -50,7 +50,7 @@ LL | fn a() -> [u8; foo::()] {
found fn item `fn() {foo}`
error: `S<'_>` is forbidden as the type of a const generic parameter
--> $DIR/unusual-rib-combinations.rs:24:15
--> $DIR/unusual-rib-combinations.rs:22:15
|
LL | fn d<const C: S>() {}
| ^

View File

@ -1,6 +1,5 @@
//@ check-pass
#![feature(inline_const)]
#![feature(concat_bytes)]
#![warn(invalid_from_utf8_unchecked)]

View File

@ -1,5 +1,5 @@
warning: calls to `std::str::from_utf8_unchecked_mut` with a invalid literal are undefined behavior
--> $DIR/invalid_from_utf8.rs:21:9
--> $DIR/invalid_from_utf8.rs:20:9
|
LL | std::str::from_utf8_unchecked_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
@ -7,13 +7,13 @@ LL | std::str::from_utf8_unchecked_mut(&mut [99, 108, 130, 105, 112, 112
| the literal was valid UTF-8 up to the 2 bytes
|
note: the lint level is defined here
--> $DIR/invalid_from_utf8.rs:6:9
--> $DIR/invalid_from_utf8.rs:5:9
|
LL | #![warn(invalid_from_utf8_unchecked)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8_unchecked_mut` with a invalid literal are undefined behavior
--> $DIR/invalid_from_utf8.rs:23:9
--> $DIR/invalid_from_utf8.rs:22:9
|
LL | std::str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
@ -21,7 +21,7 @@ LL | std::str::from_utf8_unchecked_mut(&mut [b'c', b'l', b'\x82', b'i',
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
--> $DIR/invalid_from_utf8.rs:41:9
--> $DIR/invalid_from_utf8.rs:40:9
|
LL | std::str::from_utf8_unchecked(&[99, 108, 130, 105, 112, 112, 121]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
@ -29,7 +29,7 @@ LL | std::str::from_utf8_unchecked(&[99, 108, 130, 105, 112, 112, 121]);
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
--> $DIR/invalid_from_utf8.rs:43:9
--> $DIR/invalid_from_utf8.rs:42:9
|
LL | std::str::from_utf8_unchecked(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
@ -37,7 +37,7 @@ LL | std::str::from_utf8_unchecked(&[b'c', b'l', b'\x82', b'i', b'p', b'
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
--> $DIR/invalid_from_utf8.rs:45:9
--> $DIR/invalid_from_utf8.rs:44:9
|
LL | std::str::from_utf8_unchecked(b"cl\x82ippy");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-------------^
@ -45,7 +45,7 @@ LL | std::str::from_utf8_unchecked(b"cl\x82ippy");
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8_unchecked` with a invalid literal are undefined behavior
--> $DIR/invalid_from_utf8.rs:47:9
--> $DIR/invalid_from_utf8.rs:46:9
|
LL | std::str::from_utf8_unchecked(concat_bytes!(b"cl", b"\x82ippy"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------^
@ -53,7 +53,7 @@ LL | std::str::from_utf8_unchecked(concat_bytes!(b"cl", b"\x82ippy"));
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:64:9
--> $DIR/invalid_from_utf8.rs:63:9
|
LL | std::str::from_utf8_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^----------------------------------^
@ -61,13 +61,13 @@ LL | std::str::from_utf8_mut(&mut [99, 108, 130, 105, 112, 112, 121]);
| the literal was valid UTF-8 up to the 2 bytes
|
note: the lint level is defined here
--> $DIR/invalid_from_utf8.rs:7:9
--> $DIR/invalid_from_utf8.rs:6:9
|
LL | #![warn(invalid_from_utf8)]
| ^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:66:9
--> $DIR/invalid_from_utf8.rs:65:9
|
LL | std::str::from_utf8_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
@ -75,7 +75,7 @@ LL | std::str::from_utf8_mut(&mut [b'c', b'l', b'\x82', b'i', b'p', b'p'
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:84:9
--> $DIR/invalid_from_utf8.rs:83:9
|
LL | std::str::from_utf8(&[99, 108, 130, 105, 112, 112, 121]);
| ^^^^^^^^^^^^^^^^^^^^^----------------------------------^
@ -83,7 +83,7 @@ LL | std::str::from_utf8(&[99, 108, 130, 105, 112, 112, 121]);
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:86:9
--> $DIR/invalid_from_utf8.rs:85:9
|
LL | std::str::from_utf8(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y']);
| ^^^^^^^^^^^^^^^^^^^^^---------------------------------------------^
@ -91,7 +91,7 @@ LL | std::str::from_utf8(&[b'c', b'l', b'\x82', b'i', b'p', b'p', b'y'])
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:88:9
--> $DIR/invalid_from_utf8.rs:87:9
|
LL | std::str::from_utf8(b"cl\x82ippy");
| ^^^^^^^^^^^^^^^^^^^^-------------^
@ -99,7 +99,7 @@ LL | std::str::from_utf8(b"cl\x82ippy");
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:90:9
--> $DIR/invalid_from_utf8.rs:89:9
|
LL | std::str::from_utf8(concat_bytes!(b"cl", b"\x82ippy"));
| ^^^^^^^^^^^^^^^^^^^^---------------------------------^
@ -107,7 +107,7 @@ LL | std::str::from_utf8(concat_bytes!(b"cl", b"\x82ippy"));
| the literal was valid UTF-8 up to the 2 bytes
warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:97:5
--> $DIR/invalid_from_utf8.rs:96:5
|
LL | let mut a = [99, 108, 130, 105, 112, 112, 121];
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@ -115,7 +115,7 @@ LL | std::str::from_utf8_mut(&mut a);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8_mut` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:101:5
--> $DIR/invalid_from_utf8.rs:100:5
|
LL | let mut a = [99, 108, 130, 105, 112, 112, 121];
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@ -124,7 +124,7 @@ LL | std::str::from_utf8_mut(c);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:104:5
--> $DIR/invalid_from_utf8.rs:103:5
|
LL | let mut c = &[99, 108, 130, 105, 112, 112, 121];
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@ -132,7 +132,7 @@ LL | std::str::from_utf8(c);
| ^^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:107:5
--> $DIR/invalid_from_utf8.rs:106:5
|
LL | const INVALID_1: [u8; 7] = [99, 108, 130, 105, 112, 112, 121];
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@ -140,7 +140,7 @@ LL | std::str::from_utf8(&INVALID_1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:110:5
--> $DIR/invalid_from_utf8.rs:109:5
|
LL | static INVALID_2: [u8; 7] = [99, 108, 130, 105, 112, 112, 121];
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@ -148,7 +148,7 @@ LL | std::str::from_utf8(&INVALID_2);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:113:5
--> $DIR/invalid_from_utf8.rs:112:5
|
LL | const INVALID_3: &'static [u8; 7] = &[99, 108, 130, 105, 112, 112, 121];
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes
@ -156,7 +156,7 @@ LL | std::str::from_utf8(INVALID_3);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: calls to `std::str::from_utf8` with a invalid literal always return an error
--> $DIR/invalid_from_utf8.rs:116:5
--> $DIR/invalid_from_utf8.rs:115:5
|
LL | const INVALID_4: &'static [u8; 7] = { &[99, 108, 130, 105, 112, 112, 121] };
| ---------------------------------- the literal was valid UTF-8 up to the 2 bytes

View File

@ -2,8 +2,6 @@
//@ edition:2021
//@ rustc-env:CARGO_CRATE_NAME=non_local_def
#![feature(inline_const)]
struct Test;
trait Uto {}

View File

@ -1,5 +1,5 @@
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:15:5
--> $DIR/consts.rs:13:5
|
LL | const Z: () = {
| - help: use a const-anon item to suppress this lint: `_`
@ -14,7 +14,7 @@ LL | impl Uto for &Test {}
= note: `#[warn(non_local_definitions)]` on by default
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:26:5
--> $DIR/consts.rs:24:5
|
LL | impl Uto2 for Test {}
| ^^^^^^^^^^^^^^^^^^^^^
@ -25,7 +25,7 @@ LL | impl Uto2 for Test {}
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:34:5
--> $DIR/consts.rs:32:5
|
LL | impl Uto3 for Test {}
| ^^^^^^^^^^^^^^^^^^^^^
@ -36,7 +36,7 @@ LL | impl Uto3 for Test {}
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:45:5
--> $DIR/consts.rs:43:5
|
LL | / impl Test {
LL | |
@ -50,7 +50,7 @@ LL | | }
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:52:9
--> $DIR/consts.rs:50:9
|
LL | / impl Test {
LL | |
@ -64,7 +64,7 @@ LL | | }
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:61:9
--> $DIR/consts.rs:59:9
|
LL | / impl Test {
LL | |
@ -78,7 +78,7 @@ LL | | }
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:74:9
--> $DIR/consts.rs:72:9
|
LL | impl Uto9 for Test {}
| ^^^^^^^^^^^^^^^^^^^^^
@ -89,7 +89,7 @@ LL | impl Uto9 for Test {}
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/consts.rs:81:9
--> $DIR/consts.rs:79:9
|
LL | impl Uto10 for Test {}
| ^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,8 +1,6 @@
//@ check-pass
//@ edition:2021
#![feature(inline_const)]
struct Cat;
struct Wrap<T>(T);

View File

@ -1,5 +1,5 @@
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/from-local-for-global.rs:10:5
--> $DIR/from-local-for-global.rs:8:5
|
LL | / impl From<Cat> for () {
LL | |
@ -16,7 +16,7 @@ LL | | }
= note: `#[warn(non_local_definitions)]` on by default
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/from-local-for-global.rs:20:5
--> $DIR/from-local-for-global.rs:18:5
|
LL | / impl From<Wrap<Wrap<Elephant>>> for () {
LL | |
@ -32,7 +32,7 @@ LL | | }
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/from-local-for-global.rs:34:5
--> $DIR/from-local-for-global.rs:32:5
|
LL | impl StillNonLocal for &Foo {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -43,7 +43,7 @@ LL | impl StillNonLocal for &Foo {}
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/from-local-for-global.rs:42:5
--> $DIR/from-local-for-global.rs:40:5
|
LL | / impl From<Local1> for GlobalSameFunction {
LL | |
@ -59,7 +59,7 @@ LL | | }
= note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <https://github.com/rust-lang/rust/issues/120363>
warning: non-local `impl` definition, they should be avoided as they go against expectation
--> $DIR/from-local-for-global.rs:50:5
--> $DIR/from-local-for-global.rs:48:5
|
LL | / impl From<Local2> for GlobalSameFunction {
LL | |

View File

@ -1,7 +1,5 @@
//@ edition:2021
#![feature(inline_const)]
fn closure() {
loop {
let closure = || {

View File

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/dont-suggest-break-thru-item.rs:9:17
--> $DIR/dont-suggest-break-thru-item.rs:7:17
|
LL | / if true {
LL | | Err(1)
@ -17,7 +17,7 @@ LL | return Err(1);
| ++++++ +
error[E0308]: mismatched types
--> $DIR/dont-suggest-break-thru-item.rs:23:17
--> $DIR/dont-suggest-break-thru-item.rs:21:17
|
LL | / if true {
LL | | Err(1)
@ -35,7 +35,7 @@ LL | return Err(1);
| ++++++ +
error[E0308]: mismatched types
--> $DIR/dont-suggest-break-thru-item.rs:37:17
--> $DIR/dont-suggest-break-thru-item.rs:35:17
|
LL | / if true {
LL | | Err(1)
@ -48,7 +48,7 @@ LL | | }
found enum `Result<_, {integer}>`
error[E0308]: mismatched types
--> $DIR/dont-suggest-break-thru-item.rs:49:17
--> $DIR/dont-suggest-break-thru-item.rs:47:17
|
LL | / if true {
LL | | Err(1)

View File

@ -1,4 +1,3 @@
#![feature(inline_const)]
#![feature(yeet_expr)]
#![allow(incomplete_features)] // Necessary for now, while explicit_tail_calls is incomplete
#![feature(explicit_tail_calls)]

View File

@ -1,5 +1,5 @@
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:10:5
--> $DIR/bad-let-else-statement.rs:9:5
|
LL | } else {
| ^
@ -13,7 +13,7 @@ LL ~ }) else {
|
error: `for...else` loops are not supported
--> $DIR/bad-let-else-statement.rs:19:7
--> $DIR/bad-let-else-statement.rs:18:7
|
LL | let foo = for i in 1..2 {
| --- `else` is attached to this loop
@ -28,7 +28,7 @@ LL | | };
= note: consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:31:5
--> $DIR/bad-let-else-statement.rs:30:5
|
LL | } else {
| ^
@ -43,7 +43,7 @@ LL ~ }) else {
|
error: `loop...else` loops are not supported
--> $DIR/bad-let-else-statement.rs:40:7
--> $DIR/bad-let-else-statement.rs:39:7
|
LL | let foo = loop {
| ---- `else` is attached to this loop
@ -58,7 +58,7 @@ LL | | };
= note: consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:51:5
--> $DIR/bad-let-else-statement.rs:50:5
|
LL | } else {
| ^
@ -73,7 +73,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:62:5
--> $DIR/bad-let-else-statement.rs:61:5
|
LL | } else {
| ^
@ -87,7 +87,7 @@ LL ~ }) else {
|
error: `while...else` loops are not supported
--> $DIR/bad-let-else-statement.rs:71:7
--> $DIR/bad-let-else-statement.rs:70:7
|
LL | let foo = while false {
| ----- `else` is attached to this loop
@ -102,7 +102,7 @@ LL | | };
= note: consider moving this `else` clause to a separate `if` statement and use a `bool` variable to control if it should run
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:81:5
--> $DIR/bad-let-else-statement.rs:80:5
|
LL | } else {
| ^
@ -116,7 +116,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:91:5
--> $DIR/bad-let-else-statement.rs:90:5
|
LL | } else {
| ^
@ -130,7 +130,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:102:5
--> $DIR/bad-let-else-statement.rs:101:5
|
LL | } else {
| ^
@ -144,7 +144,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:112:5
--> $DIR/bad-let-else-statement.rs:111:5
|
LL | } else {
| ^
@ -158,7 +158,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:122:5
--> $DIR/bad-let-else-statement.rs:121:5
|
LL | } else {
| ^
@ -172,7 +172,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:132:5
--> $DIR/bad-let-else-statement.rs:131:5
|
LL | } else {
| ^
@ -186,7 +186,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:142:5
--> $DIR/bad-let-else-statement.rs:141:5
|
LL | } else {
| ^
@ -200,7 +200,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:152:5
--> $DIR/bad-let-else-statement.rs:151:5
|
LL | } else {
| ^
@ -214,7 +214,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:162:5
--> $DIR/bad-let-else-statement.rs:161:5
|
LL | } else {
| ^
@ -228,7 +228,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:172:5
--> $DIR/bad-let-else-statement.rs:171:5
|
LL | } else {
| ^
@ -242,7 +242,7 @@ LL ~ }) else {
|
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:182:31
--> $DIR/bad-let-else-statement.rs:181:31
|
LL | let bad = format_args! {""} else { return; };
| ^
@ -253,7 +253,7 @@ LL | let bad = format_args! ("") else { return; };
| ~ ~
error: right curly brace `}` before `else` in a `let...else` statement not allowed
--> $DIR/bad-let-else-statement.rs:199:25
--> $DIR/bad-let-else-statement.rs:198:25
|
LL | let x = a! {} else { return; };
| ^
@ -268,7 +268,7 @@ LL | let x = a! () else { return; };
| ~~
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:7:5
--> $DIR/bad-let-else-statement.rs:6:5
|
LL | / let foo = {
LL | |
@ -281,7 +281,7 @@ LL | | } else {
= note: `#[warn(irrefutable_let_patterns)]` on by default
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:26:5
--> $DIR/bad-let-else-statement.rs:25:5
|
LL | / let foo = if true {
LL | |
@ -295,7 +295,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:47:5
--> $DIR/bad-let-else-statement.rs:46:5
|
LL | / let foo = match true {
LL | |
@ -308,7 +308,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:59:5
--> $DIR/bad-let-else-statement.rs:58:5
|
LL | / let foo = X {
LL | |
@ -320,7 +320,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:78:5
--> $DIR/bad-let-else-statement.rs:77:5
|
LL | / let foo = const {
LL | |
@ -332,7 +332,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:88:5
--> $DIR/bad-let-else-statement.rs:87:5
|
LL | / let foo = &{
LL | |
@ -344,7 +344,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:99:5
--> $DIR/bad-let-else-statement.rs:98:5
|
LL | / let foo = bar = {
LL | |
@ -356,7 +356,7 @@ LL | | } else {
= help: consider removing the `else` clause
error[E0384]: cannot assign twice to immutable variable `bar`
--> $DIR/bad-let-else-statement.rs:99:15
--> $DIR/bad-let-else-statement.rs:98:15
|
LL | let bar = 0;
| ---
@ -371,7 +371,7 @@ LL | | } else {
| |_____^ cannot assign twice to immutable variable
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:109:5
--> $DIR/bad-let-else-statement.rs:108:5
|
LL | / let foo = 1 + {
LL | |
@ -383,7 +383,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:119:5
--> $DIR/bad-let-else-statement.rs:118:5
|
LL | / let foo = 1..{
LL | |
@ -395,7 +395,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:129:5
--> $DIR/bad-let-else-statement.rs:128:5
|
LL | / let foo = return {
LL | |
@ -407,7 +407,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:139:5
--> $DIR/bad-let-else-statement.rs:138:5
|
LL | / let foo = -{
LL | |
@ -419,7 +419,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:149:5
--> $DIR/bad-let-else-statement.rs:148:5
|
LL | / let foo = do yeet {
LL | |
@ -431,7 +431,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:159:5
--> $DIR/bad-let-else-statement.rs:158:5
|
LL | / let foo = become {
LL | |
@ -443,7 +443,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:169:5
--> $DIR/bad-let-else-statement.rs:168:5
|
LL | / let foo = |x: i32| {
LL | |
@ -455,7 +455,7 @@ LL | | } else {
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:179:5
--> $DIR/bad-let-else-statement.rs:178:5
|
LL | let ok = format_args!("") else { return; };
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -464,7 +464,7 @@ LL | let ok = format_args!("") else { return; };
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:182:5
--> $DIR/bad-let-else-statement.rs:181:5
|
LL | let bad = format_args! {""} else { return; };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -473,7 +473,7 @@ LL | let bad = format_args! {""} else { return; };
= help: consider removing the `else` clause
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:189:19
--> $DIR/bad-let-else-statement.rs:188:19
|
LL | () => { {} }
| ___________________^
@ -493,7 +493,7 @@ LL | b!(1); b!(2);
= note: this warning originates in the macro `b` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: irrefutable `let...else` pattern
--> $DIR/bad-let-else-statement.rs:189:19
--> $DIR/bad-let-else-statement.rs:188:19
|
LL | () => { {} }
| ___________________^

View File

@ -5,7 +5,7 @@
#![feature(generic_arg_infer)]
#![feature(core_intrinsics)]
#![feature(repr_simd)]
#![feature(inline_const)]
use std::intrinsics::simd::*;
#[repr(simd)]

View File

@ -2,7 +2,6 @@
//@ ignore-emscripten FIXME(#45351) hits an LLVM assert
#![feature(repr_simd, intrinsics)]
#![feature(inline_const)]
#[repr(simd)]
#[derive(Copy, Clone, Debug, PartialEq)]