diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs index 915613a391374..e36120abf6844 100644 --- a/compiler/rustc_ast_passes/src/feature_gate.rs +++ b/compiler/rustc_ast_passes/src/feature_gate.rs @@ -471,7 +471,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) { "`for<...>` binders for closures are experimental", "consider removing `for<...>`" ); - gate_all!(more_qualified_paths, "usage of qualified paths in this context is experimental"); // yield can be enabled either by `coroutines` or `gen_blocks` if let Some(spans) = spans.get(&sym::yield_expr) { for span in spans { diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs index ffa6ffb40b61a..cee44533445a5 100644 --- a/compiler/rustc_feature/src/accepted.rs +++ b/compiler/rustc_feature/src/accepted.rs @@ -295,6 +295,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. diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index b46eac6d8a602..6ce100ee78f6a 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -569,8 +569,6 @@ declare_features! ( /// standard library until the soundness issues with specialization /// are fixed. (unstable, min_specialization, "1.7.0", Some(31844)), - /// Allows qualified paths in struct expressions, struct patterns and tuple struct patterns. - (unstable, more_qualified_paths, "1.54.0", Some(86935)), /// Allows the `#[must_not_suspend]` attribute. (unstable, must_not_suspend, "1.57.0", Some(83310)), /// Allows `mut ref` and `mut ref mut` identifier patterns. diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 1a44f4af8a629..34d33ed259688 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -1649,9 +1649,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)) diff --git a/compiler/rustc_parse/src/parser/pat.rs b/compiler/rustc_parse/src/parser/pat.rs index d6ff80b2eb4c6..58b7a997b5548 100644 --- a/compiler/rustc_parse/src/parser/pat.rs +++ b/compiler/rustc_parse/src/parser/pat.rs @@ -1381,10 +1381,6 @@ impl<'a> Parser<'a> { /// Parse a struct ("record") pattern (e.g. `Foo { ... }` or `Foo::Bar { ... }`). fn parse_pat_struct(&mut self, qself: Option>, 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"); @@ -1411,9 +1407,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)) } diff --git a/src/doc/unstable-book/src/language-features/more-qualified-paths.md b/src/doc/unstable-book/src/language-features/more-qualified-paths.md deleted file mode 100644 index 1a31ba8e14f9f..0000000000000 --- a/src/doc/unstable-book/src/language-features/more-qualified-paths.md +++ /dev/null @@ -1,33 +0,0 @@ -# `more_qualified_paths` - -The `more_qualified_paths` feature can be used in order to enable the -use of qualified paths in patterns. - -The tracking issue for this feature is: [#86935](https://github.com/rust-lang/rust/issues/86935). - ------------------------- - -## Example - -```rust -#![feature(more_qualified_paths)] - -fn main() { - // destructure through a qualified path - let ::Assoc { br } = StructStruct { br: 2 }; -} - -struct StructStruct { - br: i8, -} - -struct Foo; - -trait A { - type Assoc; -} - -impl A for Foo { - type Assoc = StructStruct; -} -``` diff --git a/tests/ui/associated-types/associated-type-destructuring-assignment.rs b/tests/ui/associated-types/associated-type-destructuring-assignment.rs index 2ab94908b6042..75c806142236d 100644 --- a/tests/ui/associated-types/associated-type-destructuring-assignment.rs +++ b/tests/ui/associated-types/associated-type-destructuring-assignment.rs @@ -1,7 +1,5 @@ //@ check-pass -#![feature(more_qualified_paths)] - enum E { V() } fn main() { diff --git a/tests/ui/associated-types/associated-type-struct-construction.rs b/tests/ui/associated-types/associated-type-struct-construction.rs index 422fd5a0c3a9b..8b4be5f0d83d3 100644 --- a/tests/ui/associated-types/associated-type-struct-construction.rs +++ b/tests/ui/associated-types/associated-type-struct-construction.rs @@ -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 ::Assoc { br } = ::Assoc { br: 2 }; - assert!(br == 2); + let ::Assoc { field } = ::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; } diff --git a/tests/ui/associated-types/tuple-struct-expr-pat.fixed b/tests/ui/associated-types/tuple-struct-expr-pat.fixed index d6e2385f82103..3b94868063eee 100644 --- a/tests/ui/associated-types/tuple-struct-expr-pat.fixed +++ b/tests/ui/associated-types/tuple-struct-expr-pat.fixed @@ -4,8 +4,6 @@ // //@ run-rustfix -#![feature(more_qualified_paths)] - fn main() { let as Trait>::Assoc {} = as Trait>::Assoc {}; //~^ error: expected method or associated constant, found associated type diff --git a/tests/ui/associated-types/tuple-struct-expr-pat.rs b/tests/ui/associated-types/tuple-struct-expr-pat.rs index f27a5fe175390..368fe143f2b0b 100644 --- a/tests/ui/associated-types/tuple-struct-expr-pat.rs +++ b/tests/ui/associated-types/tuple-struct-expr-pat.rs @@ -4,8 +4,6 @@ // //@ run-rustfix -#![feature(more_qualified_paths)] - fn main() { let as Trait>::Assoc() = as Trait>::Assoc(); //~^ error: expected method or associated constant, found associated type diff --git a/tests/ui/associated-types/tuple-struct-expr-pat.stderr b/tests/ui/associated-types/tuple-struct-expr-pat.stderr index 135dfcb3447e5..ff4914a361fff 100644 --- a/tests/ui/associated-types/tuple-struct-expr-pat.stderr +++ b/tests/ui/associated-types/tuple-struct-expr-pat.stderr @@ -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 as Trait>::Assoc() = as Trait>::Assoc(); | ^^^^^^^^^^^^^^^^^^^^^^-- help: use struct expression instead: `{}` @@ -7,7 +7,7 @@ LL | let as Trait>::Assoc() = as Trait>::Assoc(); = note: can't use a type alias as a constructor 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 as Trait>::Assoc() = as Trait>::Assoc(); | ^^^^^^^^^^^^^^^^^^^^^^-- help: use struct pattern instead: `{}` @@ -15,7 +15,7 @@ LL | let as Trait>::Assoc() = as Trait>::Assoc(); = note: can't use a type alias as tuple pattern 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 as Trait>::Assoc(_a) = as Trait>::Assoc(0); | ^^^^^^^^^^^^^^^^^^^^^^ @@ -28,7 +28,7 @@ LL + let as Trait>::Assoc(_a) = 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 as Trait>::Assoc(_a) = as Trait>::Assoc(0); | ^^^^^^^^^^^^^^^^^^^^^^ @@ -41,7 +41,7 @@ LL + let as Trait>::Assoc { 0: _a } = 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 as Trait>::Assoc(_a, _b) = as Trait>::Assoc(0, 1); | ^^^^^^^^^^^^^^^^^^^^^^ @@ -54,7 +54,7 @@ LL + let as Trait>::Assoc(_a, _b) = 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 as Trait>::Assoc(_a, _b) = as Trait>::Assoc(0, 1); | ^^^^^^^^^^^^^^^^^^^^^^ @@ -67,7 +67,7 @@ LL + let as Trait>::Assoc { 0: _a, 1: _b } = 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 as Trait>::Assoc(ref _a, ref mut _b, mut _c) = as Trait>::Assoc(0, 1, 2); | ^^^^^^^^^^^^^^^^^^^^^^ @@ -80,7 +80,7 @@ LL + let as Trait>::Assoc(ref _a, ref mut _b, mut _c) = 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 as Trait>::Assoc(ref _a, ref mut _b, mut _c) = as Trait>::Assoc(0, 1, 2); | ^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/feature-gates/feature-gate-more-qualified-paths.rs b/tests/ui/feature-gates/feature-gate-more-qualified-paths.rs deleted file mode 100644 index 2e05acbfa1758..0000000000000 --- a/tests/ui/feature-gates/feature-gate-more-qualified-paths.rs +++ /dev/null @@ -1,27 +0,0 @@ -fn main() { - // destructure through a qualified path - let ::Assoc { br } = StructStruct { br: 2 }; - //~^ ERROR usage of qualified paths in this context is experimental - let _ = ::Assoc { br: 2 }; - //~^ ERROR usage of qualified paths in this context is experimental - let ::V(..) = E::V(0); - //~^ ERROR usage of qualified paths in this context is experimental -} - -struct StructStruct { - br: i8, -} - -struct Foo; - -trait A { - type Assoc; -} - -impl A for Foo { - type Assoc = StructStruct; -} - -enum E { - V(u8) -} diff --git a/tests/ui/feature-gates/feature-gate-more-qualified-paths.stderr b/tests/ui/feature-gates/feature-gate-more-qualified-paths.stderr deleted file mode 100644 index e14ef828a57aa..0000000000000 --- a/tests/ui/feature-gates/feature-gate-more-qualified-paths.stderr +++ /dev/null @@ -1,33 +0,0 @@ -error[E0658]: usage of qualified paths in this context is experimental - --> $DIR/feature-gate-more-qualified-paths.rs:3:9 - | -LL | let ::Assoc { br } = StructStruct { br: 2 }; - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #86935 for more information - = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: usage of qualified paths in this context is experimental - --> $DIR/feature-gate-more-qualified-paths.rs:5:13 - | -LL | let _ = ::Assoc { br: 2 }; - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #86935 for more information - = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error[E0658]: usage of qualified paths in this context is experimental - --> $DIR/feature-gate-more-qualified-paths.rs:7:9 - | -LL | let ::V(..) = E::V(0); - | ^^^^^^ - | - = note: see issue #86935 for more information - = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - -error: aborting due to 3 previous errors - -For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs index 830a6390fce6d..2b2b8689a23c0 100644 --- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs +++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.rs @@ -1,7 +1,5 @@ // issue#121613 -#![feature(more_qualified_paths)] - struct S {} struct Foo; diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr index 10056bdf3d4f4..17c8e1feb7b58 100644 --- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr +++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-0.stderr @@ -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 @@ -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() {} | ^ diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs index 6b786332a8f43..221d6bcaa5ca0 100644 --- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs +++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.rs @@ -1,7 +1,5 @@ // issue#121613 -#![feature(more_qualified_paths)] - struct S { a: T } diff --git a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr index 632a9b99f84ef..51ba8a7891158 100644 --- a/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr +++ b/tests/ui/inference/need_type_info/incompat-call-after-qualified-path-1.stderr @@ -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 @@ -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() {} | ^ diff --git a/tests/ui/macros/stringify.rs b/tests/ui/macros/stringify.rs index 3f3d9252adbe8..3dcb1ed39e012 100644 --- a/tests/ui/macros/stringify.rs +++ b/tests/ui/macros/stringify.rs @@ -11,7 +11,6 @@ #![feature(explicit_tail_calls)] #![feature(if_let_guard)] #![feature(let_chains)] -#![feature(more_qualified_paths)] #![feature(never_patterns)] #![feature(trait_alias)] #![feature(try_blocks)] diff --git a/tests/ui/macros/vec-macro-in-pattern.rs b/tests/ui/macros/vec-macro-in-pattern.rs index 9b9a1edf54c9e..b633131995f6b 100644 --- a/tests/ui/macros/vec-macro-in-pattern.rs +++ b/tests/ui/macros/vec-macro-in-pattern.rs @@ -4,9 +4,9 @@ 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 usage of qualified paths in this context is experimental _ => {} } } diff --git a/tests/ui/macros/vec-macro-in-pattern.stderr b/tests/ui/macros/vec-macro-in-pattern.stderr index 71ba0ea5ad4f5..4a40d7a8b9ed2 100644 --- a/tests/ui/macros/vec-macro-in-pattern.stderr +++ b/tests/ui/macros/vec-macro-in-pattern.stderr @@ -7,17 +7,6 @@ LL | Some(vec![43]) => {} = note: function calls are not allowed in patterns: = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) -error[E0658]: usage of qualified paths in this context is experimental - --> $DIR/vec-macro-in-pattern.rs:7:14 - | -LL | Some(vec![43]) => {} - | ^^^^^^^^ - | - = note: see issue #86935 for more information - = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0164]: expected tuple struct or tuple variant, found associated function `<[_]>::into_vec` --> $DIR/vec-macro-in-pattern.rs:7:14 | @@ -27,7 +16,7 @@ LL | Some(vec![43]) => {} = help: for more information, visit https://doc.rust-lang.org/book/ch19-00-patterns.html = note: this error originates in the macro `vec` (in Nightly builds, run with -Z macro-backtrace for more info) -error: aborting due to 3 previous errors +error: aborting due to 2 previous errors -Some errors have detailed explanations: E0164, E0532, E0658. +Some errors have detailed explanations: E0164, E0532. For more information about an error, try `rustc --explain E0164`. diff --git a/tests/ui/nll/user-annotations/normalization-2.rs b/tests/ui/nll/user-annotations/normalization-2.rs index dddba2265c613..be5f877834d2a 100644 --- a/tests/ui/nll/user-annotations/normalization-2.rs +++ b/tests/ui/nll/user-annotations/normalization-2.rs @@ -1,9 +1,5 @@ // Make sure we honor region constraints when normalizing type annotations. -//@ check-fail - -#![feature(more_qualified_paths)] - trait Trait { type Assoc; } diff --git a/tests/ui/nll/user-annotations/normalization-2.stderr b/tests/ui/nll/user-annotations/normalization-2.stderr index dcf049a7a61a0..2598eb01afefe 100644 --- a/tests/ui/nll/user-annotations/normalization-2.stderr +++ b/tests/ui/nll/user-annotations/normalization-2.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/normalization-2.rs:43:12 + --> $DIR/normalization-2.rs:39:12 | LL | fn test_local<'a>() { | -- lifetime `'a` defined here @@ -7,7 +7,7 @@ LL | let _: Ty<'a> = MyTy::Unit; | ^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:48:6 + --> $DIR/normalization-2.rs:44:6 | LL | fn test_closure_sig<'a, 'b>() { | -- lifetime `'a` defined here @@ -15,7 +15,7 @@ LL | |_: Ty<'a>| {}; | ^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:50:11 + --> $DIR/normalization-2.rs:46:11 | LL | fn test_closure_sig<'a, 'b>() { | -- lifetime `'b` defined here @@ -29,7 +29,7 @@ help: the following changes may resolve your lifetime errors = help: replace `'b` with `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:55:5 + --> $DIR/normalization-2.rs:51:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'a` defined here @@ -37,7 +37,7 @@ LL | >::method::>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:57:5 + --> $DIR/normalization-2.rs:53:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'b` defined here @@ -46,7 +46,7 @@ LL | >::method::>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:60:5 + --> $DIR/normalization-2.rs:56:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'c` defined here @@ -55,7 +55,7 @@ LL | >::trait_method::>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'c` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:62:5 + --> $DIR/normalization-2.rs:58:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'d` defined here @@ -64,7 +64,7 @@ LL | >::trait_method::>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'d` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:65:5 + --> $DIR/normalization-2.rs:61:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'e` defined here @@ -73,7 +73,7 @@ LL | >::CONST; | ^^^^^^^^^^^^^^^ requires that `'e` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:67:5 + --> $DIR/normalization-2.rs:63:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'f` defined here @@ -82,7 +82,7 @@ LL | >::TRAIT_CONST; | ^^^^^^^^^^^^^^^^^^^^^ requires that `'f` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:75:5 + --> $DIR/normalization-2.rs:71:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'g` defined here @@ -91,7 +91,7 @@ LL | MyTy::Unit::>; | ^^^^^^^^^^^^^^^^^^^^ requires that `'g` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:77:5 + --> $DIR/normalization-2.rs:73:5 | LL | fn test_path<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>() { | -- lifetime `'h` defined here @@ -111,7 +111,7 @@ help: the following changes may resolve your lifetime errors = help: replace `'h` with `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:82:5 + --> $DIR/normalization-2.rs:78:5 | LL | fn test_call<'a, 'b, 'c>() { | -- lifetime `'a` defined here @@ -119,7 +119,7 @@ LL | >::method::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:84:5 + --> $DIR/normalization-2.rs:80:5 | LL | fn test_call<'a, 'b, 'c>() { | -- lifetime `'b` defined here @@ -134,7 +134,7 @@ help: the following changes may resolve your lifetime errors = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:89:5 + --> $DIR/normalization-2.rs:85:5 | LL | fn test_variants<'a, 'b, 'c>() { | -- lifetime `'a` defined here @@ -142,7 +142,7 @@ LL | >::Struct {}; | ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:91:5 + --> $DIR/normalization-2.rs:87:5 | LL | fn test_variants<'a, 'b, 'c>() { | -- lifetime `'b` defined here @@ -151,7 +151,7 @@ LL | >::Tuple(); | ^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:93:5 + --> $DIR/normalization-2.rs:89:5 | LL | fn test_variants<'a, 'b, 'c>() { | -- lifetime `'c` defined here @@ -166,7 +166,7 @@ help: the following changes may resolve your lifetime errors = help: replace `'c` with `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:98:7 + --> $DIR/normalization-2.rs:94:7 | LL | fn test_method_call<'a, 'b>(x: MyTy<()>) { | -- lifetime `'a` defined here @@ -174,7 +174,7 @@ LL | x.method2::>(); | ^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:100:7 + --> $DIR/normalization-2.rs:96:7 | LL | fn test_method_call<'a, 'b>(x: MyTy<()>) { | -- lifetime `'b` defined here @@ -189,7 +189,7 @@ help: the following changes may resolve your lifetime errors = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:117:5 + --> $DIR/normalization-2.rs:113:5 | LL | fn test_struct_path<'a, 'b, 'c, 'd>() { | -- lifetime `'a` defined here @@ -198,7 +198,7 @@ LL | MyTy::>::Struct {}; // without SelfTy | ^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:119:5 + --> $DIR/normalization-2.rs:115:5 | LL | fn test_struct_path<'a, 'b, 'c, 'd>() { | -- lifetime `'b` defined here @@ -207,7 +207,7 @@ LL | as Project>::Enum::Struct {}; // with SelfTy | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:123:5 + --> $DIR/normalization-2.rs:119:5 | LL | fn test_struct_path<'a, 'b, 'c, 'd>() { | -- lifetime `'c` defined here @@ -216,7 +216,7 @@ LL | Struct::> { x: None, }; // without SelfTy | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'c` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:125:5 + --> $DIR/normalization-2.rs:121:5 | LL | fn test_struct_path<'a, 'b, 'c, 'd>() { | -- lifetime `'d` defined here @@ -232,7 +232,7 @@ help: the following changes may resolve your lifetime errors = help: replace `'d` with `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:132:9 + --> $DIR/normalization-2.rs:128:9 | LL | fn test_pattern<'a, 'b, 'c, 'd, 'e, 'f>() { | -- lifetime `'a` defined here @@ -241,7 +241,7 @@ LL | Struct::> {..} => {}, | ^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:134:9 + --> $DIR/normalization-2.rs:130:9 | LL | fn test_pattern<'a, 'b, 'c, 'd, 'e, 'f>() { | -- lifetime `'b` defined here @@ -250,7 +250,7 @@ LL | Tuple::> (..) => {}, | ^^^^^^^^^^^^^^^^^^^^ requires that `'b` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:136:9 + --> $DIR/normalization-2.rs:132:9 | LL | fn test_pattern<'a, 'b, 'c, 'd, 'e, 'f>() { | -- lifetime `'c` defined here @@ -259,7 +259,7 @@ LL | Unit::> => {}, | ^^^^^^^^^^^^^^ requires that `'c` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:141:9 + --> $DIR/normalization-2.rs:137:9 | LL | fn test_pattern<'a, 'b, 'c, 'd, 'e, 'f>() { | -- lifetime `'d` defined here @@ -268,7 +268,7 @@ LL | >::Struct {..} => {}, | ^^^^^^^^^^^^^^^^^^^^^ requires that `'d` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:143:9 + --> $DIR/normalization-2.rs:139:9 | LL | fn test_pattern<'a, 'b, 'c, 'd, 'e, 'f>() { | -- lifetime `'e` defined here @@ -277,7 +277,7 @@ LL | >::Tuple (..) => {}, | ^^^^^^^^^^^^^^^^^^^^ requires that `'e` must outlive `'static` error: lifetime may not live long enough - --> $DIR/normalization-2.rs:145:9 + --> $DIR/normalization-2.rs:141:9 | LL | fn test_pattern<'a, 'b, 'c, 'd, 'e, 'f>() { | -- lifetime `'f` defined here diff --git a/tests/ui/parser/struct-literals-in-invalid-places.rs b/tests/ui/parser/struct-literals-in-invalid-places.rs index eed51b9458318..bcce4d969f71a 100644 --- a/tests/ui/parser/struct-literals-in-invalid-places.rs +++ b/tests/ui/parser/struct-literals-in-invalid-places.rs @@ -64,7 +64,6 @@ fn main() { fn env>() { if FOO == ::Out { x: one() } {} //~ ERROR struct literals are not allowed here - //~^ ERROR usage of qualified paths in this context is experimental } } diff --git a/tests/ui/parser/struct-literals-in-invalid-places.stderr b/tests/ui/parser/struct-literals-in-invalid-places.stderr index 39dc2d2efb75b..c2c7178011a38 100644 --- a/tests/ui/parser/struct-literals-in-invalid-places.stderr +++ b/tests/ui/parser/struct-literals-in-invalid-places.stderr @@ -163,16 +163,6 @@ help: surround the struct literal with parentheses LL | if FOO == (::Out { x: one() }) {} | + + -error[E0658]: usage of qualified paths in this context is experimental - --> $DIR/struct-literals-in-invalid-places.rs:66:19 - | -LL | if FOO == ::Out { x: one() } {} - | ^^^^^^^^^^^^^^^^^ - | - = note: see issue #86935 for more information - = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0277]: `bool` is not an iterator --> $DIR/struct-literals-in-invalid-places.rs:9:14 | @@ -228,7 +218,7 @@ help: use parentheses to call this closure LL | while (|| Foo { x: 3 }.hi())() { | + +++ -error: aborting due to 21 previous errors +error: aborting due to 20 previous errors -Some errors have detailed explanations: E0277, E0308, E0533, E0658. +Some errors have detailed explanations: E0277, E0308, E0533. For more information about an error, try `rustc --explain E0277`. diff --git a/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.rs b/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.rs index 17a5bad0e6c0f..5274118592055 100644 --- a/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.rs +++ b/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.rs @@ -1,10 +1,11 @@ // Regression test for #135209. // We ensure that we don't try to access fields on a non-struct pattern type. + fn main() { if let as Iterator>::Item { .. } = 1 { - //~^ ERROR E0658 - //~| ERROR E0071 + //~^ ERROR E0071 //~| ERROR E0277 + x //~ ERROR E0425 } } diff --git a/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.stderr b/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.stderr index 793c2d1e97fc0..899e157f2cd4b 100644 --- a/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.stderr +++ b/tests/ui/pattern/struct-pattern-on-non-struct-resolve-error.stderr @@ -1,34 +1,24 @@ error[E0425]: cannot find value `x` in this scope - --> $DIR/struct-pattern-on-non-struct-resolve-error.rs:8:9 + --> $DIR/struct-pattern-on-non-struct-resolve-error.rs:9:9 | LL | x | ^ not found in this scope -error[E0658]: usage of qualified paths in this context is experimental - --> $DIR/struct-pattern-on-non-struct-resolve-error.rs:4:12 - | -LL | if let as Iterator>::Item { .. } = 1 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: see issue #86935 for more information - = help: add `#![feature(more_qualified_paths)]` to the crate attributes to enable - = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date - error[E0071]: expected struct, variant or union type, found inferred type - --> $DIR/struct-pattern-on-non-struct-resolve-error.rs:4:12 + --> $DIR/struct-pattern-on-non-struct-resolve-error.rs:5:12 | LL | if let as Iterator>::Item { .. } = 1 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ not a struct error[E0277]: `Vec<()>` is not an iterator - --> $DIR/struct-pattern-on-non-struct-resolve-error.rs:4:12 + --> $DIR/struct-pattern-on-non-struct-resolve-error.rs:5:12 | LL | if let as Iterator>::Item { .. } = 1 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Vec<()>` is not an iterator | = help: the trait `Iterator` is not implemented for `Vec<()>` -error: aborting due to 4 previous errors +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0071, E0277, E0425, E0658. +Some errors have detailed explanations: E0071, E0277, E0425. For more information about an error, try `rustc --explain E0071`. diff --git a/tests/ui/unpretty/exhaustive.expanded.stdout b/tests/ui/unpretty/exhaustive.expanded.stdout index 9712ba58e627f..7d745cb13751b 100644 --- a/tests/ui/unpretty/exhaustive.expanded.stdout +++ b/tests/ui/unpretty/exhaustive.expanded.stdout @@ -19,7 +19,6 @@ #![feature(dyn_star)] #![feature(explicit_tail_calls)] #![feature(gen_blocks)] -#![feature(more_qualified_paths)] #![feature(never_patterns)] #![feature(never_type)] #![feature(pattern_types)] diff --git a/tests/ui/unpretty/exhaustive.hir.stderr b/tests/ui/unpretty/exhaustive.hir.stderr index 58f7ff0f59812..1c78cf98c59f1 100644 --- a/tests/ui/unpretty/exhaustive.hir.stderr +++ b/tests/ui/unpretty/exhaustive.hir.stderr @@ -1,17 +1,17 @@ error[E0697]: closures cannot be static - --> $DIR/exhaustive.rs:211:9 + --> $DIR/exhaustive.rs:210:9 | LL | static || value; | ^^^^^^^^^ error[E0697]: closures cannot be static - --> $DIR/exhaustive.rs:212:9 + --> $DIR/exhaustive.rs:211:9 | LL | static move || value; | ^^^^^^^^^^^^^^ error[E0728]: `await` is only allowed inside `async` functions and blocks - --> $DIR/exhaustive.rs:241:13 + --> $DIR/exhaustive.rs:240:13 | LL | fn expr_await() { | --------------- this is not `async` @@ -20,19 +20,19 @@ LL | fut.await; | ^^^^^ only allowed inside `async` functions and blocks error: in expressions, `_` can only be used on the left-hand side of an assignment - --> $DIR/exhaustive.rs:290:9 + --> $DIR/exhaustive.rs:289:9 | LL | _; | ^ `_` not allowed here error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:300:9 + --> $DIR/exhaustive.rs:299:9 | LL | x::(); | ^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:301:9 + --> $DIR/exhaustive.rs:300:9 | LL | x::(T, T) -> T; | ^^^^^^^^^^^^^^ only `Fn` traits may use parentheses @@ -44,31 +44,31 @@ LL + x:: -> T; | error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:302:9 + --> $DIR/exhaustive.rs:301:9 | LL | crate::() -> ()::expressions::() -> ()::expr_path; | ^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:302:26 + --> $DIR/exhaustive.rs:301:26 | LL | crate::() -> ()::expressions::() -> ()::expr_path; | ^^^^^^^^^^^^^^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:305:9 + --> $DIR/exhaustive.rs:304:9 | LL | core::()::marker::()::PhantomData; | ^^^^^^^^ only `Fn` traits may use parentheses error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:305:19 + --> $DIR/exhaustive.rs:304:19 | LL | core::()::marker::()::PhantomData; | ^^^^^^^^^^ only `Fn` traits may use parentheses error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks - --> $DIR/exhaustive.rs:392:9 + --> $DIR/exhaustive.rs:391:9 | LL | yield; | ^^^^^ @@ -79,7 +79,7 @@ LL | #[coroutine] fn expr_yield() { | ++++++++++++ error[E0703]: invalid ABI: found `C++` - --> $DIR/exhaustive.rs:472:23 + --> $DIR/exhaustive.rs:471:23 | LL | unsafe extern "C++" {} | ^^^^^ invalid ABI @@ -87,7 +87,7 @@ LL | unsafe extern "C++" {} = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions error: `..` patterns are not allowed here - --> $DIR/exhaustive.rs:679:13 + --> $DIR/exhaustive.rs:678:13 | LL | let ..; | ^^ @@ -95,13 +95,13 @@ LL | let ..; = note: only allowed in tuple, tuple struct, and slice patterns error[E0214]: parenthesized type parameters may only be used with a `Fn` trait - --> $DIR/exhaustive.rs:794:16 + --> $DIR/exhaustive.rs:793:16 | LL | let _: T() -> !; | ^^^^^^^^ only `Fn` traits may use parentheses error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:809:16 + --> $DIR/exhaustive.rs:808:16 | LL | let _: impl Send; | ^^^^^^^^^ @@ -112,7 +112,7 @@ LL | let _: impl Send; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:810:16 + --> $DIR/exhaustive.rs:809:16 | LL | let _: impl Send + 'static; | ^^^^^^^^^^^^^^^^^^^ @@ -123,7 +123,7 @@ LL | let _: impl Send + 'static; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:811:16 + --> $DIR/exhaustive.rs:810:16 | LL | let _: impl 'static + Send; | ^^^^^^^^^^^^^^^^^^^ @@ -134,7 +134,7 @@ LL | let _: impl 'static + Send; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:812:16 + --> $DIR/exhaustive.rs:811:16 | LL | let _: impl ?Sized; | ^^^^^^^^^^^ @@ -145,7 +145,7 @@ LL | let _: impl ?Sized; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:813:16 + --> $DIR/exhaustive.rs:812:16 | LL | let _: impl ~const Clone; | ^^^^^^^^^^^^^^^^^ @@ -156,7 +156,7 @@ LL | let _: impl ~const Clone; = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0562]: `impl Trait` is not allowed in the type of variable bindings - --> $DIR/exhaustive.rs:814:16 + --> $DIR/exhaustive.rs:813:16 | LL | let _: impl for<'a> Send; | ^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/unpretty/exhaustive.hir.stdout b/tests/ui/unpretty/exhaustive.hir.stdout index c20f123b16e83..b1f6003f0d726 100644 --- a/tests/ui/unpretty/exhaustive.hir.stdout +++ b/tests/ui/unpretty/exhaustive.hir.stdout @@ -18,7 +18,6 @@ #![feature(dyn_star)] #![feature(explicit_tail_calls)] #![feature(gen_blocks)] -#![feature(more_qualified_paths)] #![feature(never_patterns)] #![feature(never_type)] #![feature(pattern_types)] diff --git a/tests/ui/unpretty/exhaustive.rs b/tests/ui/unpretty/exhaustive.rs index 60ad3564689d7..29dafc00f71a5 100644 --- a/tests/ui/unpretty/exhaustive.rs +++ b/tests/ui/unpretty/exhaustive.rs @@ -18,7 +18,6 @@ #![feature(dyn_star)] #![feature(explicit_tail_calls)] #![feature(gen_blocks)] -#![feature(more_qualified_paths)] #![feature(never_patterns)] #![feature(never_type)] #![feature(pattern_types)]