Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use UI test to test spans, instead of forced line break #35713

Merged
merged 1 commit into from
Aug 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Regression test for issue #24986
// Make sure that the span of a closure marked `move` begins at the `move` keyword.

fn main() {
let x: () =
move //~ ERROR mismatched types
|| ();
let x: () = move || ();
}
11 changes: 11 additions & 0 deletions src/test/ui/span/move-closure.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0308]: mismatched types
--> $DIR/move-closure.rs:15:17
|
15 | let x: () = move || ();
| ^^^^^^^^^^ expected (), found closure
|
= note: expected type `()`
= note: found type `[closure@$DIR/move-closure.rs:15:17: 15:27]`

error: aborting due to previous error

Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// Regression test for issue #28158
// Test the type binding span doesn't include >>

use std::ops::Deref;

fn homura<T: Deref<Trget=i32 //~ ERROR associated type
>>(_: T) { }
fn homura<T: Deref<Trget = i32>>(_: T) {}


fn main() {
}
fn main() {}
8 changes: 8 additions & 0 deletions src/test/ui/span/type-binding.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error[E0220]: associated type `Trget` not found for `std::ops::Deref`
--> $DIR/type-binding.rs:16:20
|
16 | fn homura<T: Deref<Trget = i32>>(_: T) {}
| ^^^^^^^^^^^

error: aborting due to previous error