Skip to content

Commit 5538a06

Browse files
committed
Show that a test still fails with the feature gate enabled
1 parent 23fced0 commit 5538a06

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0277]: the trait bound `String: const Deref` is not satisfied
2+
--> $DIR/issue-103677.rs:6:5
3+
|
4+
LL | &*s as &str;
5+
| ^^^
6+
7+
error: aborting due to 1 previous error
8+
9+
For more information about this error, try `rustc --explain E0277`.
Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
//@ check-pass
1+
//@[stock] check-pass
2+
//@ revisions: stock cnst
3+
#![cfg_attr(cnst, feature(const_trait_impl))]
24

3-
const _: fn(&String) = |s| { &*s as &str; };
5+
const _: fn(&String) = |s| {
6+
&*s as &str;
7+
//[cnst]~^ ERROR: the trait bound `String: const Deref` is not satisfied
8+
};
49

510
fn main() {}

0 commit comments

Comments
 (0)