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> {
811811 param_env,
812812 Binder :: dummy ( TraitPredicate {
813813 trait_ref,
814- constness : ty:: BoundConstness :: ConstIfConst ,
814+ constness : ty:: BoundConstness :: NotConst ,
815815 polarity : ty:: ImplPolarity :: Positive ,
816816 } ) ,
817817 ) ;
@@ -830,6 +830,10 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
830830 return ;
831831 }
832832 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+ }
833837 let callee_name = tcx. item_name ( callee) ;
834838 if let Some ( & did) = tcx
835839 . associated_item_def_ids ( data. impl_def_id )
You can’t perform that action at this time.
0 commit comments