Skip to content

Commit 674a5db

Browse files
committed
Fix undesirable fallout
compile-fail-fulldeps/proc-macro/proc-macro-attributes.rs - resolution change for derive helper attributes with the same name as derive itself run-pass/macro-comma-support.rs - indeterminate resolutions for macros in expression positions ui/issues/issue-49074.rs - diagnostics regression, not enough recovery to report the second error ui/object-lifetime/object-lifetime-default.stderr - unstable diagnostics?
1 parent a095804 commit 674a5db

File tree

5 files changed

+79
-88
lines changed

5 files changed

+79
-88
lines changed

src/test/compile-fail-fulldeps/proc-macro/proc-macro-attributes.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
extern crate derive_b;
1818

1919
#[derive(B)]
20-
#[B]
21-
#[C] //~ ERROR: The attribute `C` is currently unknown to the compiler
20+
#[B] //~ ERROR `B` is a derive mode
21+
#[C]
2222
#[B(D)]
2323
#[B(E = "foo")]
24-
#[B(arbitrary tokens)] //~ ERROR expected one of `(`, `)`, `,`, `::`, or `=`, found `tokens`
24+
#[B(arbitrary tokens)]
2525
struct B;
2626

2727
fn main() {}

src/test/run-pass/macro-comma-support.rs

