-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Clean up E0754 explanation #75626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up E0754 explanation #75626
Changes from 1 commit
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 | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,31 +1,27 @@ | ||||||||
An non-ascii identifier was used in an invalid context. | ||||||||
|
||||||||
Erroneous code example: | ||||||||
Erroneous code examples: | ||||||||
|
||||||||
```compile_fail,E0754 | ||||||||
# #![feature(non_ascii_idents)] | ||||||||
|
||||||||
mod řųśť; | ||||||||
// ^ error! | ||||||||
fn main() {} | ||||||||
``` | ||||||||
|
||||||||
```compile_fail,E0754 | ||||||||
# #![feature(non_ascii_idents)] | ||||||||
|
||||||||
#[no_mangle] | ||||||||
fn řųśť() {} | ||||||||
// ^ 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. Why not make it
Suggested change
|
||||||||
|
||||||||
fn main() {} | ||||||||
``` | ||||||||
|
||||||||
Non-ascii can be used as module names if it is inline | ||||||||
or a #\[path\] attribute is specified. For example: | ||||||||
Non-ascii can be used as module names if it is inline or a `#[path]` attribute | ||||||||
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.
Suggested change
Should it be "inlined" rather than "inline"? 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. Absolutely! As for the 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. Yes, but should we link it to the reference to let the users know what is that? I feel like this is a less known item. 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. The problem with external links is that they might change (for example in this case, this is: https://doc.rust-lang.org/reference/items/modules.html#the-path-attribute), even if they're part of the rust book. 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. But don't we have link check? 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. Only when referring to items inside the docs scope (so relative paths, not absolute ones). |
||||||||
is specified. For example: | ||||||||
|
||||||||
``` | ||||||||
# #![feature(non_ascii_idents)] | ||||||||
|
||||||||
mod řųśť { | ||||||||
mod řųśť { // ok! | ||||||||
const IS_GREAT: bool = true; | ||||||||
} | ||||||||
|
||||||||
|
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.
Why not make it
error
on the same line likeok
on the same line as below?