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?
This commit is contained in:
Vadim Petrochenkov 2018-08-17 13:17:39 +03:00
parent a0958048b6
commit 674a5db1a5
5 changed files with 87 additions and 96 deletions

View file

@ -17,11 +17,11 @@
extern crate derive_b; extern crate derive_b;
#[derive(B)] #[derive(B)]
#[B] #[B] //~ ERROR `B` is a derive mode
#[C] //~ ERROR: The attribute `C` is currently unknown to the compiler #[C]
#[B(D)] #[B(D)]
#[B(E = "foo")] #[B(E = "foo")]
#[B(arbitrary tokens)] //~ ERROR expected one of `(`, `)`, `,`, `::`, or `=`, found `tokens` #[B(arbitrary tokens)]
struct B; struct B;
fn main() {} fn main() {}

View file

@ -61,30 +61,30 @@ fn assert_ne() {
#[test] #[test]
fn cfg() { fn cfg() {
let _ = cfg!(pants); cfg!(pants);
let _ = cfg!(pants,); cfg!(pants,);
let _ = cfg!(pants = "pants"); cfg!(pants = "pants");
let _ = cfg!(pants = "pants",); cfg!(pants = "pants",);
let _ = cfg!(all(pants)); cfg!(all(pants));
let _ = cfg!(all(pants),); cfg!(all(pants),);
let _ = cfg!(all(pants,)); cfg!(all(pants,));
let _ = cfg!(all(pants,),); cfg!(all(pants,),);
} }
#[test] #[test]
fn column() { fn column() {
let _ = column!(); column!();
} }
// compile_error! is in a companion to this test in compile-fail // compile_error! is in a companion to this test in compile-fail
#[test] #[test]
fn concat() { fn concat() {
let _ = concat!(); concat!();
let _ = concat!("hello"); concat!("hello");
let _ = concat!("hello",); concat!("hello",);
let _ = concat!("hello", " world"); concat!("hello", " world");
let _ = concat!("hello", " world",); concat!("hello", " world",);
} }
#[test] #[test]
@ -130,10 +130,10 @@ fn debug_assert_ne() {
#[test] #[test]
fn env() { fn env() {
let _ = env!("PATH"); env!("PATH");
let _ = env!("PATH",); env!("PATH",);
let _ = env!("PATH", "not found"); env!("PATH", "not found");
let _ = env!("PATH", "not found",); env!("PATH", "not found",);
} }
#[cfg(std)] #[cfg(std)]
@ -157,58 +157,58 @@ fn eprintln() {
#[test] #[test]
fn file() { fn file() {
let _ = file!(); file!();
} }
#[cfg(std)] #[cfg(std)]
#[test] #[test]
fn format() { fn format() {
let _ = format!("hello"); format!("hello");
let _ = format!("hello",); format!("hello",);
let _ = format!("hello {}", "world"); format!("hello {}", "world");
let _ = format!("hello {}", "world",); format!("hello {}", "world",);
} }
#[test] #[test]
fn format_args() { fn format_args() {
let _ = format_args!("hello"); format_args!("hello");
let _ = format_args!("hello",); format_args!("hello",);
let _ = format_args!("hello {}", "world"); format_args!("hello {}", "world");
let _ = format_args!("hello {}", "world",); format_args!("hello {}", "world",);
} }
#[test] #[test]
fn include() { fn include() {
let _ = include!("auxiliary/macro-comma-support.rs"); include!("auxiliary/macro-comma-support.rs");
let _ = include!("auxiliary/macro-comma-support.rs",); include!("auxiliary/macro-comma-support.rs",);
} }
#[test] #[test]
fn include_bytes() { fn include_bytes() {
let _ = include_bytes!("auxiliary/macro-comma-support.rs"); include_bytes!("auxiliary/macro-comma-support.rs");
let _ = include_bytes!("auxiliary/macro-comma-support.rs",); include_bytes!("auxiliary/macro-comma-support.rs",);
} }
#[test] #[test]
fn include_str() { fn include_str() {
let _ = include_str!("auxiliary/macro-comma-support.rs"); include_str!("auxiliary/macro-comma-support.rs");
let _ = include_str!("auxiliary/macro-comma-support.rs",); include_str!("auxiliary/macro-comma-support.rs",);
} }
#[test] #[test]
fn line() { fn line() {
let _ = line!(); line!();
} }
#[test] #[test]
fn module_path() { fn module_path() {
let _ = module_path!(); module_path!();
} }
#[test] #[test]
fn option_env() { fn option_env() {
let _ = option_env!("PATH"); option_env!("PATH");
let _ = option_env!("PATH",); option_env!("PATH",);
} }
#[test] #[test]
@ -308,10 +308,10 @@ fn unreachable() {
#[test] #[test]
fn vec() { fn vec() {
let _: Vec<()> = vec![]; let _: Vec<()> = vec![];
let _ = vec![0]; vec![0];
let _ = vec![0,]; vec![0,];
let _ = vec![0, 1]; vec![0, 1];
let _ = vec![0, 1,]; vec![0, 1,];
} }
// give a test body access to a fmt::Formatter, which seems // give a test body access to a fmt::Formatter, which seems
@ -339,21 +339,21 @@ macro_rules! test_with_formatter {
test_with_formatter! { test_with_formatter! {
#[test] #[test]
fn write(f: &mut fmt::Formatter) { fn write(f: &mut fmt::Formatter) {
let _ = write!(f, "hello"); write!(f, "hello");
let _ = write!(f, "hello",); write!(f, "hello",);
let _ = write!(f, "hello {}", "world"); write!(f, "hello {}", "world");
let _ = write!(f, "hello {}", "world",); write!(f, "hello {}", "world",);
} }
} }
test_with_formatter! { test_with_formatter! {
#[test] #[test]
fn writeln(f: &mut fmt::Formatter) { fn writeln(f: &mut fmt::Formatter) {
let _ = writeln!(f); writeln!(f);
let _ = writeln!(f,); writeln!(f,);
let _ = writeln!(f, "hello"); writeln!(f, "hello");
let _ = writeln!(f, "hello",); writeln!(f, "hello",);
let _ = writeln!(f, "hello {}", "world"); writeln!(f, "hello {}", "world");
let _ = writeln!(f, "hello {}", "world",); writeln!(f, "hello {}", "world",);
} }
} }

View file

@ -20,5 +20,4 @@ mod foo {
fn main() { fn main() {
bar!(); bar!();
//~^ ERROR cannot find macro `bar!`
} }

View file

@ -1,11 +1,3 @@
error: cannot find macro `bar!` in this scope
--> $DIR/issue-49074.rs:22:4
|
LL | bar!();
| ^^^
|
= help: have you added the `#[macro_use]` on the module/import?
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) 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)
--> $DIR/issue-49074.rs:13:1 --> $DIR/issue-49074.rs:13:1
| |
@ -14,6 +6,6 @@ LL | #[marco_use] // typo
| |
= help: add #![feature(custom_attribute)] to the crate attributes to enable = help: add #![feature(custom_attribute)] to the crate attributes to enable
error: aborting due to 2 previous errors error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`. For more information about this error, try `rustc --explain E0658`.

View file

@ -1,32 +1,8 @@
error: BaseDefault error: 'a,Ambiguous
--> $DIR/object-lifetime-default.rs:16:1 --> $DIR/object-lifetime-default.rs:34:1
| |
LL | struct A<T>(T); //~ ERROR BaseDefault LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: BaseDefault
--> $DIR/object-lifetime-default.rs:19:1
|
LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 'a
--> $DIR/object-lifetime-default.rs:22:1
|
LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: Ambiguous
--> $DIR/object-lifetime-default.rs:25:1
|
LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 'b
--> $DIR/object-lifetime-default.rs:28:1
|
LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 'a,'b error: 'a,'b
--> $DIR/object-lifetime-default.rs:31:1 --> $DIR/object-lifetime-default.rs:31:1
@ -34,11 +10,35 @@ error: 'a,'b
LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 'a,Ambiguous error: 'b
--> $DIR/object-lifetime-default.rs:34:1 --> $DIR/object-lifetime-default.rs:28:1
| |
LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: Ambiguous
--> $DIR/object-lifetime-default.rs:25:1
|
LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T); //~ ERROR Ambiguous
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: 'a
--> $DIR/object-lifetime-default.rs:22:1
|
LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: BaseDefault
--> $DIR/object-lifetime-default.rs:19:1
|
LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: BaseDefault
--> $DIR/object-lifetime-default.rs:16:1
|
LL | struct A<T>(T); //~ ERROR BaseDefault
| ^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors error: aborting due to 7 previous errors