File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
compiler/rustc_const_eval/src/transform/check_consts Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -811,7 +811,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
811
811
param_env,
812
812
Binder :: dummy ( TraitPredicate {
813
813
trait_ref,
814
- constness : ty:: BoundConstness :: ConstIfConst ,
814
+ constness : ty:: BoundConstness :: NotConst ,
815
815
polarity : ty:: ImplPolarity :: Positive ,
816
816
} ) ,
817
817
) ;
@@ -830,6 +830,10 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
830
830
return ;
831
831
}
832
832
Ok ( Some ( ImplSource :: UserDefined ( data) ) ) => {
833
+ if let hir:: Constness :: NotConst = tcx. impl_constness ( data. impl_def_id ) {
834
+ self . check_op ( ops:: FnCallNonConst ( None ) ) ;
835
+ return ;
836
+ }
833
837
let callee_name = tcx. item_name ( callee) ;
834
838
if let Some ( & did) = tcx
835
839
. associated_item_def_ids ( data. impl_def_id )
You can’t perform that action at this time.
0 commit comments