+51-51
Original file line numberDiff line numberDiff line change
@@ -61,30 +61,30 @@ fn assert_ne() {
6161

6262
#[test]
6363
fn cfg() {
64-
let _ = cfg!(pants);
65-
let _ = cfg!(pants,);
66-
let _ = cfg!(pants = "pants");
67-
let _ = cfg!(pants = "pants",);
68-
let _ = cfg!(all(pants));
69-
let _ = cfg!(all(pants),);
70-
let _ = cfg!(all(pants,));
71-
let _ = cfg!(all(pants,),);
64+
cfg!(pants);
65+
cfg!(pants,);
66+
cfg!(pants = "pants");
67+
cfg!(pants = "pants",);
68+
cfg!(all(pants));
69+
cfg!(all(pants),);
70+
cfg!(all(pants,));
71+
cfg!(all(pants,),);
7272
}
7373

7474
#[test]
7575
fn column() {
76-
let _ = column!();
76+
column!();
7777
}
7878

7979
// compile_error! is in a companion to this test in compile-fail
8080

8181
#[test]
8282
fn concat() {
83-
let _ = concat!();
84-
let _ = concat!("hello");
85-
let _ = concat!("hello",);
86-
let _ = concat!("hello", " world");
87-
let _ = concat!("hello", " world",);
83+
concat!();
84+
concat!("hello");
85+
concat!("hello",);
86+
concat!("hello", " world");
87+
concat!("hello", " world",);
8888
}
8989

9090
#[test]
@@ -130,10 +130,10 @@ fn debug_assert_ne() {
130130

131131
#[test]
132132
fn env() {
133-
let _ = env!("PATH");
134-
let _ = env!("PATH",);
135-
let _ = env!("PATH", "not found");
136-
let _ = env!("PATH", "not found",);
133+
env!("PATH");
134+
env!("PATH",);
135+
env!("PATH", "not found");
136+
env!("PATH", "not found",);
137137
}
138138

139139
#[cfg(std)]
@@ -157,58 +157,58 @@ fn eprintln() {
157157

158158
#[test]
159159
fn file() {
160-
let _ = file!();
160+
file!();
161161
}
162162

163163
#[cfg(std)]
164164
#[test]
165165
fn format() {
166-
let _ = format!("hello");
167-
let _ = format!("hello",);
168-
let _ = format!("hello {}", "world");
169-
let _ = format!("hello {}", "world",);
166+
format!("hello");
167+
format!("hello",);
168+
format!("hello {}", "world");
169+
format!("hello {}", "world",);
170170
}
171171

172172
#[test]
173173
fn format_args() {
174-
let _ = format_args!("hello");
175-
let _ = format_args!("hello",);
176-
let _ = format_args!("hello {}", "world");
177-
let _ = format_args!("hello {}", "world",);
174+
format_args!("hello");
175+
format_args!("hello",);
176+
format_args!("hello {}", "world");
177+
format_args!("hello {}", "world",);
178178
}
179179

180180
#[test]
181181
fn include() {
182-
let _ = include!("auxiliary/macro-comma-support.rs");
183-
let _ = include!("auxiliary/macro-comma-support.rs",);
182+
include!("auxiliary/macro-comma-support.rs");
183+
include!("auxiliary/macro-comma-support.rs",);
184184
}
185185

186186
#[test]
187187
fn include_bytes() {
188-
let _ = include_bytes!("auxiliary/macro-comma-support.rs");
189-
let _ = include_bytes!("auxiliary/macro-comma-support.rs",);
188+
include_bytes!("auxiliary/macro-comma-support.rs");
189+
include_bytes!("auxiliary/macro-comma-support.rs",);
190190
}
191191

192192
#[test]
193193
fn include_str() {
194-
let _ = include_str!("auxiliary/macro-comma-support.rs");
195-
let _ = include_str!("auxiliary/macro-comma-support.rs",);
194+
include_str!("auxiliary/macro-comma-support.rs");
195+
include_str!("auxiliary/macro-comma-support.rs",);
196196
}
197197

198198
#[test]
199199
fn line() {
200-
let _ = line!();
200+
line!();
201201
}
202202

203203
#[test]
204204
fn module_path() {
205-
let _ = module_path!();
205+
module_path!();
206206
}
207207

208208
#[test]
209209
fn option_env() {
210-
let _ = option_env!("PATH");
211-
let _ = option_env!("PATH",);
210+
option_env!("PATH");
211+
option_env!("PATH",);
212212
}
213213

214214
#[test]
@@ -308,10 +308,10 @@ fn unreachable() {
308308
#[test]
309309
fn vec() {
310310
let _: Vec<()> = vec![];
311-
let _ = vec![0];
312-
let _ = vec![0,];
313-
let _ = vec![0, 1];
314-
let _ = vec![0, 1,];
311+
vec![0];
312+
vec![0,];
313+
vec![0, 1];
314+
vec![0, 1,];
315315
}
316316

317317
// give a test body access to a fmt::Formatter, which seems
@@ -339,21 +339,21 @@ macro_rules! test_with_formatter {
339339
test_with_formatter! {
340340
#[test]
341341
fn write(f: &mut fmt::Formatter) {
342-
let _ = write!(f, "hello");
343-
let _ = write!(f, "hello",);
344-
let _ = write!(f, "hello {}", "world");
345-
let _ = write!(f, "hello {}", "world",);
342+
write!(f, "hello");
343+
write!(f, "hello",);
344+
write!(f, "hello {}", "world");
345+
write!(f, "hello {}", "world",);
346346
}
347347
}
348348

349349
test_with_formatter! {
350350
#[test]
351351
fn writeln(f: &mut fmt::Formatter) {
352-
let _ = writeln!(f);
353-
let _ = writeln!(f,);
354-
let _ = writeln!(f, "hello");
355-
let _ = writeln!(f, "hello",);
356-
let _ = writeln!(f, "hello {}", "world");
357-
let _ = writeln!(f, "hello {}", "world",);
352+
writeln!(f);
353+
writeln!(f,);
354+
writeln!(f, "hello");
355+
writeln!(f, "hello",);
356+
writeln!(f, "hello {}", "world");
357+
writeln!(f, "hello {}", "world",);
358358
}
359359
}

src/test/ui/issues/issue-49074.rs

-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ mod foo {
2020

2121
fn main() {
2222
bar!();
23-
//~^ ERROR cannot find macro `bar!`
2423
}

src/test/ui/issues/issue-49074.stderr

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
error: cannot find macro `bar!` in this scope
2-
--> $DIR/issue-49074.rs:22:4
3-
|
4-
LL | bar!();
5-
| ^^^
6-
|
7-
= help: have you added the `#[macro_use]` on the module/import?
8-
91
error[E0658]: The attribute `marco_use` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
102
--> $DIR/issue-49074.rs:13:1
113
|
@@ -14,6 +6,6 @@ LL | #[marco_use] // typo
146
|
157
= help: add #![feature(custom_attribute)] to the crate attributes to enable
168

17-
error: aborting due to 2 previous errors
9+
error: aborting due to previous error
1810

1911
For more information about this error, try `rustc --explain E0658`.
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
error: BaseDefault
2-
--> $DIR/object-lifetime-default.rs:16:1
1+
error: 'a,Ambiguous
2+
--> $DIR/object-lifetime-default.rs:34:1
33
|
4-
LL | struct A<T>(T); //~ ERROR BaseDefault
5-
| ^^^^^^^^^^^^^^^
4+
LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66

7-
error: BaseDefault
8-
--> $DIR/object-lifetime-default.rs:19:1
7+
error: 'a,'b
8+
--> $DIR/object-lifetime-default.rs:31:1
99
|
10-
LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
11-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
10+
LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1212

13-
error: 'a
14-
--> $DIR/object-lifetime-default.rs:22:1
13+
error: 'b
14+
--> $DIR/object-lifetime-default.rs:28:1
1515
|
16-
LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
17-
| ^^^^^^^^^^^^^^^^^^^^^^^^^
16+
LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
17+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1818

1919
error: Ambiguous
2020
--> $DIR/object-lifetime-default.rs:25:1
2121
|
2222
LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous
2323
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424

25-
error: 'b
26-
--> $DIR/object-lifetime-default.rs:28:1
25+
error: 'a
26+
--> $DIR/object-lifetime-default.rs:22:1
2727
|
28-
LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
29-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28+
LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
29+
| ^^^^^^^^^^^^^^^^^^^^^^^^^
3030

31-
error: 'a,'b
32-
--> $DIR/object-lifetime-default.rs:31:1
31+
error: BaseDefault
32+
--> $DIR/object-lifetime-default.rs:19:1
3333
|
34-
LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b
35-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
34+
LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
35+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
3636

37-
error: 'a,Ambiguous
38-
--> $DIR/object-lifetime-default.rs:34:1
37+
error: BaseDefault
38+
--> $DIR/object-lifetime-default.rs:16:1
3939
|
40-
LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
41-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40+
LL | struct A<T>(T); //~ ERROR BaseDefault
41+
| ^^^^^^^^^^^^^^^
4242

4343
error: aborting due to 7 previous errors
4444

0 commit comments

Comments
 (0)