-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Move various checks to typeck so them failing causes the typeck result to get tainted #96046
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
Changes from all commits
31e0bf7
cb886cc
0fdaaad
0d88631
ac6b708
d5ffe11
46a2342
6ba8da6
4332c2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,8 +149,6 @@ pub enum InvalidProgramInfo<'tcx> { | |
/// (which unfortunately typeck does not reject). | ||
/// Not using `FnAbiError` as that contains a nested `LayoutError`. | ||
FnAbiAdjustForForeignAbi(call::AdjustForForeignAbiError), | ||
/// An invalid transmute happened. | ||
TransmuteSizeDiff(Ty<'tcx>, Ty<'tcx>), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's great. :D So does this also fix #79047 ? What about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar, but when I looked into it it was a different beast that I'll tackle seperately There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
yes, the corresponding test has been updated There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to keep the issue open for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think I saw an example when I removed that variant ^^ but I don't remember where There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I have opened #97477 for this. |
||
/// SizeOf of unsized type was requested. | ||
SizeOfUnsizedType(Ty<'tcx>), | ||
} | ||
|
@@ -166,11 +164,6 @@ impl fmt::Display for InvalidProgramInfo<'_> { | |
} | ||
Layout(ref err) => write!(f, "{}", err), | ||
FnAbiAdjustForForeignAbi(ref err) => write!(f, "{}", err), | ||
TransmuteSizeDiff(from_ty, to_ty) => write!( | ||
f, | ||
"transmuting `{}` to `{}` is not possible, because these types do not have the same size", | ||
from_ty, to_ty | ||
), | ||
SizeOfUnsizedType(ty) => write!(f, "size_of called on unsized type `{}`", ty), | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -273,6 +273,7 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { | |
error: &SelectionError<'tcx>, | ||
fallback_has_occurred: bool, | ||
) { | ||
self.set_tainted_by_errors(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this change anything? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. It avoids ICEs and bogus errors in CTFE. |
||
let tcx = self.tcx; | ||
let mut span = obligation.cause.span; | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.