Debian Codegraph @

gcc/testsuite/rust/compile/negative_impls_2.rs

raw
1 // This test case should error out since we haven't included the negative_impls feature
2 // Output from online rust compiler 2021 ver
3 // Compiling playground v0.0.1 (/playground)
4 // error[E0658]: negative trait bounds are not yet fully implemented; use marker types for now
5 // --> src/main.rs:8:6
6 // |
7 // 8 | impl !ExampleTrait for i32 {}//
8 // | ^^^^^^^^^^^^^
9 // |
10 // = note: see issue #68318 <https://github.com/rust-lang/rust/issues/68318> for more information
11
12 // For more information about this error, try `rustc --explain E0658`.
13 // error: could not compile `playground` (bin "playground") due to 1 previous error
14 trait ExampleTrait {}
15
16 impl !ExampleTrait for i32 {} // { dg-error "negative_impls are not yet implemented" }