Fix ICE when using #[doc(keyword = "...")] on non-items
This commit is contained in:
parent
b17d9c1332
commit
2cedd86b1c
3 changed files with 23 additions and 2 deletions
10
src/test/ui/rustdoc/issue-83512.rs
Normal file
10
src/test/ui/rustdoc/issue-83512.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// Regression test for the ICE described in #83512.
|
||||
|
||||
#![feature(doc_keyword)]
|
||||
#![crate_type="lib"]
|
||||
|
||||
trait Foo {
|
||||
#[doc(keyword = "match")]
|
||||
//~^ ERROR: `#[doc(keyword = "...")]` can only be used on modules
|
||||
fn quux() {}
|
||||
}
|
||||
8
src/test/ui/rustdoc/issue-83512.stderr
Normal file
8
src/test/ui/rustdoc/issue-83512.stderr
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
error: `#[doc(keyword = "...")]` can only be used on modules
|
||||
--> $DIR/issue-83512.rs:7:11
|
||||
|
|
||||
LL | #[doc(keyword = "match")]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue