parent
69b8e74c31
commit
c132736002
35
src/test/run-pass/issue-25810.rs
Normal file
35
src/test/run-pass/issue-25810.rs
Normal file
@ -0,0 +1,35 @@
|
||||
// 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.
|
||||
|
||||
fn main() {
|
||||
let x = X(15);
|
||||
let y = x.foo();
|
||||
println!("{:?}",y);
|
||||
}
|
||||
|
||||
trait Foo {
|
||||
fn foo<'a>(&'a self) -> <&'a Self as Bar>::Output;
|
||||
}
|
||||
|
||||
trait Bar {
|
||||
type Output;
|
||||
}
|
||||
|
||||
struct X(i32);
|
||||
|
||||
impl<'a> Bar for &'a X {
|
||||
type Output = &'a i32;
|
||||
}
|
||||
|
||||
impl Foo for X {
|
||||
fn foo<'a>(&'a self) -> <&'a Self as Bar>::Output {
|
||||
&self.0
|
||||
}
|
||||
}
|
13
src/test/run-pass/issue-29276.rs
Normal file
13
src/test/run-pass/issue-29276.rs
Normal file
@ -0,0 +1,13 @@
|
||||
// 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.
|
||||
|
||||
struct S([u8; { struct Z; 0 }]);
|
||||
|
||||
fn main() {}
|
Loading…
x
Reference in New Issue
Block a user