Add some convenience helper methods on hir::Safety
This commit is contained in:
parent
3a64bef2ba
commit
8a4e5d7444
27 changed files with 72 additions and 68 deletions
|
@ -53,9 +53,8 @@ fn is_promotable_const_fn(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
|
|||
Some(stab) => {
|
||||
if cfg!(debug_assertions) && stab.promotable {
|
||||
let sig = tcx.fn_sig(def_id);
|
||||
assert_eq!(
|
||||
sig.skip_binder().safety(),
|
||||
hir::Safety::Safe,
|
||||
assert!(
|
||||
sig.skip_binder().safety().is_safe(),
|
||||
"don't mark const unsafe fns as promotable",
|
||||
// https://github.com/rust-lang/rust/pull/53851#issuecomment-418760682
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue