Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Inherent methods should be on equal footing with trait methods #17282

Closed
pcwalton opened this issue Sep 15, 2014 · 3 comments
Closed

Inherent methods should be on equal footing with trait methods #17282

pcwalton opened this issue Sep 15, 2014 · 3 comments
Milestone

Comments

@pcwalton
Copy link
Contributor

No description provided.

@pcwalton
Copy link
Contributor Author

Nominating for 1.0 P-backcompat-lang

@pnkfelix
Copy link
Member

This seems like it needs an RFC.

But in any case, we want to do it.

P-backcompat-lang, 1.0 milestone.

@pnkfelix pnkfelix added this to the 1.0 milestone Sep 18, 2014
pcwalton added a commit to pcwalton/rust that referenced this issue Sep 26, 2014
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 rust-lang#17282.

[breaking-change]
bors added a commit that referenced this issue Sep 26, 2014
…g, 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
@pcwalton
Copy link
Contributor Author

Closing. I believe that we have done as much as we want to here with #17464 landed. Feel free to reopen if you believe something else should be done.

lnicola pushed a commit to lnicola/rust that referenced this issue Jun 23, 2024
…r=Veykril

Feat: hide double underscored symbols from symbol search

Fixes rust-lang#17272 by changing the default behavior of query to skip results that start with `__` (two underscores).

Not sure if this has any far reaching implications - a review would help to understand if this is the right place to do the filtering, and if it's fine to do it by default on the query.

If you type `__` as your search, then we'll show the matching double unders, just in case you actually need the symbol.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants