-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 #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); | ||
} |
002bfd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from pcwalton
at msullivan@002bfd7
002bfd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging msullivan/rust/default-methods = 002bfd7 into auto
002bfd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msullivan/rust/default-methods = 002bfd7 merged ok, testing candidate = 3a1db2d
002bfd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/479
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/482
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt/builds/484
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt-vg/builds/477
success: http://buildbot.rust-lang.org/builders/auto-mac-all-opt/builds/481
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/498
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt/builds/501
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/498
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt/builds/502
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt-vg/builds/507
success: http://buildbot.rust-lang.org/builders/auto-linux-all-opt/builds/500
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/482
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt/builds/497
success: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/275
002bfd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 3a1db2d