Skip to content

Commit 2aec0ab

Browse files
committed
Combine some tests
1 parent fbc9884 commit 2aec0ab

File tree

4 files changed

+10
-66
lines changed

4 files changed

+10
-66
lines changed

tests/ui/internal/unstable-impl-cannot-use-feature.stderr renamed to tests/ui/internal/unstable-impl-cannot-use-feature.fail.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0284]: type annotations needed: cannot satisfy `unstable feature: `feat_foo``
2-
--> $DIR/unstable-impl-cannot-use-feature.rs:23:5
2+
--> $DIR/unstable-impl-cannot-use-feature.rs:26:5
33
|
44
LL | Bar::foo();
55
| ^^^ cannot satisfy `unstable feature: `feat_foo``
66
|
77
note: required for `Bar` to implement `Foo`
8-
--> $DIR/unstable-impl-cannot-use-feature.rs:18:6
8+
--> $DIR/unstable-impl-cannot-use-feature.rs:20:6
99
|
1010
LL | #[unstable_feature_bound(feat_foo)]
1111
| ----------------------------------- unsatisfied trait bound introduced here
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1+
//@ revisions: pass fail
2+
//@[pass] check-pass
3+
14
#![allow(internal_features)]
25
#![feature(staged_api)]
36
#![feature(impl_stability)]
47
#![allow(dead_code)]
5-
#![feature(feat_foo)]
8+
#![cfg_attr(fail, feature(feat_foo))]
69
#![unstable(feature = "feat_foo", issue = "none" )]
710

8-
/// In staged-api crate, impl that is marked with #[unstable_feature_bound(..)]
9-
/// cannot be enabled with #[feature(..)]
11+
/// In staged-api crate, using an unstable impl requires
12+
/// #[unstable_feature_bound(..)], not #[feature(..)].
1013
1114
pub trait Foo {
1215
fn foo();
1316
}
1417
pub struct Bar;
1518

16-
// Annotate the impl as unstable.
1719
#[unstable_feature_bound(feat_foo)]
1820
impl Foo for Bar {
1921
fn foo() {}
2022
}
2123

24+
#[cfg_attr(pass, unstable_feature_bound(feat_foo))]
2225
fn bar() {
2326
Bar::foo();
24-
//~^ ERROR: cannot satisfy `unstable feature: `feat_foo``
27+
//[fail]~^ ERROR: cannot satisfy `unstable feature: `feat_foo``
2528
}
2629

2730
fn main() {}

tests/ui/internal/unstable-impl-require-bound.fail.stderr

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/ui/internal/unstable-impl-require-bound.rs

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)