-
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
Make lang items private #72240
Comments
Here are my thoughts at the moment:
if Some(def_id) == tcx.lang_items().<item>() {
// some smart diagnostic
}
My feeling at the moment is that something along the lines of |
If we want to make it clear that this should only be used for diagnostics, we could name the function |
The easiest way might be to add |
I definitely agree that we need to make sure it's not misused, although refactoring this sort of thing
to use a modification like that to the |
I think we should use a custom return type, not |
I think we'd have to be careful with this as I imagine this is the sort of thing that will slip through almost all code reviews |
I really like this idea - although to make sure We could just bolt a |
Oh wow... that
I think the suggested idea is to make the |
Ahh okay I misunderstood... So the change would be something like:
|
That's what I had in mind, yes. I like avoiding the need for imports (e.g., |
Okay yeah - I really like that, I'll have a go at implementing it then |
@rustbot claim |
(Side note: discussing on the issue seems fine, but this seems like an MCP-worthy thing.) |
@nikomatsakis I spoke to @oli-obk about whether an MCP was necessary before I opened this issue but I don’t think either of us appreciated the amount of code this was going to effect and therefore didn’t think it was necessary. I don’t really know anything about the MCP process as I’ve been out of the loop for a while but I’m more than happy to learn about it and take this down that route. |
Triage: Hi, are you still working on this issue @doctorn? |
@rustbot release-assignment |
#72170 and #72216 put some effort in to try and prevent some potential ICEs that can occur in
#![no_core]
due to how we currently reference lang items.@oli-obk pointed out:
I'm opening this issue to start a discussion about how we could take this forward.
The text was updated successfully, but these errors were encountered: