about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2022-09-22Rollup merge of #102037 - jyn514:normalize-docs, r=lcnrDylan DPC-0/+1
Make cycle errors recoverable In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation. In the past, ```@jackh726``` has said we need to be careful about overflow errors: https://github.com/rust-lang/rust/pull/91430#issuecomment-983997013 > Off the top of my head, we definitely should be careful about treating overflow errors the same as "not implemented for some reason" errors. Otherwise, you could end up with behavior that is different depending on recursion depth. But, that might be context-dependent. But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered. Helps with https://github.com/rust-lang/rust/issues/81091. r? ```@lcnr``` cc ```@matthewjasper```
2022-09-19Make the `normalize-overflow` rustdoc test actually do somethingJoshua Nelson-0/+2
Since https://github.com/rust-lang/rust/pull/88679, rustdoc doesn't load crates eagerly. Add an explicit `extern crate` item to make sure the crate is loaded and the bug reproduces. You can verify this fix by adding `// compile-flags: -Znormalizing-docs` and running the test.
2022-09-19Make cycle errors recoverableJoshua Nelson-0/+1
In particular, this allows rustdoc to recover from cycle errors when normalizing associated types for documentation. In the past, `@jackh726` has said we need to be careful about overflow errors: > Off the top of my head, we definitely should be careful about treating overflow errors the same as "not implemented for some reason" errors. Otherwise, you could end up with behavior that is different depending on recursion depth. But, that might be context-dependent. But cycle errors should be safe to unconditionally report; they don't depend on the recursion depth, they will always be an error whenever they're encountered.
2022-09-18Remove -Znew-llvm-pass-managerJosh Stone-1/+0
2022-09-14rustdoc: add test cases for turning ``[Vec<T>]`` into ``[`Vec<T>`]``Michael Howell-1/+43
2022-09-13Auto merge of #100101 - BelovDV:issue-99429, r=petrochenkovbors-0/+1
change rlib format to distinguish native dependencies Another one method to solve problem mentioned in #99429. Changed .rlib format, it contains all bundled native libraries as archieves. At link time rlib is unpacked and native dependencies linked separately. New behavior hidden under separate_native_rlib_dependencies flag.
2022-09-12Rollup merge of #101735 - notriddle:notriddle/backslash-escaped-html, ↵Guillaume Gomez-1/+14
r=GuillaumeGomez rustdoc: fix treatment of backslash-escaped HTML Try generating HTML for this markup: \<a href="https://example.com">example</a> It will produce text, not HTML, in both rustdoc's real HTML output and in the commonmark reference implementation: https://spec.commonmark.org/dingus/?text=%5C%3Ca%20href%3D%22https%3A%2F%2Fexample.com%22%3Eexample%3C%2Fa%3E
2022-09-12Rollup merge of #101732 - Nemo157:gate-rustdoc-missing-examples, ↵Guillaume Gomez-34/+82
r=GuillaumeGomez Feature gate the `rustdoc::missing_doc_code_examples` lint Moves the lint from being implicitly active on nightly `rustdoc` to requiring a feature to activate, like other unstable lints. Uses the new tracking issue https://github.com/rust-lang/rust/issues/101730
2022-09-12Rollup merge of #101731 - notriddle:notriddle/more-improved-html-check, ↵Guillaume Gomez-10/+250
r=GuillaumeGomez rustdoc: improve rustdoc HTML suggestions handling of nested generics Based on some poor suggestions produced when stablizing this lint and running it on `manformed-generics.rs` in #101720
2022-09-12rustdoc: fix treatment of backslash-escaped HTMLMichael Howell-1/+14
Try generating HTML for this markup: \<a href="https://example.com">example</a> It will produce text, not HTML, in both rustdoc's real HTML output and in the commonmark reference implementation: https://spec.commonmark.org/dingus/?text=%5C%3Ca%20href%3D%22https%3A%2F%2Fexample.com%22%3Eexample%3C%2Fa%3E
2022-09-12Feature gate the rustdoc::missing_doc_code_examples lintWim Looman-34/+82
2022-09-12rustdoc: improve rustdoc HTML suggestions handling of nested genericsMichael Howell-10/+250
Based on some poor suggestions produced when stablizing this lint and running it on `manformed-generics.rs`
2022-09-12change rlib format to discern native dependenciesDaniil Belov-0/+1
2022-09-09Add inline-llvm option for disabling/enabling LLVM inliningYan Chen-0/+1
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-28extend attrs if local_def_id existsTakayuki Maeda-0/+14
2022-08-12Rollup merge of #100229 - RalfJung:extra-const-ub-checks, r=lcnrDylan DPC-0/+1
add -Zextra-const-ub-checks to enable more UB checking in const-eval Cc https://github.com/rust-lang/rust/issues/99923 r? `@oli-obk`
2022-08-07add -Zextra-const-ub-checks to enable more UB checking in const-evalRalf Jung-0/+1
2022-08-07Remove even more box syntax uses from src/testest31-5/+5
Prior work, notably 6550021124451628b1efc60c59284465b109e3aa from #88316 has removed box syntax from most of the testsuite. However, some tests were left out. This commit removes box_syntax uses from more locations in src/test. Some tests that are very box syntax specific are not being migrated.
2022-08-03Rollup merge of #100029 - hdelc:master, r=cjgillotMatthias Krüger-1/+1
Prevent ICE for `doc_alias` on match arm, statement, expression Fixes #99777. This is a pretty minimal fix that should be safe, since rustdoc doesn't generate documentation for match arms, statements, or expressions. I mentioned in the linked issue that the `doc_alias` target checking should probably be improved to avoid future ICEs, but as a new contributor, I'm not confident enough with the HIR types to make a larger change.
2022-08-02Add items to `DocAliasBadLocation` check error match armhdelc-1/+1
- Added `Impl`, `Closure`, ForeignMod` targets - `Target::name` changed for `Target::Impl` - Error output for `Target::ForeignMod` changed to "foreign module"
2022-08-01Rollup merge of #99976 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+21
Make Rustdoc exit with correct error code when scraping examples from invalid files This PR fixes a small issue with the new Rustdoc scrape-examples feature. If a file that is being scraped has a type error, then currently that error is printed out, but the rustdoc process exits as if it succeeded. This is a problem for Cargo, which needs to track whether scraping succeeded (see rust-lang/cargo#10343). This PR fixes the issue by checking whether an error is emitted, and aborting if so.
2022-08-01Make Rustdoc exit with correct error code when scrape examples from invalid ↵Will Crichton-0/+21
files
2022-07-31Rollup merge of #99620 - hudson-ayers:fix-location-detail, r=davidtwcoMatthias Krüger-1/+1
`-Z location-detail`: provide option to disable all location details As reported [here](https://github.com/rust-lang/rust/pull/89920#issuecomment-1190598924), when I first implemented the `-Z location-detail` flag there was a bug, where passing an empty list was not correctly supported, and instead rejected by the compiler. This PR fixes that such that passing an empty list results in no location details being tracked, as originally specified in https://github.com/rust-lang/rfcs/pull/2091 . This PR also adds a test case to verify that this option continues to work as intended.
2022-07-30Rollup merge of #99873 - ↵Matthias Krüger-1/+19
notriddle:notriddle/invalid-html-tags-webcomponents, r=GuillaumeGomezp rustdoc: align invalid-html-tags lint with commonmark spec
2022-07-29proc_macro: use crossbeam channels for the proc_macro cross-thread bridgeNika Layzell-0/+1
This is done by having the crossbeam dependency inserted into the proc_macro server code from the server side, to avoid adding a dependency to proc_macro. In addition, this introduces a -Z command-line option which will switch rustc to run proc-macros using this cross-thread executor. With the changes to the bridge in #98186, #98187, #98188 and #98189, the performance of the executor should be much closer to same-thread execution. In local testing, the crossbeam executor was substantially more performant than either of the two existing CrossThread strategies, so they have been removed to keep things simple.
2022-07-28rustdoc: align invalid-html-tags lint with commonmark specMichael Howell-1/+19
2022-07-28location-detail: disable all location details when passed `none`Hudson Ayers-1/+1
Prior to this fix, `-Z location-detail` provided no mechanism for disabling all location details. This commit also adds a test case to verify that this option continues to work as intended, and clarifies the documentation of this option.
2022-07-28Use line numbers relative to function in mir opt testsNilstrieb-0/+1
This adds a new option, `-Zmir-pretty-relative-line-numbers`, that is then used in compiletest for the mir-opt tests.
2022-07-25feat: impl export-executable-symbolscsmoe-0/+1
2022-07-21Auto merge of #98162 - nextsilicon:support_lto_embed_bitcode, r=davidtwcobors-0/+1
Allow to disable thinLTO buffer to support lto-embed-bitcode lld feature Hello This change is to fix issue (https://github.com/rust-lang/rust/issues/84395) in which passing "-lto-embed-bitcode=optimized" to lld when linking rust code via linker-plugin-lto doesn't produce the expected result. Instead of emitting a single unified module into a llvmbc section of the linked elf, it emits multiple submodules. This is caused because rustc emits the BC modules after running llvm `createWriteThinLTOBitcodePass` pass. Which in turn triggers a thinLTO linkage and causes the said issue. This patch allows via compiler flag (-Cemit-thin-lto=<bool>) to select between running `createWriteThinLTOBitcodePass` and `createBitcodeWriterPass`. Note this pattern of selecting between those 2 passes is common inside of LLVM code. The default is to match the old behavior.
2022-07-20Rollup merge of #99436 - Nilstrieb:toggle-box-noalias, r=fee1-deadDylan DPC-0/+1
Add flag to configure `noalias` on `Box<T>` The aliasing rules of `Box<T>` are still not decided, but currently, `Box<T>` is unique and gets `noalias`. To aid making an informed decision about the future of `Box<T>`, this PR adds a flag `-Zbox-noalias` to configure `noalias` for `Box<T>` (for example, for benchmarking). The same flag already exists for `&mut T` `noalias`, where it was added because it was the problem of various miscompilations in LLVM. For more information, see rust-lang/unsafe-code-guidelines#326
2022-07-19Add flag to configure `noalias` on `Box<T>`nils-0/+1
To aid making an informed decision about the aliasing rules of box, give users an option to remove `noalias` from box.
2022-07-17rustdoc: extend `#[doc(tuple_variadic)]` to fn pointersMichael Howell-5/+5
The attribute is also renamed `fake_variadic`.
2022-07-15passes: migrate half of `check_attr`David Wood-5/+5
Migrate half of the `rustc_passes::check_attr` diagnostics to using diagnostic derives and being translatable.
2022-07-14rustc: add ability to output regular LTO bitcode modulesZiv Dunkelman-0/+1
Adding the option to control from rustc CLI if the resulted ".o" bitcode module files are with thinLTO info or regular LTO info. Allows using "-lto-embed-bitcode=optimized" during linkage correctly. Signed-off-by: Ziv Dunkelman <ziv.dunkelman@nextsilicon.com>
2022-07-12Update -zhelp and -chelp rustdoc-ui tests to use regex-error-patternGuillaume Gomez-0/+4
2022-07-11Rollup merge of #99142 - ↵Matthias Krüger-0/+16
notriddle:notriddle/doctest-multiline-crate-attributes, r=GuillaumeGomez fix(doctest): treat fatal parse errors as incomplete attributes Fixes #99089
2022-07-11Add tests for -Chelp and -ZhelpGuillaume Gomez-0/+254
2022-07-10fix(doctest): treat fatal parse errors as incomplete attributesMichael Howell-0/+16
Fixes #99089
2022-07-08Rollup merge of #95635 - davidtwco:terminal-width-stabilization, r=oli-obkMatthias Krüger-0/+20
sess: stabilize `--terminal-width` as `--diagnostic-width` Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Pending agreement to stabilize, see tracking issue at #84673. r? ```@oli-obk```
2022-07-06session: `output-width` -> `diagnostic-width`David Wood-3/+3
Rename the `--output-width` flag to `--diagnostic-width` as this appears to be the preferred name within the compiler team. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06session: `terminal-width` -> `output-width`David Wood-3/+3
Rename the `--terminal-width` flag to `--output-width` as the behaviour doesn't just apply to terminals (and so is slightly less accurate). Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06sess: stabilize `--terminal-width`David Wood-0/+20
Formerly `-Zterminal-width`, `--terminal-width` allows the user or build tool to inform rustc of the width of the terminal so that diagnostics can be truncated. Signed-off-by: David Wood <david.wood@huawei.com>
2022-07-06replace `guess_head_span` with `def_span`Takayuki Maeda-1/+1
2022-07-04add regression test for #79467Takayuki Maeda-0/+17
2022-07-03Rollup merge of #98799 - jyn514:rustdoc-lint-help, r=GuillaumeGomezRalf Jung-193/+26
Fix bug in `rustdoc -Whelp` Previously, this printed the debugging options, not the lint options, and only handled `-Whelp`, not `-A/-D/-F`. This also fixes a few other misc issues: - Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests - Add lint headers for tool lints, not just builtin lints https://github.com/rust-lang/rust/pull/98533#issuecomment-1172004197 r? ```@GuillaumeGomez```
2022-07-02Fix bug in `rustdoc -Whelp`Joshua Nelson-193/+26
Previously, this printed the debugging options, not the lint options, and only handled `-Whelp`, not `-A/-D/-F`. This also fixes a few other misc issues: - Fix `// check-stdout` for UI tests; previously it only worked for run-fail and compile-fail tests - Add lint headers for tool lints, not just builtin lints - Remove duplicate run-make test
2022-07-02Rollup merge of #98653 - TaKO8Ki:add-regression-test-for-79494, ↵Dylan DPC-0/+17
r=Mark-Simulacrum Add regression test for #79494 closes #79494
2022-07-01Auto merge of #98781 - GuillaumeGomez:rollup-798kb8u, r=GuillaumeGomezbors-0/+11
Rollup of 5 pull requests Successful merges: - #97249 (`<details>`/`<summary>` UI fixes) - #98418 (Allow macOS to build LLVM as shared library) - #98460 (Use CSS variables to handle theming) - #98497 (Improve some inference diagnostics) - #98708 (rustdoc: fix 98690 Panic if invalid path for -Z persist-doctests) Failed merges: - #98761 (more `need_type_info` improvements) r? `@ghost` `@rustbot` modify labels: rollup