mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
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:
parent
8de4629a3c
commit
e83e7ded6e
1 changed files with 1 additions and 11 deletions
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue