Skip to content

Commit 1d49cb6

Browse files
committed
move required_consts check to general post-mono-check function
1 parent eb545d7 commit 1d49cb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clippy_lints/src/non_copy_const.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ fn is_value_unfrozen_raw<'tcx>(
204204
// similar to 2., but with the a frozen variant) (e.g. borrowing
205205
// `borrow_interior_mutable_const::enums::AssocConsts::TO_BE_FROZEN_VARIANT`).
206206
// I chose this way because unfrozen enums as assoc consts are rare (or, hopefully, none).
207-
err == ErrorHandled::TooGeneric
207+
matches!(err, ErrorHandled::TooGeneric(..))
208208
},
209209
|val| val.map_or(true, |val| inner(cx, val, ty)),
210210
)
@@ -244,8 +244,8 @@ pub fn const_eval_resolve<'tcx>(
244244
};
245245
tcx.const_eval_global_id_for_typeck(param_env, cid, span)
246246
},
247-
Ok(None) => Err(ErrorHandled::TooGeneric),
248-
Err(err) => Err(ErrorHandled::Reported(err.into())),
247+
Ok(None) => Err(ErrorHandled::TooGeneric(span.unwrap_or(rustc_span::DUMMY_SP))),
248+
Err(err) => Err(ErrorHandled::Reported(err.into(), span.unwrap_or(rustc_span::DUMMY_SP))),
249249
}
250250
}
251251

0 commit comments

Comments
 (0)