Use revisions for cross-crate test
This commit is contained in:
parent
c424510746
commit
b3a79832c0
@ -1,18 +0,0 @@
|
||||
// aux-build: cross-crate.rs
|
||||
extern crate cross_crate;
|
||||
|
||||
use cross_crate::*;
|
||||
|
||||
fn non_const_context() {
|
||||
NonConst.func();
|
||||
Const.func();
|
||||
}
|
||||
|
||||
const fn const_context() {
|
||||
NonConst.func();
|
||||
//~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
Const.func();
|
||||
//~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
}
|
||||
|
||||
fn main() {}
|
@ -1,5 +1,5 @@
|
||||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
--> $DIR/cross-crate-feature-enabled.rs:15:5
|
||||
--> $DIR/cross-crate.rs:16:5
|
||||
|
|
||||
LL | NonConst.func();
|
||||
| ^^^^^^^^^^^^^^^
|
@ -1,4 +1,5 @@
|
||||
#![feature(const_trait_impl)]
|
||||
// revisions: stock gated
|
||||
#![cfg_attr(gated, feature(const_trait_impl))]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
// aux-build: cross-crate.rs
|
||||
@ -15,6 +16,7 @@ const fn const_context() {
|
||||
NonConst.func();
|
||||
//~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
Const.func();
|
||||
//[stock]~^ ERROR: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
}
|
||||
|
||||
fn main() {}
|
@ -1,11 +1,11 @@
|
||||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
--> $DIR/cross-crate-feature-disabled.rs:12:5
|
||||
--> $DIR/cross-crate.rs:16:5
|
||||
|
|
||||
LL | NonConst.func();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0015]: calls in constant functions are limited to constant functions, tuple structs and tuple variants
|
||||
--> $DIR/cross-crate-feature-disabled.rs:14:5
|
||||
--> $DIR/cross-crate.rs:18:5
|
||||
|
|
||||
LL | Const.func();
|
||||
| ^^^^^^^^^^^^
|
Loading…
x
Reference in New Issue
Block a user