diff options
Diffstat (limited to 'compiler/rustc_builtin_macros/src')
4 files changed, 5 insertions, 4 deletions
| diff --git a/compiler/rustc_builtin_macros/src/asm.rs b/compiler/rustc_builtin_macros/src/asm.rs index 900c4427424..925392b500a 100644 --- a/compiler/rustc_builtin_macros/src/asm.rs +++ b/compiler/rustc_builtin_macros/src/asm.rs @@ -352,7 +352,7 @@ pub fn parse_asm_args<'a>( /// /// This function must be called immediately after the option token is parsed. /// Otherwise, the suggestion will be incorrect. -fn err_duplicate_option<'a>(p: &mut Parser<'a>, symbol: Symbol, span: Span) { +fn err_duplicate_option(p: &mut Parser<'_>, symbol: Symbol, span: Span) { let mut err = p .sess .span_diagnostic diff --git a/compiler/rustc_builtin_macros/src/global_allocator.rs b/compiler/rustc_builtin_macros/src/global_allocator.rs index 41531580c19..f8761653bf5 100644 --- a/compiler/rustc_builtin_macros/src/global_allocator.rs +++ b/compiler/rustc_builtin_macros/src/global_allocator.rs @@ -35,7 +35,7 @@ pub fn expand( (item, true, ecx.with_def_site_ctxt(ty.span)) } else { ecx.sess.parse_sess.span_diagnostic.span_err(item.span(), "allocators must be statics"); - return vec![orig_item.clone()] + return vec![orig_item]; }; // Generate a bunch of new items using the AllocFnFactory diff --git a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs index ece660cf6f6..b88de224675 100644 --- a/compiler/rustc_builtin_macros/src/proc_macro_harness.rs +++ b/compiler/rustc_builtin_macros/src/proc_macro_harness.rs @@ -262,6 +262,7 @@ impl<'a> Visitor<'a> for CollectProcMacros<'a> { // use proc_macro::bridge::client::ProcMacro; // // #[rustc_proc_macro_decls] +// #[used] // #[allow(deprecated)] // static DECLS: &[ProcMacro] = &[ // ProcMacro::custom_derive($name_trait1, &[], ::$name1); @@ -364,6 +365,7 @@ fn mk_decls(cx: &mut ExtCtxt<'_>, macros: &[ProcMacro]) -> P<ast::Item> { ) .map(|mut i| { i.attrs.push(cx.attr_word(sym::rustc_proc_macro_decls, span)); + i.attrs.push(cx.attr_word(sym::used, span)); i.attrs.push(cx.attr_nested_word(sym::allow, sym::deprecated, span)); i }); diff --git a/compiler/rustc_builtin_macros/src/test.rs b/compiler/rustc_builtin_macros/src/test.rs index f5f02fc772a..729ae4071e2 100644 --- a/compiler/rustc_builtin_macros/src/test.rs +++ b/compiler/rustc_builtin_macros/src/test.rs @@ -239,8 +239,7 @@ pub fn expand_test_or_bench( cx.attr_nested_word(sym::cfg, sym::test, attr_sp), // #[rustc_test_marker = "test_case_sort_key"] cx.attr_name_value_str(sym::rustc_test_marker, test_path_symbol, attr_sp), - ] - .into(), + ], // const $ident: test::TestDescAndFn = ast::ItemKind::Const( ast::Defaultness::Final, | 
