Add hir::HeaderSafety to make follow up commits simpler
This commit is contained in:
parent
e491caec14
commit
a907c56a77
23 changed files with 101 additions and 40 deletions
|
@ -198,7 +198,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
Asyncness::No => hir::IsAsync::NotAsync,
|
||||
};
|
||||
hir::FnHeader {
|
||||
safety: sig.safety,
|
||||
safety: sig.safety.into(),
|
||||
constness: self.tcx.constness(sig_id),
|
||||
asyncness,
|
||||
abi: sig.abi,
|
||||
|
@ -384,7 +384,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
|
||||
fn generate_header_error(&self) -> hir::FnHeader {
|
||||
hir::FnHeader {
|
||||
safety: hir::Safety::Safe,
|
||||
safety: hir::Safety::Safe.into(),
|
||||
constness: hir::Constness::NotConst,
|
||||
asyncness: hir::IsAsync::NotAsync,
|
||||
abi: abi::Abi::Rust,
|
||||
|
|
|
@ -1358,8 +1358,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
} else {
|
||||
hir::IsAsync::NotAsync
|
||||
};
|
||||
|
||||
let safety = self.lower_safety(h.safety, default_safety);
|
||||
let safety = safety.into();
|
||||
|
||||
hir::FnHeader {
|
||||
safety: self.lower_safety(h.safety, default_safety),
|
||||
safety,
|
||||
asyncness,
|
||||
constness: self.lower_constness(h.constness),
|
||||
abi: self.lower_extern(h.ext),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue