Skip to content

Conversation

@nikomatsakis
Copy link
Contributor

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 }

bors added a commit that referenced this pull request Oct 18, 2014
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 }
@bors bors closed this Oct 18, 2014
@bors bors merged commit 7876cf9 into rust-lang:master Oct 18, 2014
@nikomatsakis nikomatsakis deleted the issue-18055 branch March 30, 2016 16:13
lnicola pushed a commit to lnicola/rust that referenced this pull request Sep 25, 2024
fix: Faulty notifications should not bring down the server

Fixes rust-lang/rust-analyzer#18055, if a client sends us an unregistered document path in a did save notification it would force us to exit the thread. That is obviously not great behavior, we should be more fallible here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trait objects can be created with lifetime bounds that ignore input lifetimes

3 participants