Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion compiler/rustc_ast_passes/src/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
gate_all!(guard_patterns, "guard patterns are experimental", "consider using match arm guards");
gate_all!(impl_restriction, "`impl` restrictions are experimental");
gate_all!(min_generic_const_args, "unbraced const blocks as const args are experimental");
gate_all!(more_qualified_paths, "usage of qualified paths in this context is experimental");
gate_all!(mut_ref, "mutable by-reference bindings are experimental");
gate_all!(pin_ergonomics, "pinned reference syntax is experimental");
gate_all!(postfix_match, "postfix match is experimental");
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_feature/src/accepted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ declare_features! (
(accepted, min_const_unsafe_fn, "1.33.0", Some(55607)),
/// Allows exhaustive pattern matching on uninhabited types when matched by value.
(accepted, min_exhaustive_patterns, "1.82.0", Some(119612)),
/// Allows qualified paths in struct expressions, struct patterns and tuple struct patterns.
(accepted, more_qualified_paths, "CURRENT_RUSTC_VERSION", Some(86935)),
/// Allows using `Self` and associated types in struct expressions and patterns.
(accepted, more_struct_aliases, "1.16.0", Some(37544)),
/// Allows using the MOVBE target feature.
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,8 +592,6 @@ declare_features! (
(unstable, min_specialization, "1.7.0", Some(31844)),
/// Target features on mips.
(unstable, mips_target_feature, "1.27.0", Some(150253)),
/// Allows qualified paths in struct expressions, struct patterns and tuple struct patterns.
(unstable, more_qualified_paths, "1.54.0", Some(86935)),
/// The `movrs` target feature on x86.
(unstable, movrs_target_feature, "1.88.0", Some(137976)),
/// Allows the `multiple_supertrait_upcastable` lint.
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_parse/src/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1677,9 +1677,6 @@ impl<'a> Parser<'a> {
} else if self.check(exp!(OpenBrace))
&& let Some(expr) = self.maybe_parse_struct_expr(&qself, &path)
{
if qself.is_some() {
self.psess.gated_spans.gate(sym::more_qualified_paths, path.span);
}
return expr;
} else {
(path.span, ExprKind::Path(qself, path))
Expand Down
7 changes: 0 additions & 7 deletions compiler/rustc_parse/src/parser/pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1404,10 +1404,6 @@ impl<'a> Parser<'a> {

/// Parse a struct ("record") pattern (e.g. `Foo { ... }` or `Foo::Bar { ... }`).
fn parse_pat_struct(&mut self, qself: Option<Box<QSelf>>, path: Path) -> PResult<'a, PatKind> {
if qself.is_some() {
// Feature gate the use of qualified paths in patterns
self.psess.gated_spans.gate(sym::more_qualified_paths, path.span);
}
self.bump();
let (fields, etc) = self.parse_pat_fields().unwrap_or_else(|mut e| {
e.span_label(path.span, "while parsing the fields for this pattern");
Expand All @@ -1434,9 +1430,6 @@ impl<'a> Parser<'a> {
CommaRecoveryMode::EitherTupleOrPipe,
)
})?;
if qself.is_some() {
self.psess.gated_spans.gate(sym::more_qualified_paths, path.span);
}
Ok(PatKind::TupleStruct(qself, path, fields))
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//@ check-pass

#![feature(more_qualified_paths)]

enum E { V() }

fn main() {
Expand Down
25 changes: 12 additions & 13 deletions tests/ui/associated-types/associated-type-struct-construction.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
// Make sure that users can construct structs through associated types
// in both expressions and patterns
// Check that fully qualified syntax can be used in struct expressions in patterns.
// In other words, check that structs can constructed and destructed via an associated type.
//
//@ run-pass

#![feature(more_qualified_paths)]

//@ check-pass
fn main() {
let <Foo as A>::Assoc { br } = <Foo as A>::Assoc { br: 2 };
assert!(br == 2);
let <Type as Trait>::Assoc { field } = <Type as Trait>::Assoc { field: 2 };
assert_eq!(field, 2);
}

struct StructStruct {
br: i8,
struct Struct {
field: i8,
}

struct Foo;
struct Type;

trait A {
trait Trait {
type Assoc;
}

impl A for Foo {
type Assoc = StructStruct;
impl Trait for Type {
type Assoc = Struct;
}
2 changes: 0 additions & 2 deletions tests/ui/associated-types/tuple-struct-expr-pat.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//
//@ run-rustfix

#![feature(more_qualified_paths)]

fn main() {
let <T<0> as Trait>::Assoc {} = <T<0> as Trait>::Assoc {};
//~^ error: expected method or associated constant, found associated type
Expand Down
2 changes: 0 additions & 2 deletions tests/ui/associated-types/tuple-struct-expr-pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
//
//@ run-rustfix

#![feature(more_qualified_paths)]

fn main() {
let <T<0> as Trait>::Assoc() = <T<0> as Trait>::Assoc();
//~^ error: expected method or associated constant, found associated type
Expand Down
16 changes: 8 additions & 8 deletions tests/ui/associated-types/tuple-struct-expr-pat.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0575]: expected method or associated constant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:10:36
--> $DIR/tuple-struct-expr-pat.rs:8:36
|
LL | let <T<0> as Trait>::Assoc() = <T<0> as Trait>::Assoc();
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -12,7 +12,7 @@ LL + let <T<0> as Trait>::Assoc() = <T<0> as Trait>::Assoc {};
|

error[E0575]: expected tuple struct or tuple variant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:10:9
--> $DIR/tuple-struct-expr-pat.rs:8:9
|
LL | let <T<0> as Trait>::Assoc() = <T<0> as Trait>::Assoc();
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -25,7 +25,7 @@ LL + let <T<0> as Trait>::Assoc {} = <T<0> as Trait>::Assoc();
|

error[E0575]: expected method or associated constant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:13:38
--> $DIR/tuple-struct-expr-pat.rs:11:38
|
LL | let <T<1> as Trait>::Assoc(_a) = <T<1> as Trait>::Assoc(0);
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -38,7 +38,7 @@ LL + let <T<1> as Trait>::Assoc(_a) = <T<1> as Trait>::Assoc { 0: 0 };
|

error[E0575]: expected tuple struct or tuple variant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:13:9
--> $DIR/tuple-struct-expr-pat.rs:11:9
|
LL | let <T<1> as Trait>::Assoc(_a) = <T<1> as Trait>::Assoc(0);
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -51,7 +51,7 @@ LL + let <T<1> as Trait>::Assoc { 0: _a } = <T<1> as Trait>::Assoc(0);
|

error[E0575]: expected method or associated constant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:16:42
--> $DIR/tuple-struct-expr-pat.rs:14:42
|
LL | let <T<2> as Trait>::Assoc(_a, _b) = <T<2> as Trait>::Assoc(0, 1);
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -64,7 +64,7 @@ LL + let <T<2> as Trait>::Assoc(_a, _b) = <T<2> as Trait>::Assoc { 0: 0, 1:
|

error[E0575]: expected tuple struct or tuple variant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:16:9
--> $DIR/tuple-struct-expr-pat.rs:14:9
|
LL | let <T<2> as Trait>::Assoc(_a, _b) = <T<2> as Trait>::Assoc(0, 1);
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -77,7 +77,7 @@ LL + let <T<2> as Trait>::Assoc { 0: _a, 1: _b } = <T<2> as Trait>::Assoc(0,
|

error[E0575]: expected method or associated constant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:19:62
--> $DIR/tuple-struct-expr-pat.rs:17:62
|
LL | let <T<3> as Trait>::Assoc(ref _a, ref mut _b, mut _c) = <T<3> as Trait>::Assoc(0, 1, 2);
| ^^^^^^^^^^^^^^^^^^^^^^
Expand All @@ -90,7 +90,7 @@ LL + let <T<3> as Trait>::Assoc(ref _a, ref mut _b, mut _c) = <T<3> as Trait
|

error[E0575]: expected tuple struct or tuple variant, found associated type `Trait::Assoc`
--> $DIR/tuple-struct-expr-pat.rs:19:9
--> $DIR/tuple-struct-expr-pat.rs:17:9
|
LL | let <T<3> as Trait>::Assoc(ref _a, ref mut _b, mut _c) = <T<3> as Trait>::Assoc(0, 1, 2);
| ^^^^^^^^^^^^^^^^^^^^^^
Expand Down
27 changes: 0 additions & 27 deletions tests/ui/feature-gates/feature-gate-more-qualified-paths.rs

This file was deleted.

33 changes: 0 additions & 33 deletions tests/ui/feature-gates/feature-gate-more-qualified-paths.stderr

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// issue#121613

#![feature(more_qualified_paths)]

struct S {}

struct Foo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/incompat-call-after-qualified-path-0.rs:21:6
--> $DIR/incompat-call-after-qualified-path-0.rs:19:6
|
LL | f(|a, b| a.cmp(b));
| ^ - type must be known at this point
Expand All @@ -10,13 +10,13 @@ LL | f(|a: /* Type */, b| a.cmp(b));
| ++++++++++++

error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/incompat-call-after-qualified-path-0.rs:21:3
--> $DIR/incompat-call-after-qualified-path-0.rs:19:3
|
LL | f(|a, b| a.cmp(b));
| ^ --------------- unexpected argument
|
note: function defined here
--> $DIR/incompat-call-after-qualified-path-0.rs:17:4
--> $DIR/incompat-call-after-qualified-path-0.rs:15:4
|
LL | fn f() {}
| ^
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// issue#121613

#![feature(more_qualified_paths)]

struct S<T> {
a: T
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error[E0282]: type annotations needed
--> $DIR/incompat-call-after-qualified-path-1.rs:25:6
--> $DIR/incompat-call-after-qualified-path-1.rs:23:6
|
LL | f(|a, b| a.cmp(b));
| ^ - type must be known at this point
Expand All @@ -10,13 +10,13 @@ LL | f(|a: /* Type */, b| a.cmp(b));
| ++++++++++++

error[E0061]: this function takes 0 arguments but 1 argument was supplied
--> $DIR/incompat-call-after-qualified-path-1.rs:25:3
--> $DIR/incompat-call-after-qualified-path-1.rs:23:3
|
LL | f(|a, b| a.cmp(b));
| ^ --------------- unexpected argument
|
note: function defined here
--> $DIR/incompat-call-after-qualified-path-1.rs:19:4
--> $DIR/incompat-call-after-qualified-path-1.rs:17:4
|
LL | fn f() {}
| ^
Expand Down
1 change: 0 additions & 1 deletion tests/ui/macros/stringify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#![feature(coroutines)]
#![feature(decl_macro)]
#![feature(macro_guard_matcher)]
#![feature(more_qualified_paths)]
#![feature(never_patterns)]
#![feature(specialization)]
#![feature(trait_alias)]
Expand Down
3 changes: 2 additions & 1 deletion tests/ui/macros/vec-macro-in-pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

fn main() {
match Some(vec![42]) {
Some(vec![43]) => {} //~ ERROR expected a pattern, found a function call
Some(vec![43]) => {}
//~^ ERROR expected a pattern, found a function call
//~| ERROR found associated function
//~| ERROR expected a pattern, found a function call
_ => {}
Expand Down
4 changes: 0 additions & 4 deletions tests/ui/nll/user-annotations/normalization-2.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
// Make sure we honor region constraints when normalizing type annotations.

//@ check-fail

#![feature(more_qualified_paths)]

trait Trait {
type Assoc;
}
Expand Down
Loading
Loading