diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2014-09-22 17:38:49 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-09-26 13:02:47 -0700 |
| commit | 21df9c805f6e0101cff7a04391c6c5fcff8056df (patch) | |
| tree | 5242f7c1eae334e68e7709667a0f63b850e9beaf /src/rustllvm/PassWrapper.cpp | |
| parent | 5d653c17a656e8fe1572c7a695e33b188eda0597 (diff) | |
| download | rust-21df9c805f6e0101cff7a04391c6c5fcff8056df.tar.gz rust-21df9c805f6e0101cff7a04391c6c5fcff8056df.zip | |
librustc: Give trait methods accessible via fewer autoderefs priority
over inherent methods accessible via more autoderefs.
This simplifies the trait matching algorithm. It breaks code like:
impl Foo {
fn foo(self) {
// before this change, this will be called
}
}
impl<'a,'b,'c> Trait for &'a &'b &'c Foo {
fn foo(self) {
// after this change, this will be called
}
}
fn main() {
let x = &(&(&Foo));
x.foo();
}
To explicitly indicate that you wish to call the inherent method, perform
explicit dereferences. For example:
fn main() {
let x = &(&(&Foo));
(***x).foo();
}
Part of #17282.
[breaking-change]
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
