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

Do not resolve inherent static methods from other crates prematurely #34871

Merged
merged 1 commit into from
Jul 17, 2016

Conversation

petrochenkov
Copy link
Contributor

Under some specific circumstances paths like Type::method can be resolved early in rustc_resolve instead of type checker. Type must be defined in another crate, it should be an enum or a trait object (i.e. a type that acts as a "module" in resolve), and method should be an inherent static method.
As a result, such paths don't go through resolve_ufcs, may be resolved incorrectly and break some invariants in type checker. This patch removes special treatment of such methods.

The removed code was introduced in 2bd46e7 to fix a problem that no longer exists.

r? @jseyfried

@jseyfried
Copy link
Contributor

Nice! @bors r+

@bors
Copy link
Contributor

bors commented Jul 16, 2016

📌 Commit f66da5e has been approved by jseyfried

Manishearth added a commit to Manishearth/rust that referenced this pull request Jul 17, 2016
Do not resolve inherent static methods from other crates prematurely

Under some specific circumstances paths like `Type::method` can be resolved early in rustc_resolve instead of type checker. `Type` must be defined in another crate, it should be an enum or a trait object (i.e. a type that acts as a "module" in resolve), and `method` should be an inherent static method.
As a result, such paths don't go through `resolve_ufcs`, may be resolved incorrectly and break some invariants in type checker. This patch removes special treatment of such methods.

The removed code was introduced in rust-lang@2bd46e7 to fix a problem that no longer exists.

r? @jseyfried
@bors
Copy link
Contributor

bors commented Jul 17, 2016

⌛ Testing commit f66da5e with merge 34f35ed...

bors added a commit that referenced this pull request Jul 17, 2016
Do not resolve inherent static methods from other crates prematurely

Under some specific circumstances paths like `Type::method` can be resolved early in rustc_resolve instead of type checker. `Type` must be defined in another crate, it should be an enum or a trait object (i.e. a type that acts as a "module" in resolve), and `method` should be an inherent static method.
As a result, such paths don't go through `resolve_ufcs`, may be resolved incorrectly and break some invariants in type checker. This patch removes special treatment of such methods.

The removed code was introduced in 2bd46e7 to fix a problem that no longer exists.

r? @jseyfried
@bors bors merged commit f66da5e into rust-lang:master Jul 17, 2016
@petrochenkov petrochenkov deleted the inherent branch September 21, 2016 20:03
@petrochenkov petrochenkov restored the inherent branch September 21, 2016 20:03
@petrochenkov petrochenkov deleted the inherent branch September 21, 2016 20:03
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

Successfully merging this pull request may close these issues.

3 participants