Skip to content

Commit 4748721

Browse files
committed
tests: update some compile-fail tests for the new behavior of type expectations.
1 parent e73fbc6 commit 4748721

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/test/compile-fail/issue-15783.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ pub fn foo(params: Option<&[&str]>) -> usize {
1414

1515
fn main() {
1616
let name = "Foo";
17-
let msg = foo(Some(&[name.as_slice()]));
17+
let x = Some(&[name.as_slice()]);
18+
let msg = foo(x);
1819
//~^ ERROR mismatched types: expected `core::option::Option<&[&str]>`
1920
assert_eq!(msg, 3);
2021
}

src/test/compile-fail/regions-early-bound-error-method.rs

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ impl<'a> GetRef<'a> for Box<'a> {
2828
impl<'a> Box<'a> {
2929
fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
3030
g2.get() //~ ERROR cannot infer an appropriate lifetime for automatic coercion due to
31+
//~^ ERROR mismatched types: expected `&'a isize`, found `&'b isize` (lifetime mismatch)
32+
3133
}
3234
}
3335

src/test/compile-fail/regions-early-bound-error.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {
2727

2828
fn get<'a,'b,G:GetRef<'a, isize>>(g1: G, b: &'b isize) -> &'b isize {
2929
g1.get() //~ ERROR cannot infer an appropriate lifetime for automatic coercion due to
30+
//~^ ERROR mismatched types: expected `&'b isize`, found `&'a isize` (lifetime mismatch)
3031
}
3132

3233
fn main() {

0 commit comments

Comments
 (0)