summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2020-03-09Fix null synthetic_implementors errorGuillaume Gomez-14/+16
2020-01-27don't clone types that are copy, round two.Matthias Krüger-7/+7
2020-01-22Auto merge of #68192 - GuillaumeGomez:remove-inlined-types, r=kinnisonbors-25/+50
Remove usage of global variable "inlined_types" r? @pietroalbini
2020-01-21Rollup merge of #68140 - ecstatic-morse:const-trait-bound-opt-out, r=oli-obkMazdak Farrokhzad-5/+9
Implement `?const` opt-out for trait bounds For now, such bounds are treated exactly the same as unprefixed ones in all contexts. [RFC 2632](https://github.com/rust-lang/rfcs/pull/2632) does not specify whether such bounds are forbidden outside of `const` contexts, so they are allowed at the moment. Prior to this PR, the constness of a trait bound/impl was stored in `TraitRef`. Now, the constness of an `impl` is stored in `ast::ItemKind::Impl` and the constness of a bound in `ast::TraitBoundModifer`. Additionally, constness of trait bounds is now stored in an additional field of `ty::Predicate::Trait`, and the combination of the constness of the item along with any `TraitBoundModifier` determines the constness of the bound in accordance with the RFC. Encoding the constness of impls at the `ty` level is left for a later PR. After a discussion in \#wg-grammar on Discord, it was decided that the grammar should not encode the mutual exclusivity of trait bound modifiers. The grammar for trait bound modifiers remains `[?const] [?]`. To encode this, I add a dummy variant to `ast::TraitBoundModifier` that is used when the syntax `?const ?` appears. This variant causes an error in AST validation and disappears during HIR lowering. cc #67794 r? @oli-obk
2020-01-20rustdoc: Correct order of `async` and `unsafe` in `async unsafe fn`sOliver Middleton-5/+5
2020-01-20Remove usage of global variable "inlined_types"Guillaume Gomez-25/+50
2020-01-20Add `ConstnessAnd` that implements `ToPredicate`Dylan MacKenzie-2/+2
2020-01-20Add `constness` field to `ty::Predicate::Trait`Dylan MacKenzie-3/+3
2020-01-20Add `MaybeConst` variant to `{ast,hir}::TraitBoundModifier`Dylan MacKenzie-0/+1
2020-01-19Add `constness` field to `hir::ItemKind::Impl`Dylan MacKenzie-0/+3
2020-01-20Rollup merge of #68357 - ollie27:rustdoc_test_errors, r=GuillaumeGomezDylan DPC-3/+7
rustdoc: Fix handling of compile errors when running `rustdoc --test` * Call `abort_if_errors` so all errors actually stop rustdoc. * Don't panic with "compiler aborted in rustdoc!", instead just exit to avoid the ugly panic message. * Use rlib as the crate type when searching for doctests matching what is used for doc generation so `#[no_std]` crates don't create "no global memory allocator" errors. Fixes #52243 Fixes #54010 r? @GuillaumeGomez
2020-01-20Rollup merge of #68353 - Centril:code-liberation, r=petrochenkovDylan DPC-1/+0
Remove `rustc_error_codes` deps except in `rustc_driver` Remove dependencies on `rustc_error_codes` in all crates except for `rustc_driver`. This has some benefits: 1. Adding a new error code when hacking on the compiler only requires rebuilding at most `rustc_error_codes`, `rustc_driver`, and the reflexive & transitive closure of the crate where the new error code is being added and its reverse dependencies. This improves time-to-UI-tests (TTUT). 2. Adding an error description to an error code only requires rebuilding `rustc_error_codes` and `rustc_driver`. This should substantially improve TTUT. r? @petrochenkov cc @rust-lang/wg-diagnostics
2020-01-20Rollup merge of #68326 - ollie27:rustdoc_hightlight_fatal_errors, ↵Dylan DPC-4/+6
r=GuillaumeGomez rustdoc: Catch fatal errors when syntax highlighting For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`. Fixes #56885 r? @GuillaumeGomez
2020-01-18rustdoc: Fix handling of compile errors when running `rustdoc --test`Oliver Middleton-3/+7
* Call `abort_if_errors` so all errors actually stop rustdoc. * Don't panic with "compiler aborted in rustdoc!", instead just exit to avoid the ugly panic message. * Use rlib as the crate type when searching for doctests matching what is used for doc generation so `#[no_std]` crates don't create "no global memory allocator" errors.
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-1/+0
2020-01-18Rollup merge of #68224 - GuillaumeGomez:prevent-urls-in-headings, r=ollie27Mazdak Farrokhzad-2/+5
Prevent urls in headings Fixes #68215. cc @pietroalbini @ollie27 r? @kinnison
2020-01-17Rollup merge of #68204 - ecstatic-morse:item-kind-impl, r=oli-obkTyler Mandry-15/+15
Use named fields for `{ast,hir}::ItemKind::Impl` Currently, the widely used `ItemKind::Impl` variant is a tuple with seven fields. I want to add an eighth in #68140, which means I have to update most matches on this variant anyways. Giving a name to each field improves readability and makes future changes of this nature much simpler. This change will cause several tools to break. I will fix them once this is merged.
2020-01-17Rollup merge of #68093 - GuillaumeGomez:fix-deref-impl-typedef, r=oli-obkTyler Mandry-25/+68
Fix deref impl typedef Fixes #35295. r? @kinnison
2020-01-17Use named fields for `hir::ItemKind::Impl`Dylan MacKenzie-15/+15
2020-01-17rustdoc: Catch fatal errors when syntax highlightingOliver Middleton-4/+6
For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.
2020-01-17formattingGuillaume Gomez-21/+19
2020-01-16don't clone types that are copyMatthias Krüger-1/+1
found via clippy
2020-01-16Improve code readabilityGuillaume Gomez-26/+10
2020-01-16Rollup merge of #68263 - ollie27:rustdoc_invalid_syntax_highlight_escape, ↵Dylan DPC-1/+1
r=GuillaumeGomez rustdoc: HTML escape codeblocks which fail syntax highlighting r? @GuillaumeGomez
2020-01-16Don't keep link title either, text is generated outside of the link tagGuillaume Gomez-2/+1
2020-01-15rustdoc: HTML escape codeblocks which fail syntax highlightingOliver Middleton-1/+1
2020-01-15Fix rendering on sidebar and update testsGuillaume Gomez-4/+4
2020-01-15Simplify deref impls for type aliasesGuillaume Gomez-39/+55
2020-01-15Include type alias implementationsGuillaume Gomez-21/+32
2020-01-15remove unneeded code from cache.rsGuillaume Gomez-14/+6
2020-01-15remove redundant clones, found by clippyMatthias Krüger-1/+1
2020-01-15formattingGuillaume Gomez-49/+28
2020-01-15Fix deref impl on type aliasGuillaume Gomez-27/+90
2020-01-14Prevent urls in headingsGuillaume Gomez-2/+6
2020-01-14Rollup merge of #68179 - JohnTitor:nll-scope, r=varkorYuki Okushi-32/+26
Remove unneeded scope Now, we can remove this scope.
2020-01-14Rollup merge of #68166 - ollie27:rustdoc_help_escape, r=GuillaumeGomezYuki Okushi-2/+2
rustdoc: HTML escape arrows on help popup r? @GuillaumeGomez
2020-01-14Rollup merge of #67989 - ollie27:rustdoc_unstable, r=GuillaumeGomezYuki Okushi-2/+1
rustdoc: Don't allow `#![feature(...)]` on stable or beta Fixes #67647 r? @GuillaumeGomez
2020-01-13Remove unneeded scopeYuki Okushi-32/+26
2020-01-13Auto merge of #67850 - GuillaumeGomez:err-codes-checkup, r=Mark-Simulacrumbors-2/+1
Error codes checkup and rustdoc test fix This PR does a few things: * fix how rustdoc checks that an error code has been thrown (it only checked for "E0XXX" so if it appeared in the output because the file has it in its name or wherever, it passed the test, which was incorrect) * fix the failing code examples that weren't throwing the expected error code
2020-01-13Rollup merge of #67959 - liigo:patch-13, r=GuillaumeGomezYuki Okushi-4/+8
rustdoc: improve stability mark arrows ### current ![old-stability-arrow](https://user-images.githubusercontent.com/346530/71863520-134d8b00-3138-11ea-86f9-a98068b3cff9.png) ### new ![new-stability-arrow](https://user-images.githubusercontent.com/346530/71863539-1b0d2f80-3138-11ea-843e-d79b9e5d9eec.png) ### new dark ![dark-stability-arrow](https://user-images.githubusercontent.com/346530/71863563-26f8f180-3138-11ea-9514-050e2c779f90.png)
2020-01-12rustdoc: HTML escape arrows on help popupOliver Middleton-2/+2
2020-01-12Rollup merge of #68089 - lzutao:revert-remote_item, r=sfacklerMazdak Farrokhzad-0/+1
Unstabilize `Vec::remove_item` As concerned by @kornelski, @LukasKalbertodt, and @gnzlbg in #40062. Reverts #67727
2020-01-12Rollup merge of #68045 - Centril:liberate-lints, r=Mark-SimulacrumMazdak Farrokhzad-1/+2
Move more of `rustc::lint` into `rustc_lint` Based on https://github.com/rust-lang/rust/pull/67806. Here we try to consolidate more of the linting infra into `rustc::lint`. Some high-level notes: - We now store an `Lrc<dyn Any + Send + Sync>` as opposed to `Lrc<LintStore>` in the `GlobalCtxt`. This enables us to avoid referring to the type, breaking a cyclic dependency, and so we can move things from `rustc::lint` to `rustc_lint`. - `in_derive_expansion` is, and needs to, be moved as a method on `Span`. - We reduce the number of ways on `tcx` to emit a lint so that the developer UX is more streamlined. - `LintLevelsBuilder` is moved to `rustc_lint::levels`, leaving behind `LintLevelMap/Set` in a purified form due to current constraints (hopefully fixable in the future after https://github.com/rust-lang/rust/pull/68133). - `struct_lint_level` is moved to `rustc::lint` due to current dependency constraints. - `rustc::lint::context` is moved to `rustc_lint::context`. - The visitors in `rustc::lint` are moved to `rustc_lint::passes`.
2020-01-11Auto merge of #67000 - spastorino:remove-promoted-from-place, r=oli-obkbors-2/+6
Promote references to constants instead of statics r? @oli-obk
2020-01-11Rollup merge of #68114 - ecstatic-morse:fix-feature-gating, r=CentrilMazdak Farrokhzad-1/+0
Don't require `allow_internal_unstable` unless `staged_api` is enabled. #63770 changed `qualify_min_const_fn` to require `allow_internal_unstable` for *all* crates that used an unstable feature, regardless of whether `staged_api` was enabled or the `fn` that used that feature was stably const. In practice, this meant that every crate in the ecosystem that wanted to use nightly features added `#![feature(const_fn)]`, which skips `qualify_min_const_fn` entirely. After this PR, crates that do not have `#![feature(staged_api)]` will only need to enable the feature they are interested in. For example, `#![feature(const_if_match)]` will be enough to enable `if` and `match` in constants. Crates with `staged_api` (e.g., `libstd`) require `#[allow_internal_unstable]` to be added to a function if it uses nightly features unless that function is also marked `#[rustc_const_unstable]`. This prevents proliferation of `#[allow_internal_unstable]` into functions that are not callable in a `const` context on stable. r? @oli-obk (author of #63770) cc @Centril
2020-01-11lints: promote levels.rs to lint.rs & extract passes.rsMazdak Farrokhzad-1/+2
2020-01-11Revert "Rollup merge of #67727 - Dylan-DPC:stabilise/remove_item, ↵Lzu Tao-0/+1
r=alexcrichton" This reverts commit 4ed415b5478c74094c2859abfddb959588cd6bb1, reversing changes made to 3cce950743e8aa74a4378dfdefbbc80223a00865.
2020-01-10Remove unnecessary `const_fn` feature gatesDylan MacKenzie-1/+0
This flag opts out of the min-const-fn checks entirely, which is usually not what we want. The few cases where the flag is still necessary have been annotated.
2020-01-10Fix print const on librustdocSantiago Pastorino-1/+1
2020-01-10Promote `Ref`s to constants instead of staticSantiago Pastorino-2/+6