about summary refs log tree commit diff
path: root/src/librustdoc/theme.rs
AgeCommit message (Collapse)AuthorLines
2024-11-28Fix new clippy lintsGuillaume Gomez-1/+1
2024-10-06Handle `librustdoc` cases of `rustc::potential_query_instability` lintismailarilik-17/+16
2024-07-29Reformat `use` declarations.Nicholas Nethercote-1/+1
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-2/+2
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-01-10Shorten some error invocations.Nicholas Nethercote-1/+1
- `struct_foo` + `emit` -> `foo` - `create_foo` + `emit` -> `emit_foo` I have made recent commits in other PRs that have removed some of these shortcuts for combinations with few uses, e.g. `struct_span_err_with_code`. But for the remaining combinations that have high levels of use, we might as well use them wherever possible.
2023-12-18Rename many `DiagCtxt` arguments.Nicholas Nethercote-2/+2
2023-12-18Rename `Handler` as `DiagCtxt`.Nicholas Nethercote-2/+2
2023-09-15rustdoc: merge theme css into rustdoc.cssMichael Howell-0/+3
Based on https://github.com/rust-lang/rust/pull/115812#issuecomment-1717960119 Having them in separate files used to make more sense, before the migration to CSS variables made the theme files as small as they are nowadays. This is already how docs.rs and mdBook do it.
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-1/+1
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2022-09-15Correctly handle parensGuillaume Gomez-7/+21
2022-09-14Remove duplicate warningsGuillaume Gomez-2/+0
2022-09-14Add check for missing CSS variablesGuillaume Gomez-2/+12
2022-09-14Simplify CSS parser to check themesGuillaume Gomez-205/+164
2022-06-07Update minifier version to 0.2.1Guillaume Gomez-0/+1
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-6/+6
2022-04-10rustdoc: Reduce allocations in a `theme` functionRoc Yu-7/+9
2021-12-14fix clippy::single_char_pattern perf findingsMatthias Krüger-5/+5
2021-05-03Change librustdoc write(.. \n) to writeln(..); fix comment in grammarmautamu-1/+1
More grammar
2021-01-09Replace under-used ImplPolarity enum with a booleanGuillaume Gomez-1/+4
2021-01-01clippy fixes for librustdocMatthias Krüger-5/+2
fixes clippy warnings of type: match_like_matches_macro or_fun_call op_ref needless_return let_and_return single_char_add_str useless_format unnecessary_sort_by match_ref_pats redundant_field_names
2020-11-15Make all rustdoc functions and structs crate-privateJoshua Nelson-6/+6
This gives warnings about dead code.
2020-04-02Expand and remove try_something macro.Alex Aktsipetrov-13/+7
Since https://github.com/rust-lang/rust/commit/2f6226518bd5085896a0f27cfd3ea396367ecd50 there has been only one invocation.
2020-03-21remove redundant returns (clippy::needless_return)Matthias Krüger-3/+1
2020-02-28use is_empty() instead of len() == x to determine if structs are empty.Matthias Krüger-1/+1
2020-02-24don't explicitly compare against true or falseMatthias Krüger-2/+2
2020-02-12Minify CSS rules to be able to handle minified theme files as wellGuillaume Gomez-14/+17
2020-01-10nix syntax::errors & prefer rustc_errors over errorsMazdak Farrokhzad-1/+1
2019-12-22Format the worldMark Rousskov-38/+30
2019-11-18Warn instead of failing for themesGuillaume Gomez-0/+1
2019-08-02librustdoc: Unconfigure tests during normal buildVadim Petrochenkov-106/+3
2019-06-20Improve theme checker by removing unneeded conditionsGuillaume Gomez-6/+14
2019-06-20Add test for empty css file checkGuillaume Gomez-0/+6
2019-06-20Fix theme-checker failureGuillaume Gomez-1/+1
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-07use top level `fs` functions where appropriateAndy Russell-7/+3
This commit replaces many usages of `File::open` and reading or writing with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code complexity, and will improve performance for most reads, since the functions allocate the buffer to be the size of the file. I believe that this commit will not impact behavior in any way, so some matches will check the error kind in case the file was not valid UTF-8. Some of these cases may not actually care about the error.
2018-09-02Auto merge of #53599 - matthiaskrgr:split_str__to__split_char, r=frewsxcvbors-1/+1
use char pattern for single-character splits: a.split("x") -> a.split('x')
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-4/+4
2018-08-22use char pattern for single-character splits: a.split("x") -> a.split('x')Matthias Krüger-1/+1
2018-05-14replace error/warning println with structured diagQuietMisdreavus-5/+9
2018-02-08Pass themes folder as parameterGuillaume Gomez-1/+1
2018-02-08Add tests for themesGuillaume Gomez-19/+39
2018-02-08Improve output a bit in case of errorGuillaume Gomez-4/+17
2018-02-08Handle comments in css selector and add testsGuillaume Gomez-23/+80
2018-02-08get differencesGuillaume Gomez-9/+40
2018-02-08Add theme testsGuillaume Gomez-0/+258