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.
This commit is contained in:
Martin Robinson 2023-11-17 11:36:09 +01:00 committed by GitHub
parent 8de4629a3c
commit e83e7ded6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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()
}