Last active
April 23, 2018 15:41
-
-
Save nikomatsakis/3cd6bf3f058cafa87675a5965428a8df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. | |
// ignore-test | |
// compile-pass | |
#![feature(infer_outlives_requirements)] | |
trait Trait<'x, T> where T: 'x { | |
} | |
// should infer that `A: 'a` | |
struct Foo<'a, A> { | |
foo: Box<dyn Trait<'a, A>> | |
} | |
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. | |
// ignore-test | |
// compile-pass | |
#![feature(infer_outlives_requirements)] | |
trait Trait<'x, T> where T: 'x { | |
type Type; | |
} | |
// should infer that `B: 'a` | |
struct Foo<'a, A, B> { | |
foo: <A as Trait<'a, B>>::Type | |
} | |
fn main() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. | |
// ignore-test | |
// compile-pass | |
#![feature(infer_outlives_requirements)] | |
trait Trait<'x, T> where Self: 'x { | |
type Type; | |
} | |
// should infer that `A: 'a` | |
struct Foo<'a, A, B> { | |
foo: <A as Trait<'a, B>>::Type | |
} | |
fn main() {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment