Skip to content

update infer to track expected/span for better error messages #3197

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

Closed
nikomatsakis opened this issue Aug 14, 2012 · 0 comments
Closed

update infer to track expected/span for better error messages #3197

nikomatsakis opened this issue Aug 14, 2012 · 0 comments
Labels
A-type-system Area: Type system C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@nikomatsakis
Copy link
Contributor

Right now, when processing a constraint (like T1 <: T2), infer does not track any sort of location information. It should be given a span and a boolean indicating which type (the super of sub type) should be referred to as the "expected type". This boolean value will be switch when we call contratys() or contraregions().

These changes would enable better error messages. We could get the "expected foo, found bar" messages more accurate, and we would be able to pass better spans into the (yet to be landed, as of this writing) new region inference, which could then describe more accurately to the user where conflicting constraints originate from.

RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 3, 2023
Rustup

also move some fail tests into suitable subdirectories
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…#3198)

Resolves rust-lang#3197 

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 and MIT licenses.

Co-authored-by: Remi Delmas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

1 participant