From e83e7ded6e9d00a1079b00bd3b1c6c2d072b827f Mon Sep 17 00:00:00 2001 From: Martin Robinson Date: Fri, 17 Nov 2023 11:36:09 +0100 Subject: [PATCH] Remove use of proc_macro_diagnostics feature (#30745) This is only used to emit a single error, which can be done using `syn`. Removing the use of this feature brings us close to being to able to compile with stable rust. --- components/config_plugins/lib.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/components/config_plugins/lib.rs b/components/config_plugins/lib.rs index 5ea3846b4d9..7e7badc3d2d 100644 --- a/components/config_plugins/lib.rs +++ b/components/config_plugins/lib.rs @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#![feature(proc_macro_diagnostic)] - use std::collections::{hash_map, HashMap}; use std::fmt::Write; use std::iter; @@ -23,15 +21,7 @@ pub fn build_structs(tokens: proc_macro::TokenStream) -> proc_macro::TokenStream let input: MacroInput = parse_macro_input!(tokens); let out = Build::new(&input) .build(&input.type_def) - .unwrap_or_else(|e| { - proc_macro::Diagnostic::spanned( - e.span().unwrap(), - proc_macro::Level::Error, - format!("{}", e), - ) - .emit(); - TokenStream::new() - }); + .unwrap_or_else(|e| syn::Error::new(e.span(), e).to_compile_error()); out.into() }