Skip to content

Commit cfee72a

Browse files
committed
Fix tests and bless
1 parent 94c1920 commit cfee72a

File tree

64 files changed

+117
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+117
-171
lines changed

tests/codegen/const_scalar_pair.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ compile-flags: --crate-type=lib -Copt-level=0 -Zmir-opt-level=0 -C debuginfo=2
22

3-
#![feature(inline_const)]
4-
53
// Test that we don't generate a memory allocation for the constant
64
// and read the fields from that, but instead just create the value pair directly.
75
pub fn foo() -> (i32, i32) {

tests/codegen/intrinsics/transmute.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![crate_type = "lib"]
55
#![feature(core_intrinsics)]
66
#![feature(custom_mir)]
7-
#![feature(inline_const)]
87
#![allow(unreachable_code)]
98

109
use std::intrinsics::{transmute, transmute_unchecked};

tests/codegen/issues/issue-96274.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ compile-flags: -O
22

33
#![crate_type = "lib"]
4-
#![feature(inline_const)]
54

65
use std::mem::MaybeUninit;
76

tests/codegen/sanitizer/cfi/emit-type-metadata-id-itanium-cxx-abi-paths.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//@ compile-flags: -Clto -Cno-prepopulate-passes -Copt-level=0 -Zsanitizer=cfi -Ctarget-feature=-crt-static
66

77
#![crate_type="lib"]
8-
#![feature(inline_const, type_alias_impl_trait)]
8+
#![feature(type_alias_impl_trait)]
99

1010
extern crate core;
1111

tests/codegen/simd-intrinsic/simd-intrinsic-transmute-array.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#![crate_type = "lib"]
55
#![allow(non_camel_case_types)]
66
#![feature(repr_simd, intrinsics)]
7-
#![feature(inline_const)]
87

98
#[repr(simd)]
109
#[derive(Copy, Clone)]

tests/mir-opt/building/custom/arrays.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// skip-filecheck
2-
#![feature(custom_mir, core_intrinsics, inline_const)]
2+
#![feature(custom_mir, core_intrinsics)]
33

44
extern crate core;
55
use core::intrinsics::mir::*;

tests/mir-opt/building/custom/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// skip-filecheck
2-
#![feature(custom_mir, core_intrinsics, inline_const)]
2+
#![feature(custom_mir, core_intrinsics)]
33

44
extern crate core;
55
use core::intrinsics::mir::*;

tests/mir-opt/building/custom/operators.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// skip-filecheck
22
//@ compile-flags: --crate-type=lib
3-
#![feature(custom_mir, core_intrinsics, inline_const)]
3+
#![feature(custom_mir, core_intrinsics)]
44
use std::intrinsics::mir::*;
55

66
// EMIT_MIR operators.f.built.after.mir

tests/mir-opt/const_prop/invalid_constant.rs

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
// Verify that we can pretty print invalid constants.
55

66
#![feature(adt_const_params)]
7-
#![feature(inline_const)]
87
#![allow(incomplete_features)]
98

109
#[derive(Copy, Clone)]

tests/pretty/stmt_expr_attributes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ pp-exact
22

3-
#![feature(inline_const)]
43
#![feature(inline_const_pat)]
54
#![feature(rustc_attrs)]
65
#![feature(stmt_expr_attributes)]

tests/ui/const-generics/generic_const_exprs/const-block-is-poly.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(inline_const, generic_const_exprs)]
1+
#![feature(generic_const_exprs)]
22
//~^ WARN the feature `generic_const_exprs` is incomplete
33

