-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Report infer ty errors during hir ty lowering #142420
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
base: master
Are you sure you want to change the base?
Conversation
impl ForeignItemKind<'_> { | ||
pub fn descr(&self) -> &'static str { | ||
match self { | ||
ForeignItemKind::Fn(..) => "function", | ||
ForeignItemKind::Static(..) => "static variable", | ||
ForeignItemKind::Type => "type", | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could probably just use tcx.def_descr
, but it causes a lot of diffs across the test suite because it calls associated functions associated functions
or methods
respectively
//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for functions | ||
//~^ ERROR: the placeholder `_` is not allowed within types on item signatures for opaque types | ||
//~| ERROR: the placeholder `_` is not allowed within types on item signatures for opaque types | ||
//~| ERROR: the placeholder `_` is not allowed within types on item signatures for opaque types | ||
//~| ERROR: the placeholder `_` is not allowed within types on item signatures for opaque types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is a bit dumb, but I could special case Synthetic
things separately handle opaque types to also check if they are part of an afit
17b63c8
to
993b819
Compare
impl Drop for ItemCtxt<'_> { | ||
fn drop(&mut self) { | ||
_ = self.check_tainted_by_errors(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only type_of invokes check_tainted_by_errors
as it's the only ItemCtxt using query that actually has a way to report errors
993b819
to
b4492d2
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #142438) made this pull request unmergeable. Please resolve the merge conflicts. |
b4492d2
to
e7c1ba8
Compare
This PR changes a file inside |
based on #142449 as the crashes tests were "fixed" by this PR only in as much as that they stopped ICEing, but the error message was referring to |
This centralizes the placeholder type error reporting in one location, but it also exposes the granularity at which we convert things from hir to ty more. E.g. previously infer types in where bounds were errored together with the function signature, but now they are independent.
e7c1ba8
to
fb8cfca
Compare
This centralizes the placeholder type error reporting in one location, but it also exposes the granularity at which we convert things from hir to ty more. E.g. previously infer types in where bounds were errored together with the function signature, but now they are independent.
r? @compiler-errors