]> git.lizzy.rs Git - rust.git/commit
auto merge of #17464 : pcwalton/rust/inherent-methods-on-equal-footing, r=nikomatsakis
authorbors <bors@rust-lang.org>
Fri, 26 Sep 2014 21:47:47 +0000 (21:47 +0000)
committerbors <bors@rust-lang.org>
Fri, 26 Sep 2014 21:47:47 +0000 (21:47 +0000)
commitd64b4103d688f38c2e9e2daf966d50beeb383f1e
tree5242f7c1eae334e68e7709667a0f63b850e9beaf
parent5d653c17a656e8fe1572c7a695e33b188eda0597
parent21df9c805f6e0101cff7a04391c6c5fcff8056df
auto merge of #17464 : pcwalton/rust/inherent-methods-on-equal-footing, r=nikomatsakis

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]

r? @nikomatsakis