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
|
@ -2407,7 +2407,7 @@ impl<'a> State<'a> {
|
|||
self.print_fn(
|
||||
decl,
|
||||
hir::FnHeader {
|
||||
safety,
|
||||
safety: safety.into(),
|
||||
abi,
|
||||
constness: hir::Constness::NotConst,
|
||||
asyncness: hir::IsAsync::NotAsync,
|
||||
|
@ -2423,12 +2423,16 @@ impl<'a> State<'a> {
|
|||
fn print_fn_header_info(&mut self, header: hir::FnHeader) {
|
||||
self.print_constness(header.constness);
|
||||
|
||||
let safety = match header.safety {
|
||||
hir::HeaderSafety::Normal(safety) => safety,
|
||||
};
|
||||
|
||||
match header.asyncness {
|
||||
hir::IsAsync::NotAsync => {}
|
||||
hir::IsAsync::Async(_) => self.word_nbsp("async"),
|
||||
}
|
||||
|
||||
self.print_safety(header.safety);
|
||||
self.print_safety(safety);
|
||||
|
||||
if header.abi != ExternAbi::Rust {
|
||||
self.word_nbsp("extern");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue