Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 8fc8358

Browse files
committed
Update tests after feature stabilization
1 parent 7723506 commit 8fc8358

File tree

86 files changed

+107
-718
lines changed

Some content is hidden

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

86 files changed

+107
-718
lines changed

compiler/rustc_const_eval/src/transform/check_consts/check.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -359,22 +359,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
359359
match *ty.kind() {
360360
ty::Ref(_, _, hir::Mutability::Mut) => self.check_op(ops::ty::MutRef(kind)),
361361
ty::Opaque(..) => self.check_op(ops::ty::ImplTrait),
362-
363-
ty::Dynamic(preds, _) => {
364-
for pred in preds.iter() {
365-
match pred.skip_binder() {
366-
ty::ExistentialPredicate::AutoTrait(_)
367-
| ty::ExistentialPredicate::Projection(_) => {
368-
self.check_op(ops::ty::DynTrait(kind))
369-
}
370-
ty::ExistentialPredicate::Trait(trait_ref) => {
371-
if Some(trait_ref.def_id) != self.tcx.lang_items().sized_trait() {
372-
self.check_op(ops::ty::DynTrait(kind))
373-
}
374-
}
375-
}
376-
}
377-
}
378362
_ => {}
379363
}
380364
}

compiler/rustc_const_eval/src/transform/check_consts/ops.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -817,49 +817,6 @@ pub mod ty {
817817
}
818818
}
819819

820-
#[derive(Debug)]
821-
pub struct DynTrait(pub mir::LocalKind);
822-
impl<'tcx> NonConstOp<'tcx> for DynTrait {
823-
fn importance(&self) -> DiagnosticImportance {
824-
match self.0 {
825-
mir::LocalKind::Var | mir::LocalKind::Temp => DiagnosticImportance::Secondary,
826-
mir::LocalKind::ReturnPointer | mir::LocalKind::Arg => {
827-
DiagnosticImportance::Primary
828-
}
829-
}
830-
}
831-
832-
fn status_in_item(&self, ccx: &ConstCx<'_, 'tcx>) -> Status {
833-
if ccx.const_kind() != hir::ConstContext::ConstFn {
834-
Status::Allowed
835-
} else {
836-
Status::Unstable(sym::const_fn_trait_bound)
837-
}
838-
}
839-
840-
fn build_error(
841-
&self,
842-
ccx: &ConstCx<'_, 'tcx>,
843-
span: Span,
844-
) -> DiagnosticBuilder<'tcx, ErrorGuaranteed> {
845-
let mut err = feature_err(
846-
&ccx.tcx.sess.parse_sess,
847-
sym::const_fn_trait_bound,
848-
span,
849-
"trait objects in const fn are unstable",
850-
);
851-
852-
match ccx.fn_sig() {
853-
Some(fn_sig) if !fn_sig.span.contains(span) => {
854-
err.span_label(fn_sig.span, "function declared as const here");
855-
}
856-
_ => {}
857-
}
858-
859-
err
860-
}
861-
}
862-
863820
/// A trait bound with the `?const Trait` opt-out
864821
#[derive(Debug)]
865822
pub struct TraitBoundNotConst;

src/test/ui/borrowck/issue-88434-minimal-example.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(const_fn_trait_bound)]
21
// Regression test related to issue 88434
32

43
const _CONST: &() = &f(&|_| {});

src/test/ui/borrowck/issue-88434-minimal-example.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/issue-88434-minimal-example.rs:10:5
2+
--> $DIR/issue-88434-minimal-example.rs:9:5
33
|
44
LL | const _CONST: &() = &f(&|_| {});
5-
| ---------- inside `_CONST` at $DIR/issue-88434-minimal-example.rs:4:22
5+
| ---------- inside `_CONST` at $DIR/issue-88434-minimal-example.rs:3:22
66
...
77
LL | panic!()
88
| ^^^^^^^^
99
| |
10-
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:10:5
11-
| inside `f::<[closure@$DIR/issue-88434-minimal-example.rs:4:25: 4:31]>` at $SRC_DIR/std/src/panic.rs:LL:COL
10+
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-minimal-example.rs:9:5
11+
| inside `f::<[closure@$DIR/issue-88434-minimal-example.rs:3:25: 3:31]>` at $SRC_DIR/std/src/panic.rs:LL:COL
1212
|
1313
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
1414

src/test/ui/borrowck/issue-88434-removal-index-should-be-less.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(const_fn_trait_bound)]
21
// Regression test for issue 88434
32

43
const _CONST: &[u8] = &f(&[], |_| {});

src/test/ui/borrowck/issue-88434-removal-index-should-be-less.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
error[E0080]: evaluation of constant value failed
2-
--> $DIR/issue-88434-removal-index-should-be-less.rs:10:5
2+
--> $DIR/issue-88434-removal-index-should-be-less.rs:9:5
33
|
44
LL | const _CONST: &[u8] = &f(&[], |_| {});
5-
| -------------- inside `_CONST` at $DIR/issue-88434-removal-index-should-be-less.rs:4:24
5+
| -------------- inside `_CONST` at $DIR/issue-88434-removal-index-should-be-less.rs:3:24
66
...
77
LL | panic!()
88
| ^^^^^^^^
99
| |
10-
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:10:5
11-
| inside `f::<[closure@$DIR/issue-88434-removal-index-should-be-less.rs:4:31: 4:37]>` at $SRC_DIR/std/src/panic.rs:LL:COL
10+
| the evaluated program panicked at 'explicit panic', $DIR/issue-88434-removal-index-should-be-less.rs:9:5
11+
| inside `f::<[closure@$DIR/issue-88434-removal-index-should-be-less.rs:3:31: 3:37]>` at $SRC_DIR/std/src/panic.rs:LL:COL
1212
|
1313
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
1414

src/test/ui/const-generics/generic_const_exprs/issue-85848.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_fn_trait_bound, generic_const_exprs)]
1+
#![feature(generic_const_exprs)]
22
#![allow(incomplete_features)]
33

44
trait _Contains<T> {

src/test/ui/const-generics/issues/issue-79674.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![feature(const_fn_trait_bound, generic_const_exprs)]
1+
#![feature(generic_const_exprs)]
22
#![allow(incomplete_features)]
33

44
trait MiniTypeId {

src/test/ui/consts/auxiliary/const_fn_lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Crate that exports a const fn. Used for testing cross-crate.
22

3-
#![feature(const_fn_fn_ptr_basics)]
43
#![crate_type="rlib"]
54

65
pub const fn foo() -> usize { 22 }

src/test/ui/consts/const-block-const-bound.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![allow(unused)]
2-
#![feature(const_fn_trait_bound, const_trait_impl, inline_const, negative_impls)]
2+
#![feature(const_trait_impl, inline_const, negative_impls)]
33

44
const fn f<T: ~const Drop>(x: T) {}
55

0 commit comments

Comments
 (0)