-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
More Queries for Crate Metadata #41724
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4d7c0b6
all queries use dep nodes
hackeryarn a12a55f
item_attrs
hackeryarn c72a16b
fn_arg_names
hackeryarn aa5a532
trait_of_item
hackeryarn 03fe10d
impl_parent
hackeryarn 5b71d76
moved metadata provider impls to decoder
hackeryarn 5a7946d
is_foreign_item
hackeryarn d561d4c
propper trait of item impl
hackeryarn 1f532bf
is_exported_symbol
hackeryarn dfb740f
removed unnecessary if
hackeryarn 35812d1
resolved merge conflicts
hackeryarn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -119,6 +119,7 @@ provide! { <'tcx> tcx, def_id, cdata | |
// This is only used by rustdoc anyway, which shouldn't have | ||
// incremental recompilation ever enabled. | ||
fn_arg_names => { cdata.get_fn_arg_names(def_id.index) } | ||
trait_of_item => { cdata.get_trait_of_item(def_id.index) } | ||
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. ...and I expected this code to run for other crates. |
||
item_body_nested_bodies => { | ||
let map: BTreeMap<_, _> = cdata.entry(def_id.index).ast.into_iter().flat_map(|ast| { | ||
ast.decode(cdata).nested_bodies.decode(cdata).map(|body| (body.id(), body)) | ||
|
@@ -174,11 +175,6 @@ impl CrateStore for cstore::CStore { | |
self.get_crate_data(impl_def.krate).get_parent_impl(impl_def.index) | ||
} | ||
|
||
fn trait_of_item(&self, def_id: DefId) -> Option<DefId> { | ||
self.dep_graph.read(DepNode::MetaData(def_id)); | ||
self.get_crate_data(def_id.krate).get_trait_of_item(def_id.index) | ||
} | ||
|
||
fn associated_item_cloned(&self, def: DefId) -> ty::AssociatedItem | ||
{ | ||
self.dep_graph.read(DepNode::MetaData(def)); | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Er, wait, this seems surprising. What is going on here exactly?
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 I expected this code to only run when the krate is
LOCAL_CRATE
, no?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.
Isn't that what this is doing? This returns
None
if it's not aLOCAL_CRATE
.