Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Region parameterization inference does not play well with explicit self #5224

Closed
nikomatsakis opened this issue Mar 4, 2013 · 0 comments
Closed

Comments

@nikomatsakis
Copy link
Contributor

Right now the compiler incorrectly infers that a trait like:

trait Foo {
    fn get_foo(&self) -> &self/int;
}

must be region parameterized. This leads to various errors, for example using the Map trait. This will be a non-issue once the new region syntax is complete, because region parameterization will be explicit, but it's causing issues now. I've got a patch I was going to push as part of a larger pull request but due to the fact that I'm having trouble landing that big patch I am breaking it up into bits, and hence opening a separate issue for this.

nikomatsakis added a commit to nikomatsakis/rust that referenced this issue Mar 5, 2013
explicit self doesn't incorrectly cause the entire trait to
be tagged as being region-parameterized.

Fixes rust-lang#5224.
bors added a commit that referenced this issue Mar 5, 2013
Update region inference for traits so that a method with explicit self doesn't incorrectly cause the entire trait to be tagged as being region-parameterized.

Fixes #5224.

r? @pcwalton
bors added a commit to rust-lang-ci/rust that referenced this issue May 2, 2020
Detect usage of custom floating-point abs implementation

Closes rust-lang#5224

changelog: Enhance [`suboptimal_flops`] lint to detect manual implementations of the `abs` method
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant