Skip to content

Commit cf7ff31

Browse files
committed
Fix tests
1 parent 33d7071 commit cf7ff31

File tree

5 files changed

+23
-78
lines changed

5 files changed

+23
-78
lines changed

tests/ui/macros/same-sequence-span.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ LL | $(= $z:tt)*
1717
error: `$x:expr` may be followed by `$y:tt`, which is not allowed for `expr` fragments
1818
--> $DIR/same-sequence-span.rs:19:1
1919
|
20-
LL | | macro_rules! manual_foo {
21-
| |__________________________^not allowed after `expr` fragments
20+
LL | |
21+
| |_^not allowed after `expr` fragments
2222
...
2323
LL | proc_macro_sequence::make_foo!();
2424
| ^-------------------------------

tests/ui/proc-macro/auxiliary/custom-quote.rs

-29
This file was deleted.

tests/ui/proc-macro/auxiliary/span-from-proc-macro.rs

-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#![feature(proc_macro_quote)]
2-
#![feature(proc_macro_internals)] // FIXME - this shouldn't be necessary
32

43
extern crate proc_macro;
5-
extern crate custom_quote;
64

75
use proc_macro::{quote, TokenStream};
86

@@ -19,13 +17,6 @@ pub fn error_from_bang(_input: TokenStream) -> TokenStream {
1917
expand_to_quote!()
2018
}
2119

22-
#[proc_macro]
23-
pub fn other_error_from_bang(_input: TokenStream) -> TokenStream {
24-
custom_quote::custom_quote! {
25-
my_ident
26-
}
27-
}
28-
2920
#[proc_macro_attribute]
3021
pub fn error_from_attribute(_args: TokenStream, _input: TokenStream) -> TokenStream {
3122
quote! {

tests/ui/proc-macro/span-from-proc-macro.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ proc-macro: custom-quote.rs
21
//@ proc-macro: span-from-proc-macro.rs
32
//@ compile-flags: -Z macro-backtrace
43

@@ -13,5 +12,4 @@ struct Kept;
1312

1413
fn main() {
1514
error_from_bang!(); //~ ERROR mismatched types
16-
other_error_from_bang!(); //~ ERROR cannot find value `my_ident`
1715
}
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,47 @@
11
error[E0412]: cannot find type `MissingType` in this scope
2-
--> $DIR/auxiliary/span-from-proc-macro.rs:33:20
2+
--> $DIR/auxiliary/span-from-proc-macro.rs:21:1
33
|
44
LL | pub fn error_from_attribute(_args: TokenStream, _input: TokenStream) -> TokenStream {
5-
| ----------------------------------------------------------------------------------- in this expansion of `#[error_from_attribute]`
6-
...
7-
LL | field: MissingType
8-
| ^^^^^^^^^^^ not found in this scope
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
| |
7+
| not found in this scope
8+
| in this expansion of `#[error_from_attribute]`
99
|
10-
::: $DIR/span-from-proc-macro.rs:8:1
10+
::: $DIR/span-from-proc-macro.rs:7:1
1111
|
1212
LL | #[error_from_attribute]
1313
| ----------------------- in this procedural macro expansion
1414

1515
error[E0412]: cannot find type `OtherMissingType` in this scope
16-
--> $DIR/auxiliary/span-from-proc-macro.rs:42:21
16+
--> $DIR/auxiliary/span-from-proc-macro.rs:30:1
1717
|
1818
LL | pub fn error_from_derive(_input: TokenStream) -> TokenStream {
19-
| ------------------------------------------------------------ in this expansion of `#[derive(ErrorFromDerive)]`
20-
...
21-
LL | Variant(OtherMissingType)
22-
| ^^^^^^^^^^^^^^^^ not found in this scope
19+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+
| |
21+
| not found in this scope
22+
| in this expansion of `#[derive(ErrorFromDerive)]`
2323
|
24-
::: $DIR/span-from-proc-macro.rs:11:10
24+
::: $DIR/span-from-proc-macro.rs:10:10
2525
|
2626
LL | #[derive(ErrorFromDerive)]
2727
| --------------- in this derive macro expansion
2828

29-
error[E0425]: cannot find value `my_ident` in this scope
30-
--> $DIR/auxiliary/span-from-proc-macro.rs:25:9
31-
|
32-
LL | pub fn other_error_from_bang(_input: TokenStream) -> TokenStream {
33-
| ---------------------------------------------------------------- in this expansion of `other_error_from_bang!`
34-
LL | custom_quote::custom_quote! {
35-
LL | my_ident
36-
| ^^^^^^^^ not found in this scope
37-
|
38-
::: $DIR/span-from-proc-macro.rs:16:5
39-
|
40-
LL | other_error_from_bang!();
41-
| ------------------------ in this macro invocation
42-
4329
error[E0308]: mismatched types
44-
--> $DIR/auxiliary/span-from-proc-macro.rs:12:36
30+
--> $DIR/auxiliary/span-from-proc-macro.rs:16:1
4531
|
46-
LL | let bang_error: bool = 25;
47-
| ---- ^^ expected `bool`, found integer
48-
| |
49-
| expected due to this
50-
...
5132
LL | pub fn error_from_bang(_input: TokenStream) -> TokenStream {
52-
| ---------------------------------------------------------- in this expansion of `error_from_bang!`
33+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
| |
35+
| expected `bool`, found integer
36+
| expected due to this
37+
| in this expansion of `error_from_bang!`
5338
|
54-
::: $DIR/span-from-proc-macro.rs:15:5
39+
::: $DIR/span-from-proc-macro.rs:14:5
5540
|
5641
LL | error_from_bang!();
5742
| ------------------ in this macro invocation
5843

59-
error: aborting due to 4 previous errors
44+
error: aborting due to 3 previous errors
6045

61-
Some errors have detailed explanations: E0308, E0412, E0425.
46+
Some errors have detailed explanations: E0308, E0412.
6247
For more information about an error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)