Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b1529a6
Visit patterns' literal expressions before binding new idents
compiler-errors Dec 24, 2021
60a1abe
Rename `rustdoc::html::render::cache` to `search_index`
camelid Dec 28, 2021
e19593f
rustdoc: Remove some unnecessary `cache` parameters
camelid Dec 28, 2021
2b801dc
Move `ExternalLocation` to `clean::types`
camelid Dec 28, 2021
bd6692c
Make `search_index` functions private where possible
camelid Dec 28, 2021
afb77a9
Coalesce two arguments as `&Function`
camelid Dec 28, 2021
5c8e8e5
Give clearer names to several search index functions
camelid Dec 28, 2021
406d6d4
docs(error-codes): Add long error explanation for E0227
TmLev Dec 28, 2021
4391a11
Parse and suggest moving where clauses after equals for type aliases
jackh726 Dec 20, 2021
cbccc4a
Remove pretty printer space inside block with only outer attrs
dtolnay Dec 28, 2021
636d6a3
Only special case struct fields for intra-doc links, not enum variants
jyn514 Dec 18, 2021
ad29c17
Print space after formal generic params in fn type
dtolnay Dec 23, 2021
7d1ec64
Remove unused parameter
camelid Dec 28, 2021
09104ad
Explain why struct fields are handled by assoc. item code
camelid Dec 28, 2021
908a9d4
Add regression test for #59502
camelid Dec 28, 2021
e313143
Rollup merge of #92075 - jyn514:resolve-cleanup, r=camelid
matthiaskrgr Dec 29, 2021
bee1471
Rollup merge of #92118 - jackh726:type-alias-position-error, r=petroc…
matthiaskrgr Dec 29, 2021
f044c6c
Rollup merge of #92237 - compiler-errors:issue-92100, r=cjgillot
matthiaskrgr Dec 29, 2021
0e41194
Rollup merge of #92340 - camelid:search-index-cleanup, r=GuillaumeGomez
matthiaskrgr Dec 29, 2021
c82b2bc
Rollup merge of #92351 - TmLev:master, r=GuillaumeGomez
matthiaskrgr Dec 29, 2021
5583010
Rollup merge of #92371 - dtolnay:attrblock, r=oli-obk
matthiaskrgr Dec 29, 2021
949769c
Rollup merge of #92372 - dtolnay:fntype, r=jackh726
matthiaskrgr Dec 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Explain why struct fields are handled by assoc. item code
  • Loading branch information
camelid committed Dec 28, 2021
commit 09104adda4603be1aa734bd32c69dfdac006aadf
12 changes: 12 additions & 0 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,18 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
// FIXME: this doesn't really belong in `associated_item` (maybe `variant_field` is better?)
// NOTE: it's different from variant_field because it only resolves struct fields,
// not variant fields (2 path segments, not 3).
//
// We need to handle struct (and union) fields in this code because
// syntactically their paths are identical to associated item paths:
// `module::Type::field` and `module::Type::Assoc`.
//
// On the other hand, variant fields can't be mistaken for associated
// items because they look like this: `module::Type::Variant::field`.
//
// Variants themselves don't need to be handled here, even though
// they also look like associated items (`module::Type::Variant`),
// because they are real Rust syntax (unlike the intra-doc links
// field syntax) and are handled by the compiler's resolver.
let def = match tcx.type_of(did).kind() {
ty::Adt(def, _) if !def.is_enum() => def,
_ => return None,
Expand Down