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

Rollup of 4 pull requests #41459

Merged
merged 11 commits into from
Apr 22, 2017
Prev Previous commit
Next Next commit
Update tests
  • Loading branch information
GuillaumeGomez committed Apr 21, 2017
commit 8fe3a9a8f123fa759d35000bfbfb623167a76409
1 change: 0 additions & 1 deletion src/test/compile-fail/coercion-slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ fn main() {
let _: &[i32] = [0];
//~^ ERROR mismatched types
//~| expected type `&[i32]`
//~| found type `[{integer}; 1]`
//~| expected &[i32], found array of 1 elements
}
2 changes: 2 additions & 0 deletions src/test/compile-fail/cross-borrow-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ pub fn main() {
let _y: &Trait = x; //~ ERROR mismatched types
//~| expected type `&Trait`
//~| found type `std::boxed::Box<Trait>`
//~| expected &Trait, found box
//~| ERROR the trait bound `Box<Trait>: Trait` is not satisfied
}
2 changes: 2 additions & 0 deletions src/test/compile-fail/dst-bad-coercions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ pub fn main() {
let x: *const S = &S;
let y: &S = x; //~ ERROR mismatched types
let y: &T = x; //~ ERROR mismatched types
//~^ ERROR the trait bound `*const S: T` is not satisfied

// Test that we cannot convert from *-ptr to &S and &T (mut version)
let x: *mut S = &mut S;
let y: &S = x; //~ ERROR mismatched types
let y: &T = x; //~ ERROR mismatched types
//~^ ERROR the trait bound `*mut S: T` is not satisfied

// Test that we cannot convert an immutable ptr to a mutable one using *-ptrs
let x: &mut T = &S; //~ ERROR mismatched types
Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/issue-13058.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,5 @@ fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
fn main() {
check((3, 5));
//~^ ERROR mismatched types
//~| HELP try with `&(3, 5)`
}