summary refs log tree commit diff
path: root/src/librustdoc/lib.rs
AgeCommit message (Collapse)AuthorLines
2020-08-23Use underscores instead of spacesJoshua Nelson-2/+2
2020-08-23Time how long it takes to render HTMLJoshua Nelson-5/+5
2020-08-22stabilize ptr_offset_fromRalf Jung-1/+0
2020-08-19Allow reusing the code in `collect_trait_impls`Joshua Nelson-0/+1
2020-08-05Auto merge of #75124 - nnethercote:clean-up-rustdoc-main, r=oli-obkbors-60/+51
Clean up rustdoc's `main()` It can be simplified and made more similar to rustc's `main()`. r? @oli-obk
2020-08-05Be smarter about error handling in `run()`.Nicholas Nethercote-4/+2
`run()` returns `Result<(), String>`. But on failure it always returns an empty string, and then `wrap_return()` treats an empty string specially, by not reporting the error. It turns out we already have the `ErrorReported` type for this sort of behaviour. This commit changes `run()` to use it.
2020-08-05Remove `setup_callbacks_and_run_in_default_thread_pool_with_globals()`.Nicholas Nethercote-1/+3
It's a very thin wrapper around `setup_callbacks_and_run_in_thread_pool_with_globals()` and it has a single call site.
2020-08-05Avoid an unnecessary thread creation at rustdoc startup.Nicholas Nethercote-55/+46
rustdoc's `main()` immediately spawns a thread, M, with a large stack (16MiB or 32MiB) on which it runs `main_args()`. `main_args()` does a small amount of options processing and then calls `setup_callbacks_and_run_in_default_thread_pool_with_globals()`, which spawns it own thread, and M is not used further. So, thread M seems unnecessary. However, it does serve a purpose: if the options processing in `main_args()` panics, that panic is caught when M is joined. So M can't simply be removed. However, `main_options()`, which is called by `main_args()`, has a `catch_fatal_errors()` call within it. We can move that call to `main()` and change it to the very similar `catch_with_exit_code()`. With that in place, M can be removed, and panics from options processing will still be caught appropriately. Even better, this makes rustdoc's `main()` match rustc's `main()`, which also uses `catch_with_exit_code()`. (Also note that the use of a 16MiB/32MiB stack was eliminated from rustc in #55617.)
2020-08-04Remove log alias from librustdocIvan Tham-1/+1
2020-08-02Fix logging for rustdocJoshua Nelson-1/+1
2020-07-31Make rustdoc share the logger initialization routine with rustc.Oliver Scherer-2/+2
2020-07-30Update driver to add json backendJoseph Ryan-14/+30
2020-07-29Refactor DocFS to fix error handling bugsJoseph Ryan-3/+8
2020-07-27More requested changesJoseph Ryan-3/+3
2020-07-27Make requested changesJoseph Ryan-1/+1
2020-07-27Extract `Cache` and other types from `html` moduleJoseph Ryan-13/+2
2020-07-27Refactor html backend to use generic interfaceJoseph Ryan-1/+4
2020-07-27Move `Error` and `RenderInfo` out of `html` moduleJoseph Ryan-1/+3
2020-07-15Don't ICE on infinitely recursive typesJoshua Nelson-0/+2
`evaluate_obligation` can only be run on types that are already valid. So rustdoc still has to run typeck even though it doesn't care about the result.
2020-07-15Don't ICE on errors in function returning impl traitJoshua Nelson-0/+1
Instead, report the error. This emits the errors on-demand, without special-casing `impl Trait`, so it should catch all ICEs of this kind, including ones that haven't been found yet. Since the error is emitted during type-checking there is less info about the error; see comments in the code for details. - Add test case for -> impl Trait - Add test for impl trait with alias - Move EmitIgnoredResolutionErrors to rustdoc This makes `fn typeck_item_bodies` public, which is not desired behavior. That change should be removed once https://github.com/rust-lang/rust/pull/74070 is merged. - Don't visit nested closures twice
2020-07-10Change some function names.Nicholas Nethercote-1/+4
A couple of these are quite long, but they do a much better job of explaining what they do, which was non-obvious before.
2020-07-10Eliminate `rust_input`.Nicholas Nethercote-31/+23
It has a single call site and having it as a separate (higher-order!) function makes the code harder to read.
2020-07-02Remove render-redirect-pages option in rustdocGuillaume Gomez-7/+0
2020-06-20Remove uses of `Vec::remove_item`Lukas Kalbertodt-1/+0
2020-06-13Clean up some weird command stringsGuillaume Gomez-9/+7
2020-05-09End unification of exit codes in librustdocGuillaume Gomez-9/+18
2020-05-08Clean up rustdoc source codeGuillaume Gomez-1/+7
2020-04-16Dogfood or_patterns in rustdocJosh Stone-0/+1
2020-04-11Depend on getopts from crates.ioLuca Barbieri-1/+1
rustc_session exports it for other crates to avoid mismatching crate versions.
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-1/+1
2020-03-24rustc: remove rustc_hir_pretty dependency.Mazdak Farrokhzad-0/+1
2020-03-23Rollup merge of #69494 - GuillaumeGomez:stabilize-crate-version, ↵Mazdak Farrokhzad-1/+1
r=ehuss,aleksator,ollie27 Stabilize --crate-version option in rustdoc I don't see any reason to not stabilize it anymore, so let's go! cc @kinnison @ehuss r? @ollie27
2020-03-16use direct imports for `rustc::{lint, session}`.Mazdak Farrokhzad-2/+2
2020-03-14Make downstream crates compile.Camille GILLOT-0/+1
2020-02-29Rename `syntax` to `rustc_ast` in source codeVadim Petrochenkov-1/+1
2020-02-29Make it build againVadim Petrochenkov-1/+1
2020-02-26Stabilize --crate-version option in rustdocGuillaume Gomez-1/+1
2020-02-16Other crates.Camille GILLOT-0/+1
2020-02-07Remove unused feature gates from librustdocbjorn3-4/+0
2020-02-01syntax::print -> new crate rustc_ast_prettyMazdak Farrokhzad-0/+1
2020-02-01Move builtin attribute logic to new rustc_attr crate.Mazdak Farrokhzad-0/+1
For now, this is all the crate contains, but more attribute logic & types will be moved there over time.
2020-01-18remove rustc_error_codes deps except in rustc_driverMazdak Farrokhzad-1/+0
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-0/+1
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-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-0/+1
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-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-2/+2
2020-01-09Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomezYuki Okushi-0/+3
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.