Rip it out
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
This commit is contained in:
parent
2034b6d23c
commit
c63b6a437e
97 changed files with 951 additions and 954 deletions
|
@ -992,7 +992,6 @@ pub struct ExpansionData {
|
|||
pub depth: usize,
|
||||
pub module: Rc<ModuleData>,
|
||||
pub dir_ownership: DirOwnership,
|
||||
pub prior_type_ascription: Option<(Span, bool)>,
|
||||
/// Some parent node that is close to this macro call
|
||||
pub lint_node_id: NodeId,
|
||||
pub is_trailing_mac: bool,
|
||||
|
@ -1043,7 +1042,6 @@ impl<'a> ExtCtxt<'a> {
|
|||
depth: 0,
|
||||
module: Default::default(),
|
||||
dir_ownership: DirOwnership::Owned { relative: None },
|
||||
prior_type_ascription: None,
|
||||
lint_node_id: ast::CRATE_NODE_ID,
|
||||
is_trailing_mac: false,
|
||||
},
|
||||
|
|
|
@ -657,8 +657,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
|
|||
self.parse_ast_fragment(tok_result, fragment_kind, &mac.path, span)
|
||||
}
|
||||
SyntaxExtensionKind::LegacyBang(expander) => {
|
||||
let prev = self.cx.current_expansion.prior_type_ascription;
|
||||
self.cx.current_expansion.prior_type_ascription = mac.prior_type_ascription;
|
||||
let tok_result = expander.expand(self.cx, span, mac.args.tokens.clone());
|
||||
let result = if let Some(result) = fragment_kind.make_from(tok_result) {
|
||||
result
|
||||
|
@ -666,7 +664,6 @@ impl<'a, 'b> MacroExpander<'a, 'b> {
|
|||
self.error_wrong_fragment_kind(fragment_kind, &mac, span);
|
||||
fragment_kind.dummy(span)
|
||||
};
|
||||
self.cx.current_expansion.prior_type_ascription = prev;
|
||||
result
|
||||
}
|
||||
_ => unreachable!(),
|
||||
|
|
|
@ -250,8 +250,7 @@ fn expand_macro<'cx>(
|
|||
trace_macros_note(&mut cx.expansions, sp, msg);
|
||||
}
|
||||
|
||||
let mut p = Parser::new(sess, tts, false, None);
|
||||
p.last_type_ascription = cx.current_expansion.prior_type_ascription;
|
||||
let p = Parser::new(sess, tts, false, None);
|
||||
|
||||
if is_local {
|
||||
cx.resolver.record_macro_rule_usage(node_id, i);
|
||||
|
|
|
@ -21,7 +21,6 @@ pub fn placeholder(
|
|||
delim: ast::MacDelimiter::Parenthesis,
|
||||
tokens: ast::tokenstream::TokenStream::new(Vec::new()),
|
||||
}),
|
||||
prior_type_ascription: None,
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue