Lower AST and resolve lifetimes for unsafe binder types
This commit is contained in:
@@ -288,6 +288,9 @@ impl<'a> State<'a> {
|
||||
hir::TyKind::BareFn(f) => {
|
||||
self.print_ty_fn(f.abi, f.safety, f.decl, None, f.generic_params, f.param_names);
|
||||
}
|
||||
hir::TyKind::UnsafeBinder(unsafe_binder) => {
|
||||
self.print_unsafe_binder(unsafe_binder);
|
||||
}
|
||||
hir::TyKind::OpaqueDef(..) => self.word("/*impl Trait*/"),
|
||||
hir::TyKind::Path(ref qpath) => self.print_qpath(qpath, false),
|
||||
hir::TyKind::TraitObject(bounds, lifetime, syntax) => {
|
||||
@@ -339,6 +342,15 @@ impl<'a> State<'a> {
|
||||
self.end()
|
||||
}
|
||||
|
||||
fn print_unsafe_binder(&mut self, unsafe_binder: &hir::UnsafeBinderTy<'_>) {
|
||||
self.ibox(INDENT_UNIT);
|
||||
self.word("unsafe");
|
||||
self.print_generic_params(unsafe_binder.generic_params);
|
||||
self.nbsp();
|
||||
self.print_type(unsafe_binder.inner_ty);
|
||||
self.end();
|
||||
}
|
||||
|
||||
fn print_foreign_item(&mut self, item: &hir::ForeignItem<'_>) {
|
||||
self.hardbreak_if_not_bol();
|
||||
self.maybe_print_comment(item.span.lo());
|
||||
|
||||
Reference in New Issue
Block a user