File tree 1 file changed +4
-2
lines changed
crates/formality-check/src
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -56,19 +56,21 @@ impl super::Check<'_> {
56
56
57
57
#[ context( "check_neg_trait_impl({trait_impl:?})" ) ]
58
58
pub ( super ) fn check_neg_trait_impl ( & self , trait_impl : & NegTraitImpl ) -> Fallible < ( ) > {
59
+ let NegTraitImpl { binder, safety } = trait_impl;
60
+
59
61
let mut env = Env :: default ( ) ;
60
62
61
63
let NegTraitImplBoundData {
62
64
trait_id,
63
65
self_ty,
64
66
trait_parameters,
65
67
where_clauses,
66
- } = env. instantiate_universally ( & trait_impl . binder ) ;
68
+ } = env. instantiate_universally ( binder) ;
67
69
68
70
let trait_ref = trait_id. with ( self_ty, trait_parameters) ;
69
71
70
72
// 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 {
72
74
bail ! ( "negative impls cannot be unsafe" ) ;
73
75
}
74
76
You can’t perform that action at this time.
0 commit comments