-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 TyCtxtAt::{ty_error, ty_error_with_message}
#73176
Conversation
src/librustc_middle/ty/context.rs
Outdated
self.sess.delay_span_bug(self.span, msg); | ||
self.mk_ty(Error(super::sty::DelaySpanBugEmitted(()))) |
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.
self.sess.delay_span_bug(self.span, msg); | |
self.mk_ty(Error(super::sty::DelaySpanBugEmitted(()))) | |
self.tcx.ty_error_with_message(self.span, msg) |
Perhaps I'm missing something?
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.
No I'm just dumb :P
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 change doesn't seem to have been made?
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 change still hasn't been made?
I'm personally ok with merging this into my PR, but I don't know whether @eddyb or the compiler team would want it separate. |
☔ The latest upstream changes (presumably #73369) made this pull request unmergeable. Please resolve the merge conflicts. |
This is unblocked now |
I’ll rebase as soon as I can. |
844ef78
to
31d79c8
Compare
Rebased. |
cc @varkor (who reviewed my PR too) |
☔ The latest upstream changes (presumably #73180) made this pull request unmergeable. Please resolve the merge conflicts. |
src/librustc_middle/ty/context.rs
Outdated
#[track_caller] | ||
pub fn ty_error_with_message(self, msg: &str) -> Ty<'tcx> { | ||
self.sess.delay_span_bug(self.span, msg); | ||
self.mk_ty(Error(super::sty::DelaySpanBugEmitted(()))) |
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.
I'm worried about DelaySpanBugEmitted
being defined in ty::sty
, maybe it should be defined in ty::context
so that only ty::context
can create it.
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.
I think the reason I put it where I did is that it needs to be in the type definition of TyKind
...
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.
@mark-i-m that's where it needs to be used, but it's a public type, you can use it from anywhere.
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.
31d79c8
to
a53f176
Compare
a53f176
to
30fa84e
Compare
@eddyb Just pushed to resolve the previous review. Sorry for being so slow! |
@bors r+ |
📌 Commit 30fa84e has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Only e2d957d was added, the rest comes from #70551.I was unsure where to put the implementation for those methods, please tell me if there is a better place for it.
Closes #72619,
blocked on #70551.r? @eddyb cc @mark-i-m, maybe this should be part of #70551? If so feel free to cherry-pick or ask me to file a PR against your fork.