This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
compiler/rustc_hir_analysis/src/check Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -124,7 +124,10 @@ pub(crate) fn check_negative_auto_trait_impl<'tcx>(
124124 // be implemented here to handle non-ADT rigid types.
125125 Ok ( ( ) )
126126 } else {
127- span_bug ! ( tcx. def_span( impl_def_id) , "incoherent impl of negative auto trait" ) ;
127+ Err ( tcx. dcx ( ) . span_delayed_bug (
128+ tcx. def_span ( impl_def_id) ,
129+ "incoherent impl of negative auto trait" ,
130+ ) )
128131 }
129132 }
130133 }
Original file line number Diff line number Diff line change 1+ auto trait MyTrait { }
2+ //~^ ERROR auto traits are experimental and possibly buggy
3+
4+ impl < T > !MyTrait for * mut T { }
5+ //~^ ERROR negative trait bounds are not fully implemented
6+
7+ fn main ( ) { }
Original file line number Diff line number Diff line change 1+ error[E0658]: auto traits are experimental and possibly buggy
2+ --> $DIR/ungated-impl.rs:1:1
3+ |
4+ LL | auto trait MyTrait {}
5+ | ^^^^^^^^^^^^^^^^^^^^^
6+ |
7+ = note: see issue #13231 <https://github.com/rust-lang/rust/issues/13231> for more information
8+ = help: add `#![feature(auto_traits)]` to the crate attributes to enable
9+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
10+
11+ error[E0658]: negative trait bounds are not fully implemented; use marker types for now
12+ --> $DIR/ungated-impl.rs:4:9
13+ |
14+ LL | impl<T> !MyTrait for *mut T {}
15+ | ^^^^^^^^
16+ |
17+ = note: see issue #68318 <https://github.com/rust-lang/rust/issues/68318> for more information
18+ = help: add `#![feature(negative_impls)]` to the crate attributes to enable
19+ = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
20+
21+ error: aborting due to 2 previous errors
22+
23+ For more information about this error, try `rustc --explain E0658`.
You can’t perform that action at this time.
0 commit comments