mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Update tests
This commit is contained in:
parent
5e695bbba1
commit
a79e08ca2a
@ -3,7 +3,7 @@ use rustc_hir::def_id::{DefId, LocalDefId};
|
|||||||
use rustc_middle::hir::map::blocks::FnLikeNode;
|
use rustc_middle::hir::map::blocks::FnLikeNode;
|
||||||
use rustc_middle::ty::query::Providers;
|
use rustc_middle::ty::query::Providers;
|
||||||
use rustc_middle::ty::TyCtxt;
|
use rustc_middle::ty::TyCtxt;
|
||||||
use rustc_span::symbol::{sym, Symbol};
|
use rustc_span::symbol::Symbol;
|
||||||
use rustc_target::spec::abi::Abi;
|
use rustc_target::spec::abi::Abi;
|
||||||
|
|
||||||
/// Whether the `def_id` counts as const fn in your current crate, considering all active
|
/// Whether the `def_id` counts as const fn in your current crate, considering all active
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
// check-pass
|
|
||||||
// TODO remove this^
|
|
||||||
|
|
||||||
#![feature(const_trait_impl)]
|
#![feature(const_trait_impl)]
|
||||||
#![feature(const_fn_trait_bound)] // FIXME is this needed?
|
#![feature(const_fn_trait_bound)] // FIXME is this needed?
|
||||||
#![allow(incomplete_features)]
|
#![allow(incomplete_features)]
|
||||||
@ -27,7 +24,7 @@ impl const ConstDefaultFn for ConstImpl {
|
|||||||
|
|
||||||
const fn test() {
|
const fn test() {
|
||||||
NonConstImpl.a();
|
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();
|
ConstImpl.a();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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`.
|
Loading…
Reference in New Issue
Block a user