File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
crates/formality-check/src Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,21 @@ impl super::Check<'_> {
5656
5757 #[ context( "check_neg_trait_impl({trait_impl:?})" ) ]
5858 pub ( super ) fn check_neg_trait_impl ( & self , trait_impl : & NegTraitImpl ) -> Fallible < ( ) > {
59+ let NegTraitImpl { binder, safety } = trait_impl;
60+
5961 let mut env = Env :: default ( ) ;
6062
6163 let NegTraitImplBoundData {
6264 trait_id,
6365 self_ty,
6466 trait_parameters,
6567 where_clauses,
66- } = env. instantiate_universally ( & trait_impl . binder ) ;
68+ } = env. instantiate_universally ( binder) ;
6769
6870 let trait_ref = trait_id. with ( self_ty, trait_parameters) ;
6971
7072 // Negative impls are always safe (rustc E0198) regardless of the trait's safety.
71- if trait_impl . safety == Safety :: Unsafe {
73+ if * safety == Safety :: Unsafe {
7274 bail ! ( "negative impls cannot be unsafe" ) ;
7375 }
7476
You can’t perform that action at this time.
0 commit comments