Update tests

This commit is contained in:
Deadbeef 2021-07-10 15:17:09 +08:00
parent 5e695bbba1
commit a79e08ca2a
No known key found for this signature in database
GPG Key ID: 6525773485376D92
3 changed files with 11 additions and 5 deletions

View File

@ -3,7 +3,7 @@ use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_middle::hir::map::blocks::FnLikeNode;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::symbol::Symbol;
use rustc_target::spec::abi::Abi;
/// Whether the `def_id` counts as const fn in your current crate, considering all active

View File

@ -1,6 +1,3 @@
// check-pass
// TODO remove this^
#![feature(const_trait_impl)]
#![feature(const_fn_trait_bound)] // FIXME is this needed?
#![allow(incomplete_features)]
@ -27,7 +24,7 @@ impl const ConstDefaultFn for ConstImpl {
const fn test() {
NonConstImpl.a();
// TODO ~^ ERROR calls in constant functions are limited to constant functions, tuple structs and tuple variants
//~^ ERROR calls in constant functions are limited to constant functions, tuple structs and tuple variants
ConstImpl.a();
}

View File

@ -0,0 +1,9 @@
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
--> $DIR/const-default-method-bodies.rs:26:5
|
LL | NonConstImpl.a();
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0015`.