Use revisions for cross-crate test

This commit is contained in:
Deadbeef 2021-07-01 17:24:45 +08:00
parent c424510746
commit b3a79832c0
No known key found for this signature in database
GPG Key ID: 6525773485376D92
4 changed files with 6 additions and 22 deletions

View File

@ -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() {}

View File

@ -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();
| ^^^^^^^^^^^^^^^

View File

@ -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() {}

View File

@ -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();
| ^^^^^^^^^^^^