Skip to content

Commit

Permalink
tests: update some compile-fail tests for the new behavior of type ex…
Browse files Browse the repository at this point in the history
…pectations.
  • Loading branch information
eddyb committed Jan 11, 2015
1 parent e73fbc6 commit 4748721
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/test/compile-fail/issue-15783.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ pub fn foo(params: Option<&[&str]>) -> usize {

fn main() {
let name = "Foo";
let msg = foo(Some(&[name.as_slice()]));
let x = Some(&[name.as_slice()]);
let msg = foo(x);
//~^ ERROR mismatched types: expected `core::option::Option<&[&str]>`
assert_eq!(msg, 3);
}
2 changes: 2 additions & 0 deletions src/test/compile-fail/regions-early-bound-error-method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ impl<'a> GetRef<'a> for Box<'a> {
impl<'a> Box<'a> {
fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
g2.get() //~ ERROR cannot infer an appropriate lifetime for automatic coercion due to
//~^ ERROR mismatched types: expected `&'a isize`, found `&'b isize` (lifetime mismatch)

}
}

Expand Down
1 change: 1 addition & 0 deletions src/test/compile-fail/regions-early-bound-error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl<'a,T:Clone> GetRef<'a,T> for Box<'a,T> {

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

fn main() {
Expand Down

12 comments on commit 4748721

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 11, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from nikomatsakis
at eddyb@4748721

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 11, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging 10 batched pull requests into batch

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 11, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status: {"merge_sha": "3a51b6737c8788bda2b888d83128790a1b78ab41", "rollup_pulls": [[20415, "474872160a49e4048e5017f0bbb8d93d19267b9a"], [20892, "074d9a679e751f5dcc0a67ffd313a1bf63585515"], [20899, "8af47508e9dcc9537468989ccf7f656024ead176"], [20903, "514497e347afa9e8e2d1766a9fd6c3e11511e2b1"], [20905, "6c9bdf2a11268325485478fbe3b1565c61098b05"], [20915, "c05338793b39539121ce9117d1b341d6529948ba"], [20920, "0568464d365266d583e3562835fcdb2be4cc7860"], [20926, "da15417b9d7d53cb24758d034a48cae4f4569215"], [20934, "6f45cb493ecc8b09104b12b9b51d86279a14b032"], [20956, "c989bd4ab7db24699dd2f8773964e03c751d80c7"]]}

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 11, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing rollup candidate = 3a51b67

Successful merges:

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from nikomatsakis
at eddyb@4748721

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging 20 batched pull requests into batch

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

status: {"merge_sha": "4bed1e8c0a433f30f85a01cd74d2251c73f590a2", "rollup_pulls": [[20415, "474872160a49e4048e5017f0bbb8d93d19267b9a"], [20820, "d4b70fe6c683a8a292353b60bdce40ecfe9f5962"], [20877, "6ff5ab1d01df014d8971bc74101b4a245bb8cf2d"], [20881, "4c78d2834446426b2dd3cc467f1324dacdc9042e"], [20883, "e4a2de7ed1a3d68c7f353da489d7242af75d8650"], [20895, "c871773f3258506fd71fbf70e54f3f63e5661f83"], [20898, "64b1a0da985aba36dc9d5726a93c66d8aa633fcb"], [20899, "8af47508e9dcc9537468989ccf7f656024ead176"], [20902, "e7e308f447eccb626f697b5d6d10b1c9e45839e4"], [20903, "514497e347afa9e8e2d1766a9fd6c3e11511e2b1"], [20905, "6c9bdf2a11268325485478fbe3b1565c61098b05"], [20915, "c05338793b39539121ce9117d1b341d6529948ba"], [20920, "0568464d365266d583e3562835fcdb2be4cc7860"], [20926, "da15417b9d7d53cb24758d034a48cae4f4569215"], [20930, "217cb6f131308f25ea7a6f66f8233b0cd46c581a"], [20933, "add92250383a3fcb5a8a74b4ac064ff06119e638"], [20934, "6f45cb493ecc8b09104b12b9b51d86279a14b032"], [20956, "c989bd4ab7db24699dd2f8773964e03c751d80c7"], [20966, "d355da6e6f30ab37bead7da5fc895de5b7047508"], [20968, "a9b01f6cbc5aa4d0335759fec369290b276d3aa5"]]}

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing rollup candidate = 4bed1e8

Successful merges:

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 4bed1e8

@bors
Copy link
Contributor

@bors bors commented on 4748721 Jan 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 4bed1e8

Please sign in to comment.