]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #18105 : nikomatsakis/rust/issue-18055, r=pcwalton
authorbors <bors@rust-lang.org>
Sat, 18 Oct 2014 15:12:11 +0000 (15:12 +0000)
committerbors <bors@rust-lang.org>
Sat, 18 Oct 2014 15:12:11 +0000 (15:12 +0000)
Check object lifetime bounds in coercions, not just trait bounds.  Fixes #18055.

r? @pcwalton

This is a [breaking change]. Change code like this:

    fn foo(v: &[u8]) -> Box<Clone+'static> { ... }

to make the lifetimes agree:

    // either...
    fn foo(v: &'static[u8]) -> Box<Clone+'static> { box v }

    // or ...
    fn foo<'a>(v: &'a [u8]) -> Box<Clone+'a> { box v }

1  2 
src/librustc/middle/typeck/check/mod.rs