Open
Description
This is a tracking issue for the "more qualified paths" feature. This feature originally grew out of a bug report #79658 where structs with qualified paths could not be constructed or used in patterns.
For instance:
fn main() {
let <Foo as MyTrait>::Assoc { a } = <Foo as MyTrait>::Assoc { a: 2 };
// The above would previously not parse.
assert!(a == 2);
}
struct StructStruct {
a: i8,
}
trait MyTrait {
type Assoc;
}
struct Foo;
impl MyTrait for Foo {
type Assoc = StructStruct;
}
See the implementation PR #80080 for more detailed discussion.
The feature gate for the issue is #![feature(more_qualified_paths)]
.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Steps
- Implement the feature Allow qualified paths in struct construction (both expressions and patterns) #80080
- Adjust documentation (see instructions on rustc-dev-guide)
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
Implementation history
Metadata
Metadata
Assignees
Labels
Area: Associated items (types, constants & functions)Area: The lexing & parsing of Rust source code to an ASTCategory: An issue tracking the progress of sth. like the implementation of an RFC`#![feature(more_qualified_paths)]`Status: This is ready to stabilize; it may need a stabilization report and a PRRelevant to the language team, which will review and decide on the PR/issue.