-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error when #[doc(alias)] has same name as the item #80686
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#![crate_type = "lib"] | ||
|
||
#[doc(alias = "Foo")] //~ ERROR | ||
pub struct Foo; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: `#[doc(alias = "...")]` is the same as the item's name | ||
--> $DIR/doc-alias-same-name.rs:3:7 | ||
| | ||
LL | #[doc(alias = "Foo")] | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#![crate_type = "lib"] | ||
|
||
#[doc(alias = "Foo")] //~ ERROR | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I didn't realize this runs in rustc_attr itself. It shouldn't be changed here, but I wonder if it makes sense to run those checks in rustdoc instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's scheduled for later. :) |
||
pub struct Foo; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
error: `#[doc(alias = "...")]` is the same as the item's name | ||
--> $DIR/doc-alias-same-name.rs:3:7 | ||
| | ||
LL | #[doc(alias = "Foo")] | ||
| ^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it really need
to_string
to compare between an Symbol and a string?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're absolutely right, I opened #80750 to fix it.