Skip to content

Commit

Permalink
Auto merge of #30009 - apasel422:tests, r=alexcrichton
Browse files Browse the repository at this point in the history
Closes #25810.
Closes #29276.

r? @alexcrichton
  • Loading branch information
bors committed Nov 24, 2015
2 parents 2a0ce4a + c132736 commit 483fb8f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/test/run-pass/issue-25810.rs
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 0 deletions src/test/run-pass/issue-29276.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 483fb8f

Please sign in to comment.