From 298e160dc88dab90a83799973e121a18fed2ea38 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Thu, 12 Jan 2023 19:58:49 +0100 Subject: [PATCH] Assume there are no macros left in ast lowering. --- compiler/rustc_ast_lowering/src/format.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_ast_lowering/src/format.rs b/compiler/rustc_ast_lowering/src/format.rs index f21c0f23bc11..693b9a399cfb 100644 --- a/compiler/rustc_ast_lowering/src/format.rs +++ b/compiler/rustc_ast_lowering/src/format.rs @@ -334,13 +334,8 @@ fn may_contain_yield_point(e: &ast::Expr) -> bool { } fn visit_mac_call(&mut self, _: &ast::MacCall) { - self.0 = true; - } - - fn visit_attribute(&mut self, _: &ast::Attribute) { - // Conservatively assume this may be a proc macro attribute in - // expression position. - self.0 = true; + // Macros should be expanded at this point. + unreachable!("unexpanded macro in ast lowering"); } fn visit_item(&mut self, _: &ast::Item) {