fn main() {
match 42 {
_ => { empty!() }
-//~^ ERROR expected expression, found `<eof>`
+//~^ ERROR macro expansion ends with an incomplete expression
};
}
+//~ ERROR mismatched types
// aux-build:span-preservation.rs
// For each of these, we should get the appropriate type mismatch error message,
#[foo]
fn a() {
- let x: usize = "hello";;;;;
+ let x: usize = "hello";;;;; //~ ERROR mismatched types
}
#[foo]
fn b(x: Option<isize>) -> usize {
match x {
- Some(x) => { return x },
+ Some(x) => { return x }, //~ ERROR mismatched types
None => 10
}
}
b: usize
}
- let x = Foo { a: 10isize };
- let y = Foo { a: 10, b: 10isize };
+ let x = Foo { a: 10isize }; //~ ERROR mismatched types
+ let y = Foo { a: 10, b: 10isize }; //~ ERROR has no field named `b`
}
// FIXME: This doesn't work at the moment. See the one below. The pretty-printer
#[foo]
extern "C" fn baz() {
- 0
+ 0 //~ ERROR mismatched types
}
fn main() {}
found type `{integer}`
error[E0308]: mismatched types
- --> $DIR/span-preservation.rs:12:20
+ --> $DIR/span-preservation.rs:13:20
|
-LL | let x: usize = "hello";;;;;
+LL | let x: usize = "hello";;;;; //~ ERROR mismatched types
| ^^^^^^^ expected usize, found reference
|
= note: expected type `usize`
found type `&'static str`
error[E0308]: mismatched types
- --> $DIR/span-preservation.rs:18:29
+ --> $DIR/span-preservation.rs:19:29
|
-LL | Some(x) => { return x },
+LL | Some(x) => { return x }, //~ ERROR mismatched types
| ^ expected usize, found isize
error[E0308]: mismatched types
- --> $DIR/span-preservation.rs:34:22
+ --> $DIR/span-preservation.rs:35:22
|
-LL | let x = Foo { a: 10isize };
+LL | let x = Foo { a: 10isize }; //~ ERROR mismatched types
| ^^^^^^^ expected usize, found isize
error[E0560]: struct `c::Foo` has no field named `b`
- --> $DIR/span-preservation.rs:35:26
+ --> $DIR/span-preservation.rs:36:26
|
-LL | let y = Foo { a: 10, b: 10isize };
+LL | let y = Foo { a: 10, b: 10isize }; //~ ERROR has no field named `b`
| ^ `c::Foo` does not have this field
|
= note: available fields are: `a`
error[E0308]: mismatched types
- --> $DIR/span-preservation.rs:48:5
+ --> $DIR/span-preservation.rs:49:5
|
LL | extern "C" fn baz() {
| - possibly return type missing here?
-LL | 0
+LL | 0 //~ ERROR mismatched types
| ^ expected (), found integral variable
|
= note: expected type `()`
-struct A<T, 'a> {
+struct A<T, 'a> { //~ ERROR lifetime parameters must be declared
t: &'a T,
}
-struct B<T, 'a, U> {
+struct B<T, 'a, U> { //~ ERROR lifetime parameters must be declared
t: &'a T,
u: U,
}
-struct C<T, U, 'a> {
+struct C<T, U, 'a> { //~ ERROR lifetime parameters must be declared
t: &'a T,
u: U,
}
-struct D<T, U, 'a, 'b, V, 'c> {
+struct D<T, U, 'a, 'b, V, 'c> { //~ ERROR lifetime parameters must be declared
t: &'a T,
u: &'b U,
v: &'c V,
error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:1:13
|
-LL | struct A<T, 'a> {
+LL | struct A<T, 'a> { //~ ERROR lifetime parameters must be declared
| ^^
help: move the lifetime parameter prior to the first type parameter
|
-LL | struct A<'a, T> {
+LL | struct A<'a, T> { //~ ERROR lifetime parameters must be declared
| ^^^ --
error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:5:13
|
-LL | struct B<T, 'a, U> {
+LL | struct B<T, 'a, U> { //~ ERROR lifetime parameters must be declared
| ^^
help: move the lifetime parameter prior to the first type parameter
|
-LL | struct B<'a, T, U> {
+LL | struct B<'a, T, U> { //~ ERROR lifetime parameters must be declared
| ^^^ --
error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:10:16
|
-LL | struct C<T, U, 'a> {
+LL | struct C<T, U, 'a> { //~ ERROR lifetime parameters must be declared
| ^^
help: move the lifetime parameter prior to the first type parameter
|
-LL | struct C<'a, T, U> {
+LL | struct C<'a, T, U> { //~ ERROR lifetime parameters must be declared
| ^^^ --
error: lifetime parameters must be declared prior to type parameters
--> $DIR/suggest-move-lifetimes.rs:15:16
|
-LL | struct D<T, U, 'a, 'b, V, 'c> {
+LL | struct D<T, U, 'a, 'b, V, 'c> { //~ ERROR lifetime parameters must be declared
| ^^ ^^ ^^
help: move the lifetime parameter prior to the first type parameter
|
-LL | struct D<'a, 'b, 'c, T, U, V> {
+LL | struct D<'a, 'b, 'c, T, U, V> { //~ ERROR lifetime parameters must be declared
| ^^^ ^^^ ^^^ ---
error: aborting due to 4 previous errors