-
Notifications
You must be signed in to change notification settings - Fork 41
document missing import restrictions #694
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
base: main
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -1135,6 +1135,18 @@ same :t:`namespace` but refer to different :t:`entities <entity>` if the | |
| If two :t:`[glob import]s` import the same :t:`entity` under the same :t:`name`, | ||
| the :t:`visibility` of the :t:`name` is the most permissive one. | ||
|
|
||
| :dp:`fls_sUhnfV62HJrb` | ||
| When :t:`keyword` ``crate`` or :t:`keyword` ``$crate`` is used to import the current :t:`crate`, a :t:`renaming` must be used to define the :t:`binding` name. | ||
|
Contributor
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. This still looks incomplete relative to the upstream After Could this PR also update those earlier Support:
Contributor
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.
Could this be split into separate Support:
|
||
|
|
||
| :dp:`fls_QGdeRTe0H1Uc` | ||
| When :t:`keyword` ``super`` is used to import a parent :t:`module`, a :t:`renaming` must be used to define the :t:`binding` name. | ||
|
Contributor
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. This new Could this PR also relax Support:
|
||
|
|
||
| :dp:`fls_aam34hsRmKU2` | ||
| An :t:`external prelude` cannot be imported. | ||
|
Contributor
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. This sentence reads too broadly. Rust 2021 still allows imports through extern-prelude crate names, such as As written, Could this be restated in terms of Support:
|
||
|
|
||
| :dp:`fls_LV94x3HlpBWk` | ||
| A :t:`simple import` cannot refer to :t:`[enum variant]s` through a :t:`type alias`. | ||
|
|
||
| .. rubric:: Examples | ||
|
|
||
| :dp:`fls_5dlnffim6fso` | ||
|
|
@@ -1164,8 +1176,6 @@ The following is a selective import. The imported functions are | |
| use outer_module::inner_module | ||
| {crate_visible_function, visible_function} | ||
|
|
||
| .. rubric:: Legality Rules | ||
|
|
||
|
Comment on lines
-1167
to
-1168
Member
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. Was this deletion intentional?
Member
Author
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. yeah, it was stray text... it's in a separate commit to make that clear |
||
| .. _fls_ydmnb7qnmzzq: | ||
|
|
||
| Shadowing | ||
|
|
||
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.
I rechecked the pre-
rust-lang/reference#2136Reference snapshot, and the enum-variant-through-type-alias restriction was already present there asitems.use.restrictions.variant. Sincerust-lang/rust#146972is specifically about keyword imports, addingfls_LV94x3HlpBWkunder this Rust 1.95 language-change entry makes this look like an FLS correction rather than part of the 1.95 change itself.Could this paragraph ID move out of the
Support importing path-segment keywords with renamingentry and into the existingFLS correctionssection instead, unless there is a stronger reason to tie it torust-lang/rust#146972?Support:
rust-lang/reference#2136already containsitems.use.restrictions.variant(rust-lang/reference@36016fc5164d3e10d0288e71f57c88dca937bd80)rust-lang/reference#2136rust-lang/rust#146972