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

Add TypeName::Error variant #269

Merged
merged 1 commit into from Oct 29, 2019

Conversation

@flodiebold
Copy link
Member

flodiebold commented Oct 27, 2019

This can be used (e.g. by rust-analyzer) as a placeholder for types where there
was an error e.g. during name resolution.

(I also considered making it a variant of Ty, but this seemed simpler.)

This can be used (e.g. by rust-analyzer) as a placeholder for types where there
was an error e.g. during name resolution.

(I also considered making it a variant of `Ty`, but this seemed simpler.)
Copy link
Collaborator

nikomatsakis left a comment

Interesting. This is certainly simple! I had originally expected a variant of Ty because I expected somewhat deeper integration -- for example, I thought that we might want unification of Error with other types to succeed, and so forth. But actually, as I think about it, that may not be what we want! That would cause us to (e.g.) consider all kinds of strange impls as being applicable in the case of error, rather than the current logic which will consider basically nothing as being applicable -- that then pushes the problem of errors up to rust-analyzer, which is probably where it belongs.

(I also worry that having wildcard types that unify with everything may mess up other bits of logic anyway.)

@nikomatsakis nikomatsakis merged commit bf1218c into rust-lang:master Oct 29, 2019
1 check passed
1 check passed
Travis CI - Pull Request Build Passed
Details
@nikomatsakis

This comment has been minimized.

Copy link
Collaborator

nikomatsakis commented Oct 29, 2019

Let's try it and see how it goes.

@flodiebold flodiebold deleted the flodiebold:typename-error branch Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.