diff --git a/compiler/rustc_expand/src/base.rs b/compiler/rustc_expand/src/base.rs index bed500c303242..3a0dbf39ec8dd 100644 --- a/compiler/rustc_expand/src/base.rs +++ b/compiler/rustc_expand/src/base.rs @@ -21,7 +21,7 @@ use rustc_parse::parser::Parser; use rustc_session::config::CollapseMacroDebuginfo; use rustc_session::parse::ParseSess; use rustc_session::{Limit, Session}; -use rustc_span::def_id::{CrateNum, DefId, LocalDefId}; +use rustc_span::def_id::{DefId, LocalDefId}; use rustc_span::edition::Edition; use rustc_span::hygiene::{AstPass, ExpnData, ExpnKind, LocalExpnId, MacroKind}; use rustc_span::source_map::SourceMap; @@ -1047,10 +1047,6 @@ pub trait ResolverExpand { path: &ast::Path, ) -> Result; - /// Decodes the proc-macro quoted span in the specified crate, with the specified id. - /// No caching is performed. - fn get_proc_macro_quoted_span(&self, krate: CrateNum, id: usize) -> Span; - /// The order of items in the HIR is unrelated to the order of /// items in the AST. However, we generate proc macro harnesses /// based on the AST order, and later refer to these harnesses diff --git a/compiler/rustc_expand/src/proc_macro_server.rs b/compiler/rustc_expand/src/proc_macro_server.rs index 0dc35618ff889..3ceb43c442913 100644 --- a/compiler/rustc_expand/src/proc_macro_server.rs +++ b/compiler/rustc_expand/src/proc_macro_server.rs @@ -10,14 +10,12 @@ use rustc_ast::token; use rustc_ast::tokenstream::{self, DelimSpacing, Spacing, TokenStream}; use rustc_ast::util::literal::escape_byte_str_symbol; use rustc_ast_pretty::pprust; -use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::sync::Lrc; use rustc_errors::{Diag, ErrorGuaranteed, MultiSpan, PResult}; use rustc_parse::lexer::nfc_normalize; use rustc_parse::parser::Parser; use rustc_parse::{new_parser_from_source_str, source_str_to_stream, unwrap_or_emit_fatal}; use rustc_session::parse::ParseSess; -use rustc_span::def_id::CrateNum; use rustc_span::symbol::{self, Symbol, sym}; use rustc_span::{BytePos, FileName, Pos, SourceFile, Span}; use smallvec::{SmallVec, smallvec}; @@ -422,8 +420,6 @@ pub(crate) struct Rustc<'a, 'b> { def_site: Span, call_site: Span, mixed_site: Span, - krate: CrateNum, - rebased_spans: FxHashMap, } impl<'a, 'b> Rustc<'a, 'b> { @@ -433,8 +429,6 @@ impl<'a, 'b> Rustc<'a, 'b> { def_site: ecx.with_def_site_ctxt(expn_data.def_site), call_site: ecx.with_call_site_ctxt(expn_data.call_site), mixed_site: ecx.with_mixed_site_ctxt(expn_data.call_site), - krate: expn_data.macro_def_id.unwrap().krate, - rebased_spans: FxHashMap::default(), ecx, } } @@ -779,43 +773,6 @@ impl server::Span for Rustc<'_, '_> { fn source_text(&mut self, span: Self::Span) -> Option { self.psess().source_map().span_to_snippet(span).ok() } - - /// Saves the provided span into the metadata of - /// *the crate we are currently compiling*, which must - /// be a proc-macro crate. This id can be passed to - /// `recover_proc_macro_span` when our current crate - /// is *run* as a proc-macro. - /// - /// Let's suppose that we have two crates - `my_client` - /// and `my_proc_macro`. The `my_proc_macro` crate - /// contains a procedural macro `my_macro`, which - /// is implemented as: `quote! { "hello" }` - /// - /// When we *compile* `my_proc_macro`, we will execute - /// the `quote` proc-macro. This will save the span of - /// "hello" into the metadata of `my_proc_macro`. As a result, - /// the body of `my_proc_macro` (after expansion) will end - /// up containing a call that looks like this: - /// `proc_macro::Ident::new("hello", proc_macro::Span::recover_proc_macro_span(0))` - /// - /// where `0` is the id returned by this function. - /// When `my_proc_macro` *executes* (during the compilation of `my_client`), - /// the call to `recover_proc_macro_span` will load the corresponding - /// span from the metadata of `my_proc_macro` (which we have access to, - /// since we've loaded `my_proc_macro` from disk in order to execute it). - /// In this way, we have obtained a span pointing into `my_proc_macro` - fn save_span(&mut self, span: Self::Span) -> usize { - self.psess().save_proc_macro_span(span) - } - - fn recover_proc_macro_span(&mut self, id: usize) -> Self::Span { - let (resolver, krate, def_site) = (&*self.ecx.resolver, self.krate, self.def_site); - *self.rebased_spans.entry(id).or_insert_with(|| { - // FIXME: `SyntaxContext` for spans from proc macro crates is lost during encoding, - // replace it with a def-site context until we are encoding it properly. - resolver.get_proc_macro_quoted_span(krate, id).with_ctxt(def_site.ctxt()) - }) - } } impl server::Symbol for Rustc<'_, '_> { diff --git a/compiler/rustc_metadata/src/rmeta/decoder.rs b/compiler/rustc_metadata/src/rmeta/decoder.rs index 87357b74c411e..73d30d13bafa6 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder.rs @@ -1444,15 +1444,6 @@ impl<'a> CrateMetadataRef<'a> { self.root.native_libraries.decode((self, sess)) } - fn get_proc_macro_quoted_span(self, index: usize, sess: &Session) -> Span { - self.root - .tables - .proc_macro_quoted_spans - .get(self, index) - .unwrap_or_else(|| panic!("Missing proc macro quoted span: {index:?}")) - .decode((self, sess)) - } - fn get_foreign_modules(self, sess: &'a Session) -> impl Iterator + 'a { self.root.foreign_modules.decode((self, sess)) } diff --git a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs index 045fd0565ba0d..d1a2799bfe8dd 100644 --- a/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs +++ b/compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs @@ -620,15 +620,6 @@ impl CStore { self.get_crate_data(cnum).num_def_ids() } - pub fn get_proc_macro_quoted_span_untracked( - &self, - cnum: CrateNum, - id: usize, - sess: &Session, - ) -> Span { - self.get_crate_data(cnum).get_proc_macro_quoted_span(id, sess) - } - pub fn set_used_recursively(&mut self, cnum: CrateNum) { let cmeta = self.get_crate_data_mut(cnum); if !cmeta.used { diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index b5391247cea54..b43740d3a8431 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -1859,10 +1859,6 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> { let stability = tcx.lookup_stability(CRATE_DEF_ID); let macros = self.lazy_array(tcx.resolutions(()).proc_macros.iter().map(|p| p.local_def_index)); - for (i, span) in self.tcx.sess.psess.proc_macro_quoted_spans() { - let span = self.lazy(span); - self.tables.proc_macro_quoted_spans.set_some(i, span); - } self.tables.def_kind.set_some(LOCAL_CRATE.as_def_id().index, DefKind::Mod); record!(self.tables.def_span[LOCAL_CRATE.as_def_id()] <- tcx.def_span(LOCAL_CRATE.as_def_id())); diff --git a/compiler/rustc_metadata/src/rmeta/mod.rs b/compiler/rustc_metadata/src/rmeta/mod.rs index 58f58efb116fe..1e805297e7331 100644 --- a/compiler/rustc_metadata/src/rmeta/mod.rs +++ b/compiler/rustc_metadata/src/rmeta/mod.rs @@ -457,7 +457,6 @@ define_tables! { // `DefPathTable` up front, since we may only ever use a few // definitions from any given crate. def_keys: Table>, - proc_macro_quoted_spans: Table>, variant_data: Table>, assoc_container: Table, macro_definition: Table>, diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 0b4d0e04c295c..04b32fd276eab 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -20,7 +20,7 @@ use rustc_expand::expand::{ AstFragment, AstFragmentKind, Invocation, InvocationKind, SupportsMacroExpansion, }; use rustc_hir::def::{self, DefKind, Namespace, NonMacroAttrKind}; -use rustc_hir::def_id::{CrateNum, DefId, LocalDefId}; +use rustc_hir::def_id::{DefId, LocalDefId}; use rustc_middle::middle::stability; use rustc_middle::ty::{RegisteredTools, TyCtxt, Visibility}; use rustc_session::lint::BuiltinLintDiag; @@ -480,10 +480,6 @@ impl<'ra, 'tcx> ResolverExpand for Resolver<'ra, 'tcx> { self.path_accessible(expn_id, path, &[MacroNS]) } - fn get_proc_macro_quoted_span(&self, krate: CrateNum, id: usize) -> Span { - self.cstore().get_proc_macro_quoted_span_untracked(krate, id, self.tcx.sess) - } - fn declare_proc_macro(&mut self, id: NodeId) { self.proc_macros.push(id) } diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 21c1165511099..13f051934e47e 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -228,9 +228,6 @@ pub struct ParseSess { pub file_depinfo: Lock>, /// Whether cfg(version) should treat the current release as incomplete pub assume_incomplete_release: bool, - /// Spans passed to `proc_macro::quote_span`. Each span has a numerical - /// identifier represented by its position in the vector. - proc_macro_quoted_spans: AppendOnlyVec, /// Used to generate new `AttrId`s. Every `AttrId` is unique. pub attr_id_generator: AttrIdGenerator, } @@ -265,7 +262,6 @@ impl ParseSess { env_depinfo: Default::default(), file_depinfo: Default::default(), assume_incomplete_release: false, - proc_macro_quoted_spans: Default::default(), attr_id_generator: AttrIdGenerator::new(), } } @@ -328,16 +324,6 @@ impl ParseSess { }); } - pub fn save_proc_macro_span(&self, span: Span) -> usize { - self.proc_macro_quoted_spans.push(span) - } - - pub fn proc_macro_quoted_spans(&self) -> impl Iterator + '_ { - // This is equivalent to `.iter().copied().enumerate()`, but that isn't possible for - // AppendOnlyVec, so we resort to this scheme. - self.proc_macro_quoted_spans.iter_enumerated() - } - pub fn dcx(&self) -> DiagCtxtHandle<'_> { self.dcx.handle() } diff --git a/library/proc_macro/src/bridge/mod.rs b/library/proc_macro/src/bridge/mod.rs index 03c3e697cfe2b..52d98a92950e8 100644 --- a/library/proc_macro/src/bridge/mod.rs +++ b/library/proc_macro/src/bridge/mod.rs @@ -99,8 +99,6 @@ macro_rules! with_api { fn subspan($self: $S::Span, start: Bound, end: Bound) -> Option<$S::Span>; fn resolved_at($self: $S::Span, at: $S::Span) -> $S::Span; fn source_text($self: $S::Span) -> Option; - fn save_span($self: $S::Span) -> usize; - fn recover_proc_macro_span(id: usize) -> $S::Span; }, Symbol { fn normalize_and_validate_ident(string: &str) -> Result<$S::Symbol, ()>; diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 15770248b3106..47db823842514 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -232,7 +232,7 @@ impl Default for TokenStream { } #[unstable(feature = "proc_macro_quote", issue = "54722")] -pub use quote::{quote, quote_span}; +pub use quote::quote; fn tree_to_bridge_tree( tree: TokenTree, @@ -582,20 +582,6 @@ impl Span { self.0.source_text() } - // Used by the implementation of `Span::quote` - #[doc(hidden)] - #[unstable(feature = "proc_macro_internals", issue = "27812")] - pub fn save_span(&self) -> usize { - self.0.save_span() - } - - // Used by the implementation of `Span::quote` - #[doc(hidden)] - #[unstable(feature = "proc_macro_internals", issue = "27812")] - pub fn recover_proc_macro_span(id: usize) -> Span { - Span(bridge::client::Span::recover_proc_macro_span(id)) - } - diagnostic_method!(error, Level::Error); diagnostic_method!(warning, Level::Warning); diagnostic_method!(note, Level::Note); diff --git a/library/proc_macro/src/quote.rs b/library/proc_macro/src/quote.rs index 04fa696d5e6be..644361efbf440 100644 --- a/library/proc_macro/src/quote.rs +++ b/library/proc_macro/src/quote.rs @@ -64,7 +64,6 @@ pub fn quote(stream: TokenStream) -> TokenStream { if stream.is_empty() { return quote!(crate::TokenStream::new()); } - let proc_macro_crate = quote!(crate); let mut after_dollar = false; let tokens = stream .into_iter() @@ -105,7 +104,7 @@ pub fn quote(stream: TokenStream) -> TokenStream { ))), TokenTree::Ident(tt) => quote!(crate::TokenTree::Ident(crate::Ident::new( (@ TokenTree::from(Literal::string(&tt.to_string()))), - (@ quote_span(proc_macro_crate.clone(), tt.span())), + crate::Span::def_site(), ))), TokenTree::Literal(tt) => quote!(crate::TokenTree::Literal({ let mut iter = (@ TokenTree::from(Literal::string(&tt.to_string()))) @@ -115,7 +114,7 @@ pub fn quote(stream: TokenStream) -> TokenStream { if let (Some(crate::TokenTree::Literal(mut lit)), None) = (iter.next(), iter.next()) { - lit.set_span((@ quote_span(proc_macro_crate.clone(), tt.span()))); + lit.set_span(crate::Span::def_site()); lit } else { unreachable!() @@ -131,11 +130,3 @@ pub fn quote(stream: TokenStream) -> TokenStream { quote!([(@ tokens)].iter().cloned().collect::()) } - -/// Quote a `Span` into a `TokenStream`. -/// This is needed to implement a custom quoter. -#[unstable(feature = "proc_macro_quote", issue = "54722")] -pub fn quote_span(proc_macro_crate: TokenStream, span: Span) -> TokenStream { - let id = span.save_span(); - quote!((@ proc_macro_crate ) ::Span::recover_proc_macro_span((@ TokenTree::from(Literal::usize_unsuffixed(id))))) -} diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/rust_analyzer_span.rs b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/rust_analyzer_span.rs index d508c19dd7195..3eca62cec2da7 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/rust_analyzer_span.rs +++ b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/rust_analyzer_span.rs @@ -312,18 +312,6 @@ impl server::Span for RaSpanServer { // FIXME stub, requires db SourceFile {} } - fn save_span(&mut self, _span: Self::Span) -> usize { - // FIXME, quote is incompatible with third-party tools - // This is called by the quote proc-macro which is expanded when the proc-macro is compiled - // As such, r-a will never observe this - 0 - } - fn recover_proc_macro_span(&mut self, _id: usize) -> Self::Span { - // FIXME, quote is incompatible with third-party tools - // This is called by the expansion of quote!, r-a will observe this, but we don't have - // access to the spans that were encoded - self.call_site - } /// Recent feature, not yet in the proc_macro /// /// See PR: diff --git a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/token_id.rs b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/token_id.rs index e478b1c853be7..c0f0b212be99d 100644 --- a/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/token_id.rs +++ b/src/tools/rust-analyzer/crates/proc-macro-srv/src/server_impl/token_id.rs @@ -292,12 +292,6 @@ impl server::Span for TokenIdServer { fn source_file(&mut self, _span: Self::Span) -> Self::SourceFile { SourceFile {} } - fn save_span(&mut self, _span: Self::Span) -> usize { - 0 - } - fn recover_proc_macro_span(&mut self, _id: usize) -> Self::Span { - self.call_site - } /// Recent feature, not yet in the proc_macro /// /// See PR: diff --git a/tests/ui/macros/same-sequence-span.stderr b/tests/ui/macros/same-sequence-span.stderr index 3242a32e2f4dd..6408522f0789c 100644 --- a/tests/ui/macros/same-sequence-span.stderr +++ b/tests/ui/macros/same-sequence-span.stderr @@ -17,9 +17,9 @@ LL | $(= $z:tt)* error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments --> $DIR/same-sequence-span.rs:19:1 | -LL | | } - | |_________________________________^ not allowed after `expr` fragments -LL | +LL | | (1 $x:expr $($y:tt,)* + | |______________________________________________^ not allowed after `expr` fragments +... LL | proc_macro_sequence::make_foo!(); | ^------------------------------- | | diff --git a/tests/ui/proc-macro/auxiliary/custom-quote.rs b/tests/ui/proc-macro/auxiliary/custom-quote.rs deleted file mode 100644 index 88800596ce562..0000000000000 --- a/tests/ui/proc-macro/auxiliary/custom-quote.rs +++ /dev/null @@ -1,32 +0,0 @@ -//@ force-host -//@ no-prefer-dynamic -// ignore-tidy-linelength - -#![feature(proc_macro_quote)] -#![crate_type = "proc-macro"] - -extern crate proc_macro; -use std::iter::FromIterator; -use std::str::FromStr; -use proc_macro::*; - -#[proc_macro] -pub fn custom_quote(input: TokenStream) -> TokenStream { - let mut tokens: Vec<_> = input.into_iter().collect(); - assert_eq!(tokens.len(), 1, "Unexpected input: {:?}", tokens); - match tokens.pop() { - Some(TokenTree::Ident(ident)) => { - assert_eq!(ident.to_string(), "my_ident"); - - let proc_macro_crate = TokenStream::from_str("::proc_macro").unwrap(); - let quoted_span = proc_macro::quote_span(proc_macro_crate, ident.span()); - let prefix = TokenStream::from_str(r#"let mut ident = proc_macro::Ident::new("my_ident", proc_macro::Span::call_site());"#).unwrap(); - let set_span_method = TokenStream::from_str("ident.set_span").unwrap(); - let set_span_arg = TokenStream::from(TokenTree::Group(Group::new(Delimiter::Parenthesis, quoted_span))); - let suffix = TokenStream::from_str(";proc_macro::TokenStream::from(proc_macro::TokenTree::Ident(ident))").unwrap(); - let full_stream = TokenStream::from_iter([prefix, set_span_method, set_span_arg, suffix]); - full_stream - } - _ => unreachable!() - } -} diff --git a/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs b/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs index fdcca29e177bc..13e800dbcdcef 100644 --- a/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs +++ b/tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs @@ -6,7 +6,6 @@ #![crate_type = "proc-macro"] extern crate proc_macro; -extern crate custom_quote; use proc_macro::{quote, TokenStream}; @@ -15,7 +14,7 @@ macro_rules! expand_to_quote { quote! { let bang_error: bool = 25; } - } + }; } #[proc_macro] @@ -23,13 +22,6 @@ pub fn error_from_bang(_input: TokenStream) -> TokenStream { expand_to_quote!() } -#[proc_macro] -pub fn other_error_from_bang(_input: TokenStream) -> TokenStream { - custom_quote::custom_quote! { - my_ident - } -} - #[proc_macro_attribute] pub fn error_from_attribute(_args: TokenStream, _input: TokenStream) -> TokenStream { quote! { diff --git a/tests/ui/proc-macro/quote-debug.stdout b/tests/ui/proc-macro/quote-debug.stdout index d84b4e051e872..5199fd771e32e 100644 --- a/tests/ui/proc-macro/quote-debug.stdout +++ b/tests/ui/proc-macro/quote-debug.stdout @@ -20,9 +20,9 @@ extern crate proc_macro; fn main() { [crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("let", - crate::Span::recover_proc_macro_span(0)))), + crate::Span::def_site()))), crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("hello", - crate::Span::recover_proc_macro_span(1)))), + crate::Span::def_site()))), crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('=', crate::Spacing::Alone))), crate::TokenStream::from(crate::TokenTree::Literal({ @@ -30,7 +30,7 @@ fn main() { "\"world\"".parse::().unwrap().into_iter(); if let (Some(crate::TokenTree::Literal(mut lit)), None) = (iter.next(), iter.next()) { - lit.set_span(crate::Span::recover_proc_macro_span(2)); + lit.set_span(crate::Span::def_site()); lit } else { ::core::panicking::panic("internal error: entered unreachable code") diff --git a/tests/ui/proc-macro/span-from-proc-macro.rs b/tests/ui/proc-macro/span-from-proc-macro.rs index 9d851d62d1269..8174c598da8d2 100644 --- a/tests/ui/proc-macro/span-from-proc-macro.rs +++ b/tests/ui/proc-macro/span-from-proc-macro.rs @@ -1,4 +1,3 @@ -//@ aux-build:custom-quote.rs //@ aux-build:span-from-proc-macro.rs //@ compile-flags: -Z macro-backtrace @@ -13,5 +12,4 @@ struct Kept; fn main() { error_from_bang!(); //~ ERROR mismatched types - other_error_from_bang!(); //~ ERROR cannot find value `my_ident` } diff --git a/tests/ui/proc-macro/span-from-proc-macro.stderr b/tests/ui/proc-macro/span-from-proc-macro.stderr index 7beed505a7efa..7478662e3a7b5 100644 --- a/tests/ui/proc-macro/span-from-proc-macro.stderr +++ b/tests/ui/proc-macro/span-from-proc-macro.stderr @@ -1,62 +1,47 @@ error[E0412]: cannot find type `MissingType` in this scope - --> $DIR/auxiliary/span-from-proc-macro.rs:37:20 + --> $DIR/auxiliary/span-from-proc-macro.rs:26:1 | LL | pub fn error_from_attribute(_args: TokenStream, _input: TokenStream) -> TokenStream { - | ----------------------------------------------------------------------------------- in this expansion of `#[error_from_attribute]` -... -LL | field: MissingType - | ^^^^^^^^^^^ not found in this scope + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | not found in this scope + | in this expansion of `#[error_from_attribute]` | - ::: $DIR/span-from-proc-macro.rs:8:1 + ::: $DIR/span-from-proc-macro.rs:7:1 | LL | #[error_from_attribute] | ----------------------- in this procedural macro expansion error[E0412]: cannot find type `OtherMissingType` in this scope - --> $DIR/auxiliary/span-from-proc-macro.rs:46:21 + --> $DIR/auxiliary/span-from-proc-macro.rs:35:1 | LL | pub fn error_from_derive(_input: TokenStream) -> TokenStream { - | ------------------------------------------------------------ in this expansion of `#[derive(ErrorFromDerive)]` -... -LL | Variant(OtherMissingType) - | ^^^^^^^^^^^^^^^^ not found in this scope + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | not found in this scope + | in this expansion of `#[derive(ErrorFromDerive)]` | - ::: $DIR/span-from-proc-macro.rs:11:10 + ::: $DIR/span-from-proc-macro.rs:10:10 | LL | #[derive(ErrorFromDerive)] | --------------- in this derive macro expansion -error[E0425]: cannot find value `my_ident` in this scope - --> $DIR/auxiliary/span-from-proc-macro.rs:29:9 - | -LL | pub fn other_error_from_bang(_input: TokenStream) -> TokenStream { - | ---------------------------------------------------------------- in this expansion of `other_error_from_bang!` -LL | custom_quote::custom_quote! { -LL | my_ident - | ^^^^^^^^ not found in this scope - | - ::: $DIR/span-from-proc-macro.rs:16:5 - | -LL | other_error_from_bang!(); - | ------------------------ in this macro invocation - error[E0308]: mismatched types - --> $DIR/auxiliary/span-from-proc-macro.rs:16:36 + --> $DIR/auxiliary/span-from-proc-macro.rs:21:1 | -LL | let bang_error: bool = 25; - | ---- ^^ expected `bool`, found integer - | | - | expected due to this -... LL | pub fn error_from_bang(_input: TokenStream) -> TokenStream { - | ---------------------------------------------------------- in this expansion of `error_from_bang!` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected `bool`, found integer + | expected due to this + | in this expansion of `error_from_bang!` | - ::: $DIR/span-from-proc-macro.rs:15:5 + ::: $DIR/span-from-proc-macro.rs:14:5 | LL | error_from_bang!(); | ------------------ in this macro invocation -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0308, E0412, E0425. +Some errors have detailed explanations: E0308, E0412. For more information about an error, try `rustc --explain E0308`.