diff options
| author | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-05 09:13:28 +0100 |
|---|---|---|
| committer | Albert Larsan <74931857+albertlarsan68@users.noreply.github.com> | 2023-01-11 09:32:08 +0000 |
| commit | cf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch) | |
| tree | 40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/annotate-snippet/auxiliary/multispan.rs | |
| parent | ca855e6e42787ecd062d81d53336fe6788ef51a9 (diff) | |
| download | rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip | |
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/annotate-snippet/auxiliary/multispan.rs')
| -rw-r--r-- | src/test/ui/annotate-snippet/auxiliary/multispan.rs | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/test/ui/annotate-snippet/auxiliary/multispan.rs b/src/test/ui/annotate-snippet/auxiliary/multispan.rs deleted file mode 100644 index c05d15643db..00000000000 --- a/src/test/ui/annotate-snippet/auxiliary/multispan.rs +++ /dev/null @@ -1,37 +0,0 @@ -// force-host -// no-prefer-dynamic - -#![crate_type = "proc-macro"] -#![feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)] - -extern crate proc_macro; - -use proc_macro::{TokenStream, TokenTree, Span, Diagnostic}; - -fn parse(input: TokenStream) -> Result<(), Diagnostic> { - let mut hi_spans = vec![]; - for tree in input { - if let TokenTree::Ident(ref ident) = tree { - if ident.to_string() == "hi" { - hi_spans.push(ident.span()); - } - } - } - - if !hi_spans.is_empty() { - return Err(Span::def_site() - .error("hello to you, too!") - .span_note(hi_spans, "found these 'hi's")); - } - - Ok(()) -} - -#[proc_macro] -pub fn hello(input: TokenStream) -> TokenStream { - if let Err(diag) = parse(input) { - diag.emit(); - } - - TokenStream::new() -} |
