Add regression test for #140026
This commit is contained in:
parent
e0437ec364
commit
88a5e1ef68
2 changed files with 22 additions and 0 deletions
8
tests/rustdoc-ui/intra-doc/empty-associated-items.rs
Normal file
8
tests/rustdoc-ui/intra-doc/empty-associated-items.rs
Normal file
|
@ -0,0 +1,8 @@
|
|||
// This test ensures that an empty associated item will not crash rustdoc.
|
||||
// This is a regression test for <https://github.com/rust-lang/rust/issues/140026>.
|
||||
|
||||
#[deny(rustdoc::broken_intra_doc_links)]
|
||||
|
||||
/// [`String::`]
|
||||
//~^ ERROR
|
||||
pub struct Foo;
|
14
tests/rustdoc-ui/intra-doc/empty-associated-items.stderr
Normal file
14
tests/rustdoc-ui/intra-doc/empty-associated-items.stderr
Normal file
|
@ -0,0 +1,14 @@
|
|||
error: unresolved link to `String::`
|
||||
--> $DIR/empty-associated-items.rs:6:7
|
||||
|
|
||||
LL | /// [`String::`]
|
||||
| ^^^^^^^^ the struct `String` has no field or associated item named ``
|
||||
|
|
||||
note: the lint level is defined here
|
||||
--> $DIR/empty-associated-items.rs:4:8
|
||||
|
|
||||
LL | #[deny(rustdoc::broken_intra_doc_links)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue