- 19 11月, 2020 1 次提交
-
-
由 Nixon Enraght-Moony 提交于
-
- 18 11月, 2020 2 次提交
-
-
由 Joshua Nelson 提交于
- Add `Item::from_hir_id_and_kind` convenience wrapper - Make name parameter mandatory `tcx.opt_item_name` doesn't handle renames, so this is necessary for any item that could be renamed, which is almost all of them. - Override visibilities to be `Inherited` for enum variants `tcx.visibility` returns the effective visibility, not the visibility that was written in the source code. `pub enum E { A, B }` always has public variants `A` and `B`, so there's no sense printing `pub` again. - Don't duplicate handling of `Visibility::Crate` Instead, represent it as just another `Restricted` path.
-
由 Joshua Nelson 提交于
Visibility needs much less information than a full path, since modules can never have generics. This allows constructing a Visibility from only a DefId. Note that this means that paths are now normalized to their DefPath. In other words, `pub(self)` or `pub(super)` now always shows `pub(in path)` instead of preserving the original text.
-
- 15 11月, 2020 1 次提交
-
-
由 Wim Looman 提交于
-
- 13 11月, 2020 3 次提交
-
-
由 Alexis Bourget 提交于
-
由 Joshua Nelson 提交于
-
由 Joshua Nelson 提交于
Reusing bindings causes errors later in lowering: ``` error[E0596]: cannot borrow `vec` as mutable, as it is not declared as mutable --> /checkout/src/test/ui/async-await/argument-patterns.rs:12:20 | LL | async fn b(n: u32, ref mut vec: A) { | ^^^^^^^^^^^ | | | cannot borrow as mutable | help: consider changing this to be mutable: `mut vec` ```
-
- 12 11月, 2020 5 次提交
-
-
由 Guillaume Gomez 提交于
-
由 Poliorcetics 提交于
Co-authored-by: NJoshua Nelson <joshua@yottadb.com>
-
由 Alexis Bourget 提交于
-
由 Alexis Bourget 提交于
-
由 Bastian Kauschke 提交于
-
- 10 11月, 2020 1 次提交
-
-
由 Florian Warzecha 提交于
Previously the [src] link on types defined by a macro pointed to the macro definition. This commit makes the Clean-Implementation for Spans aware of macro defined types, so that the link points to the invocation instead.
-
- 03 11月, 2020 1 次提交
-
-
由 Wim Looman 提交于
-
- 29 10月, 2020 1 次提交
-
-
由 Guillaume Gomez 提交于
-
- 27 10月, 2020 1 次提交
-
-
由 Guillaume Gomez 提交于
-
- 26 10月, 2020 1 次提交
-
-
由 Florian Warzecha 提交于
-
- 14 10月, 2020 2 次提交
-
-
由 ayazhafiz 提交于
-
由 ayazhafiz 提交于
Today, given a static like `static mut FOO: usize = 1`, rustdoc would emit `static mut FOO: usize = 1`, as it emits both the mutability kw with a space and reserves a space after the mutability kw. This patch fixes that misformatting. This patch also adds some tests for emit of other statics, as I could not find an existing test devoted to statics.
-
- 12 10月, 2020 2 次提交
-
-
由 Guillaume Gomez 提交于
-
由 Joshua Nelson 提交于
This removes the unnecessary `DocFragmentKind::Divider` in favor of just using the logic I actually want in `collapse_docs`.
-
- 10 10月, 2020 4 次提交
-
-
由 Dániel Buga 提交于
-
由 Camelid 提交于
-
由 Guillaume Gomez 提交于
-
由 Guillaume Gomez 提交于
-
- 09 10月, 2020 1 次提交
-
-
由 Camelid 提交于
The contents of the generics will be mostly ignored (except for warning if fully-qualified syntax is used, which is currently unsupported in intra-doc links - see issue #74563). * Allow links like `Vec<T>`, `Result<T, E>`, and `Option<Box<T>>` * Allow links like `Vec::<T>::new()` * Warn on * Unbalanced angle brackets (e.g. `Vec<T` or `Vec<T>>`) * Missing type to apply generics to (`<T>` or `<Box<T>>`) * Use of fully-qualified syntax (`<Vec as IntoIterator>::into_iter`) * Invalid path separator (`Vec:<T>:new`) * Too many angle brackets (`Vec<<T>>`) * Empty angle brackets (`Vec<>`) Note that this implementation *does* allow some constructs that aren't valid in the actual Rust syntax, for example `Box::<T>new()`. That may not be supported in rustdoc in the future; it is an implementation detail.
-
- 08 10月, 2020 2 次提交
-
-
由 Joshua Nelson 提交于
- Make the parent module conditional on whether the docs are on a re-export - Make `resolve_link` take `&Item` instead of `&mut Item` Previously the borrow checker gave an error about multiple mutable borrows, because `dox` borrowed from `item`. - Fix `crate::` for re-exports `crate` means something different depending on where the attribute came from. - Make it work for `#[doc]` attributes too This required combining several attributes as one so they would keep the links.
-
由 Wim Looman 提交于
For sub-items on a page don't show cfg that has already been rendered on a parent item. At its simplest this means not showing anything that is shown in the portability message at the top of the page, but also for things like fields of an enum variant if that variant itself is cfg-gated then don't repeat those cfg on each field of the variant. This does not touch trait implementation rendering, as that is more complex and there are existing issues around how it deals with doc-cfg that need to be fixed first.
-
- 27 9月, 2020 2 次提交
-
-
由 Joshua Nelson 提交于
-
由 Joshua Nelson 提交于
This is not ideal because it means `deny(broken_intra_doc_links)` will no longer `deny(private_intra_doc_links)`. However, it can't be fixed with a new lint group, because `broken` is already in the `rustdoc` lint group; there would need to be a way to nest groups somehow. This also removes the early `return` so that the link will be generated even though it gives a warning.
-
- 24 9月, 2020 3 次提交
-
-
由 Joshua Nelson 提交于
Now that `PrimTy::name()` exists, there's no need to carry around the name of the primitive that failed to resolve. This removes the variants special-casing primitives in favor of `NotResolved`. - Remove `NoPrimitiveImpl` and `NoPrimitiveAssocItem` - Remove hacky `has_primitive` check in `resolution_failure()` - Fixup a couple tests that I forgot to `--bless` before
-
由 Joshua Nelson 提交于
- Add `PrimTy::name` and `PrimTy::name_str` - Use those new functions to distinguish between the name in scope and the canonical name - Fix diagnostics for primitive types - Add tests for primitives
-
由 Joshua Nelson 提交于
Previously, these were spread throughout the codebase. This had two drawbacks: 1. It caused the fast path to be slower: even if a link resolved, rustdoc would still perform various lookups for the error diagnostic. 2. It was inconsistent and didn't always give all diagnostics (https://github.com/rust-lang/rust/issues/76925) Now, diagnostics only perform expensive lookups in the error case. Additionally, the error handling is much more consistent, both in wording and behavior. - Remove `CannotHaveAssociatedItems`, `NotInScope`, `NoAssocItem`, and `NotAVariant` in favor of the more general `NotResolved` `resolution_failure` will now look up which of the four above categories is relevant, instead of requiring the rest of the code to be consistent and accurate in which it picked. - Remove unnecessary lookups throughout the intra-doc link pass. These are now done by `resolution_failure`. + Remove unnecessary `extra_fragment` argument to `variant_field()`; it was only used to do lookups on failure. + Remove various lookups related to associated items + Remove distinction between 'not in scope' and 'no associated item' - Don't perform unnecessary copies - Remove unused variables and code - Update tests - Note why looking at other namespaces is still necessary - 'has no inner item' -> 'contains no item' bless tests
-
- 13 9月, 2020 1 次提交
-
-
由 Lzu Tao 提交于
These tests will fall without the next commit.
-
- 12 9月, 2020 2 次提交
-
-
由 SlightlyOutOfPhase 提交于
-
由 SlightlyOutOfPhase 提交于
* Fix `const-display.rs` XPATH queries * Add `issue_76501.rs` test file * Rename issue_76501.rs to issue-76501.rs
-
- 04 9月, 2020 2 次提交
-
-
由 Joshua Nelson 提交于
- Preserve suffixes when displaying - Rename test file to match `intra-link*` - Remove unnecessary .clone()s - Improve comments and naming - Fix more bugs and add tests - Escape intra-doc link example in public documentation
-
由 Bastian Kauschke 提交于
-
- 03 9月, 2020 1 次提交
-
-
由 Joshua Nelson 提交于
Related to https://github.com/rust-lang/rust/issues/65354 - Pass through the replacement text to `markdown.rs` - Add some tests - Add a state machine that actually replaces the text when parsing Markdown
-
- 02 9月, 2020 1 次提交
-
-
由 Camelid 提交于
Fira Sans is what's used for module lists and other item lists. Previously, the default body font, "Source Serif Pro", was used for crate lists, which didn't visually match other item lists.
-