about summary refs log tree commit diff
path: root/src/librustdoc/passes
AgeCommit message (Collapse)AuthorLines
2020-07-05Always resolve type@primitive as a primitive, not a moduleJoshua Nelson-5/+28
Previously, if there were a module in scope with the same name as the primitive, that would take precedence. Coupled with https://github.com/rust-lang/rust/issues/58699, this made it impossible to link to the primitive when that module was in scope. This approach could be extended so that `struct@foo` would no longer resolve to any type, etc. However, it could not be used for glob imports: ```rust pub mod foo { pub struct Bar; } pub enum Bar {} use foo::*; // This is expected to link to `inner::Bar`, but instead it will link to the enum. /// Link to [struct@Bar] pub struct MyDocs; ``` The reason for this is that this change does not affect the resolution algorithm of rustc_resolve at all. The only reason we could special-case primitives is because we have a list of all possible primitives ahead of time.
2020-07-02Fix linksGuillaume Gomez-1/+1
2020-06-26Fix debug messagesJoshua Nelson-3/+2
2020-06-26Generate docs for links to private items when passed --document-privateJoshua Nelson-9/+19
- Pass around document_private a lot more - Add tests + Add tests for intra-doc links to private items + Add ignored tests for warnings in reference links
2020-06-26Warn if linking to a private itemJoshua Nelson-3/+27
2020-06-11Rollup merge of #73183 - Manishearth:intra-doc-macro, r=GuillaumeGomezDylan DPC-28/+72
Support proc macros in intra doc link resolution The feature was written pre-proc macro resolution, so it only supported the wacky MBE resolution rules. This adds support for proc macros as well. cc @GuillaumeGomez Fixes #73173
2020-06-10Don't print bang diagnostics for derivesManish Goregaokar-1/+7
2020-06-10Avoid collisions between traits and their derive macrosManish Goregaokar-3/+26
2020-06-09intra-doc macro resolution should also handle proc macrosManish Goregaokar-24/+39
2020-06-09Fix more clippy warningsMatthias Krüger-1/+1
Fixes more of: clippy::unused_unit clippy::op_ref clippy::useless_format clippy::needless_return clippy::useless_conversion clippy::bind_instead_of_map clippy::into_iter_on_ref clippy::redundant_clone clippy::nonminimal_bool clippy::redundant_closure clippy::option_as_ref_deref clippy::len_zero clippy::iter_cloned_collect clippy::filter_next
2020-05-30Use `LocalDefId` instead of `NodeId` in `resolve_str_path_error`marmeladema-3/+3
2020-05-22Allow using `Self::` in docTymoteusz Jankowski-4/+50
2020-05-19Make intra-link resolve links for both trait and impl itemsTymoteusz Jankowski-26/+35
2020-05-13Make intra links work inside trait impl blockTymoteusz Jankowski-11/+55
2020-05-08Remove ast::{Ident, Name} reexports.Camille GILLOT-2/+2
2020-04-24Replace filter_map().next() calls with find_map()Josh Stone-2/+1
These are semantically the same, but `find_map()` is more concise.
2020-04-23Address comments from reviewmarmeladema-4/+2
2020-04-23Modify `as_local_hir_id` to return a bare `HirId`marmeladema-4/+2
2020-04-23Modify `as_local_hir_id` to accept a `LocalDefId` instead of a `DefId`marmeladema-1/+5
2020-04-23librustc_middle: return LocalDefId instead of DefId in local_def_idmarmeladema-1/+1
2020-04-23Create new rustdoc lint to check for code blocks tagsGuillaume Gomez-3/+5
2020-04-16Dogfood or_patterns in rustdocJosh Stone-6/+6
2020-04-14rustdoc: add "const_slice_ptr" and "mut_slice_ptr" trait implsMatthias Schiffer-0/+2
2020-04-14Rename AssocKind::Method to AssocKind::FnRustin-Liu-11/+12
Rename fn_has_self_argument to fn_has_self_parameter Rename AssocItemKind::Method to AssocItemKind::Fn Refine has_no_input_arg Refine has_no_input_arg Revert has_no_input_arg Refine suggestion_descr Move as_def_kind into AssocKind Signed-off-by: Rustin-Liu <rustin.liu@gmail.com> Fix tidy check issue Signed-off-by: Rustin-Liu <rustin.liu@gmail.com>
2020-04-05Stop importing int modules in librustdocLinus Färnstrand-1/+0
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-3/+3
2020-03-27clarify hir_id <-> node_id method namesBastian Kauschke-1/+1
2020-03-20remove redundant import (clippy::single_component_path_imports)Matthias Krüger-1/+0
remove redundant format!() call (clippy::useless_format) don't use ok() before calling expect() (clippy::ok_expect)
2020-03-19rustc: use LocalDefId instead of DefIndex in HirId.Eduard-Mihai Burtescu-1/+1
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-2/+2
2020-03-12Rollup merge of #69674 - mark-i-m:assoc-fn, r=matthewjasperMazdak Farrokhzad-2/+2
Rename DefKind::Method and TraitItemKind::Method r? @eddyb, @Centril, or @matthewjasper cc #69498 #60163
2020-03-03DefKind::Method -> DefKind::AssocFnMark Mansi-2/+2
2020-03-02Replace ToJson with serdeGuillaume Gomez-64/+26
2020-03-02Add support for json output in show-coverage optionGuillaume Gomez-3/+64
2020-03-01Auto merge of #69380 - Zoxc:parent-module, r=michaelwoeristerbors-1/+1
Use a query to get parent modules Split out from https://github.com/rust-lang/rust/pull/69015 / https://github.com/rust-lang/rust/pull/68944. r? @michaelwoerister
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-18/+18
2020-02-29Add a `parent_module_from_def_id` queryJohn Kåre Alsaker-1/+1
2020-02-24don't explicitly compare against true or falseMatthias Krüger-2/+2
2020-02-22Rename CodeMap to SourceMap follow upMaxim Zholobak-2/+2
2020-02-19Make lookup of associated item by name O(log n)Dylan MacKenzie-4/+4
2020-02-11Run RustFmtjumbatm-11/+11
2020-02-11Invert control in struct_lint_level.jumbatm-123/+125
Caller now passes in a `decorate` function, which is only run if the lint is allowed.
2020-02-08Make `associated_items` query return a sliceJonas Schievink-0/+1
2020-02-04remove redundant imports (clippy::single_component_path_imports)Matthias Krüger-1/+0
2020-02-011. move node_id to syntaxMazdak Farrokhzad-1/+1
2. invert rustc_session & syntax deps 3. drop rustc_session dep in rustc_hir
2020-01-17rustdoc: Catch fatal errors when syntax highlightingOliver Middleton-2/+3
For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-2/+2
2020-01-09Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomezYuki Okushi-47/+62
Distinguish between private items and hidden items in rustdoc I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document. This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another. Fixes #67851. Closes #60884.
2020-01-06Auto merge of #67886 - Centril:rustc_hir_canon_imports, r=nagisabors-11/+11
Nix `rustc_hir` reexports in rustc::hir r? @Zoxc cc @Mark-Simulacrum