44
fn foo<T>() {

tests/ui/const-generics/generic_const_exprs/const-block-is-poly.stderr

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

tests/ui/const-generics/generic_const_exprs/const_kind_expr/relate_ty_with_infer_2.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
#![feature(inline_const, generic_const_exprs)]
2+
#![feature(generic_const_exprs)]
33
#![allow(incomplete_features)]
44
use std::marker::PhantomData;
55

tests/ui/const-generics/generic_const_exprs/inline-const-in-const-generic-defaults.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ check-pass
22

33
#![feature(generic_const_exprs)]
4-
#![feature(inline_const)]
54
#![allow(incomplete_features)]
65

76
pub struct ConstDefaultUnstable<const N: usize = { const { 3 } }>;

tests/ui/const_prop/dont-propagate-generic-instance-2.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ run-pass
22

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

tests/ui/consts/closure-structural-match-issue-90013.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Regression test for issue 90013.
22
//@ check-pass
3-
#![feature(inline_const)]
43

54
fn main() {
65
const { || {} };

tests/ui/consts/const-block-const-bound.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ known-bug: #103507
22

33
#![allow(unused)]
4-
#![feature(const_trait_impl, inline_const, negative_impls)]
4+
#![feature(const_trait_impl, negative_impls)]
55

66
use std::marker::Destruct;
77

tests/ui/consts/const-blocks/fn-call-in-const.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//@ run-pass
22

3-
#![feature(inline_const)]
43
#![allow(unused)]
54

65
// Some type that is not copyable.

tests/ui/consts/const-eval/heap/alloc_intrinsic_zero_sized.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ run-pass
22
#![feature(core_intrinsics)]
33
#![feature(const_heap)]
4-
#![feature(inline_const)]
54

65
use std::intrinsics;
76

tests/ui/consts/const-eval/heap/dealloc_intrinsic_zero_sized.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ run-pass
22
#![feature(core_intrinsics)]
33
#![feature(const_heap)]
4-
#![feature(inline_const)]
54

65
use std::intrinsics;
76

tests/ui/consts/issue-102117.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(inline_const, const_type_id)]
1+
#![feature(const_type_id)]
22

33
use std::alloc::Layout;
44
use std::any::TypeId;

tests/ui/impl-trait/normalize-tait-in-const.rs

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#![feature(type_alias_impl_trait)]
44
#![feature(const_trait_impl)]
55
#![feature(const_refs_to_cell)]
6-
#![feature(inline_const)]
76

87
use std::marker::Destruct;
98

tests/ui/impl-trait/normalize-tait-in-const.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error: `~const` can only be applied to `#[const_trait]` traits
2-
--> $DIR/normalize-tait-in-const.rs:25:42
2+
--> $DIR/normalize-tait-in-const.rs:24:42
33
|
44
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
55
| ^^^^^^^^^^^^^^^^^
66

77
error[E0015]: cannot call non-const closure in constant functions
8-
--> $DIR/normalize-tait-in-const.rs:26:5
8+
--> $DIR/normalize-tait-in-const.rs:25:5
99
|
1010
LL | fun(filter_positive());
1111
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -21,7 +21,7 @@ LL + #![feature(effects)]
2121
|
2222

2323
error[E0493]: destructor of `F` cannot be evaluated at compile-time
24-
--> $DIR/normalize-tait-in-const.rs:25:79
24+
--> $DIR/normalize-tait-in-const.rs:24:79
2525
|
2626
LL | const fn with_positive<F: ~const for<'a> Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
2727
| ^^^ the destructor for this type cannot be evaluated in constant functions

tests/ui/inline-const/const-expr-array-init.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ build-pass
22

3-
#![feature(inline_const)]
4-
53
use std::cell::Cell;
64

75
fn main() {

tests/ui/inline-const/const-expr-basic.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ run-pass
22

3-
#![feature(inline_const)]
4-
53
fn foo() -> i32 {
64
const {
75
let x = 5 + 10;

tests/ui/inline-const/const-expr-generic-err.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ build-fail
2-
#![feature(inline_const)]
32

43
fn foo<T>() {
54
const { assert!(std::mem::size_of::<T>() == 0); } //~ ERROR E0080

tests/ui/inline-const/const-expr-generic-err.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
error[E0080]: evaluation of `foo::<i32>::{constant#0}` failed
2-
--> $DIR/const-expr-generic-err.rs:5:13
2+
--> $DIR/const-expr-generic-err.rs:4:13
33
|
44
LL | const { assert!(std::mem::size_of::<T>() == 0); }
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/const-expr-generic-err.rs:5:13
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the evaluated program panicked at 'assertion failed: std::mem::size_of::<T>() == 0', $DIR/const-expr-generic-err.rs:4:13
66
|
77
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
88

99
note: erroneous constant encountered
10-
--> $DIR/const-expr-generic-err.rs:5:5
10+
--> $DIR/const-expr-generic-err.rs:4:5
1111
|
1212
LL | const { assert!(std::mem::size_of::<T>() == 0); }
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1414

1515
note: the above error was encountered while instantiating `fn foo::<i32>`
16-
--> $DIR/const-expr-generic-err.rs:13:5
16+
--> $DIR/const-expr-generic-err.rs:12:5
1717
|
1818
LL | foo::<i32>();
1919
| ^^^^^^^^^^^^
2020

2121
error[E0080]: evaluation of `bar::<0>::{constant#0}` failed
22-
--> $DIR/const-expr-generic-err.rs:9:13
22+
--> $DIR/const-expr-generic-err.rs:8:13
2323
|
2424
LL | const { N - 1 }
2525
| ^^^^^ attempt to compute `0_usize - 1_usize`, which would overflow
2626

2727
note: erroneous constant encountered
28-
--> $DIR/const-expr-generic-err.rs:9:5
28+
--> $DIR/const-expr-generic-err.rs:8:5
2929
|
3030
LL | const { N - 1 }
3131
| ^^^^^^^^^^^^^^^
3232

3333
note: erroneous constant encountered
34-
--> $DIR/const-expr-generic-err.rs:9:5
34+
--> $DIR/const-expr-generic-err.rs:8:5
3535
|
3636
LL | const { N - 1 }
3737
| ^^^^^^^^^^^^^^^
3838
|
3939
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4040

4141
note: the above error was encountered while instantiating `fn bar::<0>`
42-
--> $DIR/const-expr-generic-err.rs:14:5
42+
--> $DIR/const-expr-generic-err.rs:13:5
4343
|
4444
LL | bar::<0>();
4545
| ^^^^^^^^^^

tests/ui/inline-const/const-expr-generic-err2.rs

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

tests/ui/inline-const/const-expr-generic-err2.stderr

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

tests/ui/inline-const/const-expr-generic.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ check-pass
2-
#![feature(inline_const)]
32

43
fn foo<T>() -> usize {
54
const { std::mem::size_of::<T>() }

tests/ui/inline-const/const-expr-inference.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ check-pass
22

3-
#![feature(inline_const)]
4-
53
pub fn todo<T>() -> T {
64
const { todo!() }
75
}

tests/ui/inline-const/const-expr-lifetime-err.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#![feature(const_mut_refs)]
2-
#![feature(inline_const)]
32

43
use std::marker::PhantomData;
54

tests/ui/inline-const/const-expr-lifetime-err.stderr

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

tests/ui/inline-const/const-expr-lifetime.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ run-pass
22

33
#![feature(const_mut_refs)]
4-
#![feature(inline_const)]
54

65
use std::marker::PhantomData;
76

tests/ui/inline-const/const-expr-macro.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ run-pass
22

3-
#![feature(inline_const)]
4-
53
macro_rules! do_const_block{
64
($val:block) => { const $val }
75
}

tests/ui/inline-const/const-expr-reference.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ run-pass
22

3-
#![feature(inline_const)]
4-
53
const fn bar() -> i32 {
64
const {
75
2 + 3

tests/ui/inline-const/const-match-pat-lifetime.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
//@ run-pass
22

33
#![feature(const_mut_refs)]
4-
#![feature(inline_const)]
54
#![feature(inline_const_pat)]
65

76
use std::marker::PhantomData;

tests/ui/inline-const/elided-lifetime-being-infer-vars.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//@ check-pass
22

3-
#![feature(inline_const)]
4-
53
fn main() {
64
let _my_usize = const {
75
let a = 10_usize;

tests/ui/inline-const/expr-unsafe-err.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(inline_const)]
21
const unsafe fn require_unsafe() -> usize {
32
1
43
}

tests/ui/inline-const/expr-unsafe-err.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0133]: call to unsafe function `require_unsafe` is unsafe and requires unsafe function or block
2-
--> $DIR/expr-unsafe-err.rs:8:9
2+
--> $DIR/expr-unsafe-err.rs:7:9
33
|
44
LL | require_unsafe();
55
| ^^^^^^^^^^^^^^^^ call to unsafe function

tests/ui/inline-const/expr-unsafe.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ check-pass
22

33
#![warn(unused_unsafe)]
4-
#![feature(inline_const)]
4+
55
const unsafe fn require_unsafe() -> usize { 1 }
66

77
fn main() {

tests/ui/inline-const/expr-with-block-err.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(inline_const)]
2-
31
fn main() {
42
const { 2 } - const { 1 };
53
//~^ ERROR mismatched types

tests/ui/inline-const/expr-with-block-err.stderr

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

tests/ui/inline-const/expr-with-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ check-pass
2-
#![feature(inline_const)]
2+
33
fn main() {
44
match true {
55
true => const {}

0 commit comments

Comments
 (0)