forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export information about used default methods instead of regenerating…
… it. Closes rust-lang#7862.
- Loading branch information
Showing
5 changed files
with
82 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// aux-build:trait_default_method_xc_aux.rs | ||
|
||
extern mod aux(name = "trait_default_method_xc_aux"); | ||
use aux::A; | ||
|
||
pub struct a_struct { x: int } | ||
|
||
impl A for a_struct { | ||
fn f(&self) -> int { 10 } | ||
} | ||
|
||
// This function will need to get inlined, and badness may result. | ||
pub fn welp<A>(x: A) -> A { | ||
let a = a_struct { x: 0 }; | ||
a.g(); | ||
x | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// xfail-fast | ||
// aux-build:trait_default_method_xc_aux.rs | ||
// aux-build:trait_default_method_xc_aux_2.rs | ||
|
||
|
||
extern mod aux(name = "trait_default_method_xc_aux"); | ||
extern mod aux2(name = "trait_default_method_xc_aux_2"); | ||
use aux::A; | ||
use aux2::{a_struct, welp}; | ||
|
||
|
||
fn main () { | ||
|
||
let a = a_struct { x: 0 }; | ||
let b = a_struct { x: 1 }; | ||
|
||
assert_eq!(0i.g(), 10); | ||
assert_eq!(a.g(), 10); | ||
assert_eq!(a.h(), 11); | ||
assert_eq!(b.g(), 10); | ||
assert_eq!(b.h(), 11); | ||
assert_eq!(A::lurr(&a, &b), 21); | ||
|
||
welp(&0); | ||
} |