-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Simplify utils::match_def_path
, removing a FIXME
#4508
Conversation
We can actually start getting rid of these string paths. The compiler now has support for diagnostic items. Look at the Debug trait to see how to change libcore to have more diag items |
See Oli's comment :) |
I see how declaring diagnostic items will help, but that refactoring will be a larger one. This PR can still be useful in the meantime. |
Oh, I thought it could have been a more granular change. Let's get this merged for now @bors r+ |
📌 Commit 72058a6 has been approved by |
Simplify `utils::match_def_path`, removing a FIXME changelog: none This removes the `Vec<Symbol>` allocation. We still need to call `cx.get_def_path`, but this should already have been interned, and I don't see how we can keep ergonomics of that function without allocating a `Vec`. r? @phansch
@oli-obk: So do we go through |
☀️ Test successful - checks-travis, status-appveyor |
The entries in sym are entirely independent of the names we can use for diagnostic items. If there's already an entry in sym, don't add a new one. Just invent any name you think fits for the item. If it doesn't exist in sym yet, that's fine, either add it or let clippy generate the symbol from a string. I think we could go with not adding anything to the sym list for now |
OK, how do I find out what an item in |
You don't. The sym list has nothing to do with items. It's just interned names. Ignore the sym list. It's just a perf improvement, not a necessity |
I see. I tried this for |
changelog: none
This removes the
Vec<Symbol>
allocation. We still need to callcx.get_def_path
, but this should already have been interned, and I don't see how we can keep ergonomics of that function without allocating aVec
.r? @phansch