From 1b487a890695e7d6dfbfe5dcd7d4fa0e8ca8003f Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Wed, 27 Aug 2014 21:46:52 -0400 Subject: Implement generalized object and type parameter bounds (Fixes #16462) --- src/libsyntax/diagnostics/plugin.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/libsyntax/diagnostics/plugin.rs') diff --git a/src/libsyntax/diagnostics/plugin.rs b/src/libsyntax/diagnostics/plugin.rs index 209296989fa..25a6a4c01bd 100644 --- a/src/libsyntax/diagnostics/plugin.rs +++ b/src/libsyntax/diagnostics/plugin.rs @@ -45,8 +45,10 @@ fn with_used_diagnostics(f: |&mut HashMap| -> T) -> T { } } -pub fn expand_diagnostic_used(ecx: &mut ExtCtxt, span: Span, - token_tree: &[TokenTree]) -> Box { +pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt, + span: Span, + token_tree: &[TokenTree]) + -> Box { let code = match token_tree { [ast::TTTok(_, token::IDENT(code, _))] => code, _ => unreachable!() @@ -75,8 +77,10 @@ pub fn expand_diagnostic_used(ecx: &mut ExtCtxt, span: Span, MacExpr::new(quote_expr!(ecx, ())) } -pub fn expand_register_diagnostic(ecx: &mut ExtCtxt, span: Span, - token_tree: &[TokenTree]) -> Box { +pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt, + span: Span, + token_tree: &[TokenTree]) + -> Box { let (code, description) = match token_tree { [ast::TTTok(_, token::IDENT(ref code, _))] => { (code, None) @@ -101,8 +105,10 @@ pub fn expand_register_diagnostic(ecx: &mut ExtCtxt, span: Span, MacItem::new(quote_item!(ecx, mod $sym {}).unwrap()) } -pub fn expand_build_diagnostic_array(ecx: &mut ExtCtxt, span: Span, - token_tree: &[TokenTree]) -> Box { +pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt, + span: Span, + token_tree: &[TokenTree]) + -> Box { let name = match token_tree { [ast::TTTok(_, token::IDENT(ref name, _))] => name, _ => unreachable!() -- cgit 1.4.1-3-g733a5