Fix leading qualifiers in use-import prefixes - #13
Draft
PLeVasseur wants to merge 45 commits into
Draft
PLeVasseur wants to merge 45 commits into
PLeVasseur wants to merge 45 commits into
Conversation
Co-authored-by: Hristian Kirtchev <60669983+kirtchev-adacore@users.noreply.github.com>
…r-blockers [Dev-Guide]: Dealing with PR blockers
updates for Rust 1.97 release
Not clear what was intended there, but it does not look essential
"refutable pattern" and "irrefutable pattern" are already defined above
Also, unroll the sentence
remove redundant rule
add missing punctuation
remove some stray chars
some cleaning
Add 1.98.0 changelog entry
This PR removes the term "indirection" and its derivatives from the FLS as the Rust Project does not use this term. The preferred alternative is "pointer", "pointer type", etc. Closes: rust-lang#710
…irection Remove term "indirection" and its derivatives
…r-1.99 add changelog entries for Rust 1.99
Address the review of 2026-09-24 on the import path prefix construction: - Fold the redundant "A sequence determined as follows" bullet into the "For each nesting import" step, which now enumerates only the nesting imports that contribute a common path prefix or a leading `::`. - State the import's own contribution as flat cases with their own conditions; a glob import with no prefix of its own and a plain single segment simple import match no case and contribute nothing. - Split the simple import case by multi segment and single segment path so the separating `::` is removed exactly and a leading `::` on a single segment path is kept. - Phrase the glob and `self` prefix rules by what the import path prefix contains, matching the existing enum-or-module rule. - Use "use import" as the subject of the nesting restriction. The construction is unchanged in effect for every case in the review matrix.
the constraint is not on the trait itself
`fls_JHU0ersYB6eL` required every import path prefix that contains a
path segment to resolve to an enum or module. A simple import whose
simple path ends in keyword `self` brings the entity that its prefix
resolves to into scope, and `fls_oRdi3KXFbJcR` allows that entity to be
a trait, as does the Reference (items.use.self.module). So
`use m::Trait::{self as T};` was accepted by rustc and rejected by the
FLS text.
Exempt such imports from `fls_JHU0ersYB6eL`. Glob imports and simple
imports whose last path segment is not `self` are unchanged. Recorded as
its own changelog entry.
Preserve the import-prefix maintenance entries alongside the upstream trait-bound entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
::glob-import restrictions.Tracks rust-lang#711.
Reference alignment
https://doc.rust-lang.org/reference/items/use-declarations.html#r-items.use.syntax
https://doc.rust-lang.org/reference/items/use-declarations.html#r-items.use.multiple-syntax
https://doc.rust-lang.org/reference/items/use-declarations.html#r-items.use.restrictions.extern-prelude
document missing import restrictions rust-lang/fls#694 (comment)
The FLS models brace grouping through explicit recursive prefix construction rather than the Reference's prose description. This is a structural difference with no intentional behavioral deviation.
The changes are limited to Rust 2021 semantics. The Rust 2015 interpretation of leading
::is excluded.Glob-import restrictions are centralized in
fls_iNUBX5fJAI1N; its macro-consumption allowance intentionally applies to both empty and bare-::glob prefixes because macros may consume those token forms before import resolution rejects them.Testing
./make.py --clear./make.py --check-linksgit diff --check upstream/main...HEAD