about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-02-19Update normalize.css to 8.0.1Jacob Hoffman-Andrews-232/+158
From https://github.com/necolas/normalize.css/releases/tag/8.0.1.
2021-02-19Replace normalize.css 3.0.0 with unminified version.Jacob Hoffman-Andrews-2/+423
This is in preparation to upgrade to 8.0.1, so the next commit can contain more meaningful diffs.
2021-02-19Show negative implementation of Sized traitGuillaume Gomez-90/+125
2021-02-19Auto merge of #82020 - jyn514:mut-passes, r=camelid,GuillaumeGomezbors-326/+284
Make `Clean` take &mut DocContext - Take `FnMut` in `rustc_trait_selection::find_auto_trait_generics` - Take `&mut DocContext` in most of `clean` - Collect the iterator in auto_trait_impls instead of iterating lazily; the lifetimes were really bad. This combined with https://github.com/rust-lang/rust/pull/82018 should hopefully help with https://github.com/rust-lang/rust/pull/82014 by allowing `cx.cache.exported_traits` to be modified in `register_res`. Previously it had to use interior mutability, which required either adding a RefCell to `cache.exported_traits` on *top* of the existing `RefCell<Cache>` or mixing reads and writes between `cx.exported_traits` and `cx.cache.exported_traits`. I don't currently have that working but I expect it to be reasonably easy to add after this.
2021-02-19[intra-doc links] Don't check feature gates of items re-exported across cratesJoshua Nelson-0/+3
It should be never break another crate to re-export a public item. Note that this doesn't check the feature gate at *all* for other crates: - Feature-gates aren't currently serialized, so the only way to check the gate is with ad-hoc attribute checking. - Checking the feature gate twice (once when documenting the original crate and one when documenting the current crate) seems not great. This should still catch using the feature most of the time though, since people tend to document their own crates.
2021-02-19Rollup merge of #82261 - ojeda:rustdoc-argfile, r=jyn514Dylan DPC-1/+4
rustdoc: Support argument files Factors out the `rustc_driver` logic that handles argument files so that rustdoc supports them as well, e.g.: rustdoc `@argfile` This is needed to be able to generate docs for projects that already use argument files when compiling them, e.g. projects that pass a huge number of `--cfg` arguments. The feature was stabilized for `rustc` in #66172.
2021-02-19rustdoc: Support argument filesMiguel Ojeda-1/+4
Factors out the `rustc_driver` logic that handles argument files so that rustdoc supports them as well, e.g.: rustdoc @argfile This is needed to be able to generate docs for projects that already use argument files when compiling them, e.g. projects that pass a huge number of `--cfg` arguments. The feature was stabilized for `rustc` in #66172. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2021-02-18Rollup merge of #82236 - matthiaskrgr:useless_conv, r=jyn514Dylan DPC-2/+2
avoid converting types into themselves (clippy::useless_conversion)
2021-02-17Remove query parameters when leaving search resultsGuillaume Gomez-1/+6
2021-02-17Rollup merge of #82207 - ehuss:rustdoc-2021, r=jyn514Guillaume Gomez-12/+2
rustdoc: treat edition 2021 as unstable This ensures that `--edition=2021` requires `-Z unstable-options` in rustdoc.
2021-02-17avoid converting types into themselves (clippy::useless_conversion)Matthias Krüger-2/+2
2021-02-16rustdoc: treat edition 2021 as unstableEric Huss-12/+2
2021-02-16Make `Clean` take &mut DocContextJoshua Nelson-250/+242
- Take `FnMut` in `rustc_trait_selection::find_auto_trait_generics` - Take `&mut DocContext` in most of `clean` - Collect the iterator in auto_trait_impls instead of iterating lazily; the lifetimes were really bad. - Changes `fn sess` to properly return a borrow with the lifetime of `'tcx`, not the mutable borrow.
2021-02-16Take `&mut DocContext` in passesJoshua Nelson-83/+49
This should hopefully allow for less interior mutability.
2021-02-16Auto merge of #81611 - cjgillot:meowner, r=estebankbors-59/+69
Only store a LocalDefId in some HIR nodes Some HIR nodes are guaranteed to be HIR owners: Item, TraitItem, ImplItem, ForeignItem and MacroDef. As a consequence, we do not need to store the `HirId`'s `local_id`, and we can directly store a `LocalDefId`. This allows to avoid a bit of the dance with `tcx.hir().local_def_id` and `tcx.hir().local_def_id_to_hir_id` mappings.
2021-02-16Rollup merge of #82163 - matthiaskrgr:slice, r=jyn514Guillaume Gomez-2/+2
avoid full-slicing slices If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
2021-02-16Rollup merge of #82145 - GuillaumeGomez:es5-checks, r=Nemo157Guillaume Gomez-6/+12
Fix ES5 errors (IE11) rustdoc is supposed to run on IE11 but someone reported me that it wasn't. I just confirmed it by using `es-check` with the `es5` option like this: ``` $ es-check es5 src/librustdoc/html/static/*.js ``` The PR fixes those issues and add CI checks to prevent regressions. `@Mark-Simulacrum:` I added checks in the CI, but not sure if it's the correct way to do it. Any help on that side would be very appreciated! r? `@Nemo157`
2021-02-16avoid full-slicing slicesMatthias Krüger-2/+2
If we already have a slice, there is no need to get another full-range slice from that, just use the original. clippy::redundant_slicing
2021-02-15Trait impls are Items, therefore HIR owners.Camille GILLOT-2/+2
2021-02-15Only store a LocalDefId in hir::MacroDef.Camille GILLOT-4/+4
2021-02-15Index Modules using their LocalDefId.Camille GILLOT-3/+2
2021-02-15Only store a LocalDefId in hir::ForeignItem.Camille GILLOT-6/+12
2021-02-15Only store a LocalDefId in hir::ImplItem.Camille GILLOT-5/+11
2021-02-15Only store a LocalDefId in hir::TraitItem.Camille GILLOT-4/+10
2021-02-15Only store a LocalDefId in hir::Item.Camille GILLOT-28/+21
Items are guaranteed to be HIR owner.
2021-02-15Use ItemId as a strongly typed index.Camille GILLOT-7/+7
2021-02-15Rollup merge of #82096 - TaKO8Ki:fix-typo, r=GuillaumeGomezJonas Schievink-1/+1
Fix a typo This pull request fixes a typo.
2021-02-15Fix ES5 errors (IE11)Guillaume Gomez-6/+12
2021-02-14Rollup merge of #81891 - CraftSpider:fn-header, r=jyn514Dylan DPC-11/+27
[rustdoc-json] Make `header` a vec of modifiers, and FunctionPointer consistent Bumps version number and adds tests, this is a breaking change. I can split this into two (`is_unsafe` -> `header` and `header: Vec<Modifiers>`) if desired. Rationale: Modifiers are individual notes on a function, it makes more sense for them to be a list of an independent enum over a String which is inconsistently exposing the HIR representation (prefix_str vs custom literals). Function pointers currently only support `unsafe`, but there has been talk on and off about allowing them to also support `const`, and this makes handling their modifiers consistent with handling those of a function, allowing better shared code. `@rustbot` modify labels: +A-rustdoc-json +T-rustdoc CC: `@HeroicKatora` r? `@jyn514`
2021-02-14bumped smallvec depsklensy-1/+1
2021-02-14fix typoTakayuki Maeda-1/+1
2021-02-13Rollup merge of #82033 - magurotuna:issue82016, r=jyn514Yuki Okushi-17/+16
Refactor `get_word_attr` to return only `Option` This commit removes `bool` from the return type of `NestedAttributesExt::get_word_attr` so it will return only `Option<ast::NestedMetaItem>` for less redundancy. Closes #82016 r? `@jyn514`
2021-02-12Modifiers -> QualifiersRune Tynan-5/+5
2021-02-12Rollup merge of #79775 - jyn514:doctest, r=GuillaumeGomezDylan DPC-6/+9
Fix injected errors when running doctests on a crate named after a keyword Closes https://github.com/rust-lang/rust/issues/79771
2021-02-13Rename to `inline_attr` and use if-let to extract `NestedMetaItem`Yusuke Tanaka-12/+13
2021-02-13Refactor `get_word_attr` to return only `Option`Yusuke Tanaka-7/+5
2021-02-12Rollup merge of #82011 - jyn514:warn-private-assoc-item, r=max-hellerYuki Okushi-4/+5
Fix private intra-doc warnings on associated items The issue was that the `kind, id` override was previously only being considered for the disambiguator check, not the privacy check. This uses the same ID for both. Fixes https://github.com/rust-lang/rust/issues/81981. r? ``@max-heller``
2021-02-12Rollup merge of #82004 - GuillaumeGomez:clean-static-struct, r=jyn514Yuki Okushi-71/+63
clean up clean::Static struct Having a `String` for the expression didn't make much sense, and even less when it's actually not used (except in json so I kept it). r? ``@jyn514``
2021-02-12Rollup merge of #81964 - lovasoa:patch-1, r=GuillaumeGomezYuki Okushi-23/+8
Fix documentation not showing on localStorage error Fixes https://github.com/rust-lang/rust/issues/81928 The [documentation for setItem](https://developer.mozilla.org/en-US/docs/Web/API/Storage/setItem) specifies: > developers should make sure to always catch possible exceptions from setItem()
2021-02-12Rollup merge of #81831 - LeSeulArtichaut:81289-mut-arg, r=camelidYuki Okushi-1/+68
Don't display `mut` in arguments for functions documentation Fixes #81289 by reverting #80799, as requested in https://github.com/rust-lang/rust/pull/81328#issuecomment-766364413. Supersedes #81328. r? ``@camelid`` cc ``@jyn514``
2021-02-12[librustdoc] Reform lang string token splittingCasey Rodarmor-7/+71
Only split doctest lang strings on `,`, ` `, and `\t`. Additionally, to preserve backwards compatibility with pandoc-style langstrings, strip a surrounding `{}`, and remove leading `.`s from each token. Prior to this change, doctest lang strings were split on all non-alphanumeric characters except `-` or `_`, which limited future extensions to doctest lang string tokens, for example using `=` for key-value tokens. This is a breaking change, although it is not expected to be disruptive, because lang strings using separators other than `,` and ` ` are not very common
2021-02-11Fix private intra-doc warnings on associated itemsJoshua Nelson-4/+5
The issue was that the `kind, id` override was previously only being considered for the disambiguator check, not the privacy check. This uses the same ID for both.
2021-02-11Fix injected errors when running doctests on a crate named after a keywordJoshua Nelson-6/+9
Unfortunately, this can't currently be tested. The problem is that we need the file to be compiled first to then be used as dependency, which cannot be done currently unfortunately in the rustdoc test suites. Example: ```rust // name this file "foo.rs" /// ``` /// let x = foo::foo(); /// ``` pub fn foo() {} ``` If you run `rustdoc --test foo.rs`, you'll get: ``` running 1 test test foo.rs - foo (line 1) ... FAILED failures: ---- foo.rs - foo (line 1) stdout ---- error[E0463]: can't find crate for `foo` --> foo.rs:0:1 | 2 | extern crate foo; | ^^^^^^^^^^^^^^^^^ can't find crate ``` If a test were possible, it would look something like ````rust #![crate_name = "mod"] #![crate_type = "lib"] //! ``` //! // NOTE: requires that the literal string 'mod' appears in the doctest for //! // the bug to appear //! assert_eq!(1, 1); //! ``` ````
2021-02-11clean up clean::Static structGuillaume Gomez-71/+63
2021-02-10Do not ICE on range patterns in function argumentsLeSeulArtichaut-4/+1
2021-02-10Fix getCurrentValueOphir LOJKINE-1/+1
2021-02-10Catch errors on localStorage setting failureOphir LOJKINE-23/+8
Fixes https://github.com/rust-lang/rust/issues/81928 “Ask forgiveness not permission” : this makes the code both simpler and more robust
2021-02-09Stabilize str_split_onceJacob Pratt-1/+0
2021-02-09Update Markdown unit testsCamelid-5/+5
2021-02-09Rename HIR UnOp variantsÖmer Sinan Ağacan-1/+1
This renames the variants in HIR UnOp from enum UnOp { UnDeref, UnNot, UnNeg, } to enum UnOp { Deref, Not, Neg, } Motivations: - This is more consistent with the rest of the code base where most enum variants don't have a prefix. - These variants are never used without the `UnOp` prefix so the extra `Un` prefix doesn't help with readability. E.g. we don't have any `UnDeref`s in the code, we only have `UnOp::UnDeref`. - MIR `UnOp` type variants don't have a prefix so this is more consistent with MIR types. - "un" prefix reads like "inverse" or "reverse", so as a beginner in rustc code base when I see "UnDeref" what comes to my mind is something like "&*" instead of just "*".