#[test]
fn cfg() {
- let _ = cfg!(pants);
- let _ = cfg!(pants,);
- let _ = cfg!(pants = "pants");
- let _ = cfg!(pants = "pants",);
- let _ = cfg!(all(pants));
- let _ = cfg!(all(pants),);
- let _ = cfg!(all(pants,));
- let _ = cfg!(all(pants,),);
+ cfg!(pants);
+ cfg!(pants,);
+ cfg!(pants = "pants");
+ cfg!(pants = "pants",);
+ cfg!(all(pants));
+ cfg!(all(pants),);
+ cfg!(all(pants,));
+ cfg!(all(pants,),);
}
#[test]
fn column() {
- let _ = column!();
+ column!();
}
// compile_error! is in a companion to this test in compile-fail
#[test]
fn concat() {
- let _ = concat!();
- let _ = concat!("hello");
- let _ = concat!("hello",);
- let _ = concat!("hello", " world");
- let _ = concat!("hello", " world",);
+ concat!();
+ concat!("hello");
+ concat!("hello",);
+ concat!("hello", " world");
+ concat!("hello", " world",);
}
#[test]
#[test]
fn env() {
- let _ = env!("PATH");
- let _ = env!("PATH",);
- let _ = env!("PATH", "not found");
- let _ = env!("PATH", "not found",);
+ env!("PATH");
+ env!("PATH",);
+ env!("PATH", "not found");
+ env!("PATH", "not found",);
}
#[cfg(std)]
#[test]
fn file() {
- let _ = file!();
+ file!();
}
#[cfg(std)]
#[test]
fn format() {
- let _ = format!("hello");
- let _ = format!("hello",);
- let _ = format!("hello {}", "world");
- let _ = format!("hello {}", "world",);
+ format!("hello");
+ format!("hello",);
+ format!("hello {}", "world");
+ format!("hello {}", "world",);
}
#[test]
fn format_args() {
- let _ = format_args!("hello");
- let _ = format_args!("hello",);
- let _ = format_args!("hello {}", "world");
- let _ = format_args!("hello {}", "world",);
+ format_args!("hello");
+ format_args!("hello",);
+ format_args!("hello {}", "world");
+ format_args!("hello {}", "world",);
}
#[test]
fn include() {
- let _ = include!("auxiliary/macro-comma-support.rs");
- let _ = include!("auxiliary/macro-comma-support.rs",);
+ include!("auxiliary/macro-comma-support.rs");
+ include!("auxiliary/macro-comma-support.rs",);
}
#[test]
fn include_bytes() {
- let _ = include_bytes!("auxiliary/macro-comma-support.rs");
- let _ = include_bytes!("auxiliary/macro-comma-support.rs",);
+ include_bytes!("auxiliary/macro-comma-support.rs");
+ include_bytes!("auxiliary/macro-comma-support.rs",);
}
#[test]
fn include_str() {
- let _ = include_str!("auxiliary/macro-comma-support.rs");
- let _ = include_str!("auxiliary/macro-comma-support.rs",);
+ include_str!("auxiliary/macro-comma-support.rs");
+ include_str!("auxiliary/macro-comma-support.rs",);
}
#[test]
fn line() {
- let _ = line!();
+ line!();
}
#[test]
fn module_path() {
- let _ = module_path!();
+ module_path!();
}
#[test]
fn option_env() {
- let _ = option_env!("PATH");
- let _ = option_env!("PATH",);
+ option_env!("PATH");
+ option_env!("PATH",);
}
#[test]
#[test]
fn vec() {
let _: Vec<()> = vec![];
- let _ = vec![0];
- let _ = vec![0,];
- let _ = vec![0, 1];
- let _ = vec![0, 1,];
+ vec![0];
+ vec![0,];
+ vec![0, 1];
+ vec![0, 1,];
}
// give a test body access to a fmt::Formatter, which seems
test_with_formatter! {
#[test]
fn write(f: &mut fmt::Formatter) {
- let _ = write!(f, "hello");
- let _ = write!(f, "hello",);
- let _ = write!(f, "hello {}", "world");
- let _ = write!(f, "hello {}", "world",);
+ write!(f, "hello");
+ write!(f, "hello",);
+ write!(f, "hello {}", "world");
+ write!(f, "hello {}", "world",);
}
}
test_with_formatter! {
#[test]
fn writeln(f: &mut fmt::Formatter) {
- let _ = writeln!(f);
- let _ = writeln!(f,);
- let _ = writeln!(f, "hello");
- let _ = writeln!(f, "hello",);
- let _ = writeln!(f, "hello {}", "world");
- let _ = writeln!(f, "hello {}", "world",);
+ writeln!(f);
+ writeln!(f,);
+ writeln!(f, "hello");
+ writeln!(f, "hello",);
+ writeln!(f, "hello {}", "world");
+ writeln!(f, "hello {}", "world",);
}
}
-error: BaseDefault
- --> $DIR/object-lifetime-default.rs:16:1
+error: 'a,Ambiguous
+ --> $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
+error: 'a,'b
+ --> $DIR/object-lifetime-default.rs:31:1
|
-LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: 'a
- --> $DIR/object-lifetime-default.rs:22:1
+error: 'b
+ --> $DIR/object-lifetime-default.rs:28:1
|
-LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+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: 'b
- --> $DIR/object-lifetime-default.rs:28:1
+error: 'a
+ --> $DIR/object-lifetime-default.rs:22:1
|
-LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T); //~ ERROR 'b
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct C<'a,T:'a>(&'a T); //~ ERROR 'a
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^
-error: 'a,'b
- --> $DIR/object-lifetime-default.rs:31:1
+error: BaseDefault
+ --> $DIR/object-lifetime-default.rs:19:1
|
-LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U); //~ ERROR 'a,'b
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct B<'a,T>(&'a (), T); //~ ERROR BaseDefault
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
-error: 'a,Ambiguous
- --> $DIR/object-lifetime-default.rs:34:1
+error: BaseDefault
+ --> $DIR/object-lifetime-default.rs:16:1
|
-LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct A<T>(T); //~ ERROR BaseDefault
+ | ^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors