diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-08-06 20:23:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-06 20:23:42 +0200 |
| commit | 47a2f14e49ad5b2daa3d6378de228112eb54ffe4 (patch) | |
| tree | a4c566a918fc5dbc13d0cf4aaae1a2fc4dd71467 | |
| parent | 8912318a4cdf64d8c0186665d54897cb49eb4c8a (diff) | |
| parent | f43e92b4dfe70b9def4f369794c0d703faae2665 (diff) | |
| download | rust-47a2f14e49ad5b2daa3d6378de228112eb54ffe4.tar.gz rust-47a2f14e49ad5b2daa3d6378de228112eb54ffe4.zip | |
Rollup merge of #128736 - GuillaumeGomez:fix-remap-path-prefix, r=notriddle
Fix rustdoc missing handling of remap-path-prefix option Fixes https://github.com/rust-lang/rust/issues/69264. cc `@weihanglo` r? `@notriddle`
| -rw-r--r-- | src/librustdoc/core.rs | 2 | ||||
| -rw-r--r-- | tests/rustdoc-ui/remap-path-prefix-lint.rs | 10 | ||||
| -rw-r--r-- | tests/rustdoc-ui/remap-path-prefix-lint.stderr | 14 |
3 files changed, 26 insertions, 0 deletions
diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 3e1271f198c..fea31e7ecbc 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -195,6 +195,7 @@ pub(crate) fn create_config( lint_cap, scrape_examples_options, expanded_args, + remap_path_prefix, .. }: RustdocOptions, RenderOptions { document_private, .. }: &RenderOptions, @@ -247,6 +248,7 @@ pub(crate) fn create_config( describe_lints, crate_name, test, + remap_path_prefix, ..Options::default() }; diff --git a/tests/rustdoc-ui/remap-path-prefix-lint.rs b/tests/rustdoc-ui/remap-path-prefix-lint.rs new file mode 100644 index 00000000000..f27863e825d --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-lint.rs @@ -0,0 +1,10 @@ +// Regression test for remapped paths in rustdoc errors +// <https://github.com/rust-lang/rust/issues/69264>. + +//@ compile-flags:-Z unstable-options --remap-path-prefix={{src-base}}=remapped_path +//@ rustc-env:RUST_BACKTRACE=0 + +#![deny(rustdoc::invalid_html_tags)] + +/// </script> +pub struct Bar; diff --git a/tests/rustdoc-ui/remap-path-prefix-lint.stderr b/tests/rustdoc-ui/remap-path-prefix-lint.stderr new file mode 100644 index 00000000000..d7c1bb1965d --- /dev/null +++ b/tests/rustdoc-ui/remap-path-prefix-lint.stderr @@ -0,0 +1,14 @@ +error: unopened HTML tag `script` + --> remapped_path/remap-path-prefix-lint.rs:9:5 + | +LL | /// </script> + | ^^^^^^^^^ + | +note: the lint level is defined here + --> remapped_path/remap-path-prefix-lint.rs:7:9 + | +LL | #![deny(rustdoc::invalid_html_tags)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 1 previous error + |
