diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-08-27 00:42:02 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-27 00:42:02 +0200 |
| commit | b3b6baf8336c4a016580bdf6e210ec1925c738ad (patch) | |
| tree | 006b9ca64ea7386554102510b11aeae3a707984b /compiler | |
| parent | 3d8d9da6a0db79cfc4b4ac5af0a72f797f988c1a (diff) | |
| parent | b4d3fa4829c5366d1b7837f0d73c67def517b66d (diff) | |
| download | rust-b3b6baf8336c4a016580bdf6e210ec1925c738ad.tar.gz rust-b3b6baf8336c4a016580bdf6e210ec1925c738ad.zip | |
Rollup merge of #129626 - compiler-errors:explicit-named, r=fmease
Remove `ParamMode::ExplicitNamed` This was introduced as a hack to improve a diagnostics suggestion in #61679. It was subsequently broken, but also it was an incomplete hack that I don't believe we need to support, so let's just remove it.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_ast_lowering/src/item.rs | 13 | ||||
| -rw-r--r-- | compiler/rustc_ast_lowering/src/lib.rs | 2 |
2 files changed, 1 insertions, 14 deletions
diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 54e43ea82a7..c8ec8f308a8 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -764,18 +764,7 @@ impl<'hir> LoweringContext<'_, 'hir> { &mut self, (index, f): (usize, &FieldDef), ) -> hir::FieldDef<'hir> { - let ty = if let TyKind::Path(qself, path) = &f.ty.kind { - let t = self.lower_path_ty( - &f.ty, - qself, - path, - ParamMode::ExplicitNamed, // no `'_` in declarations (Issue #61124) - ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy), - ); - self.arena.alloc(t) - } else { - self.lower_ty(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy)) - }; + let ty = self.lower_ty(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy)); let hir_id = self.lower_node_id(f.id); self.lower_attrs(hir_id, &f.attrs); hir::FieldDef { diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index 44d50e4b519..bcc2c29a2ff 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -482,8 +482,6 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> { enum ParamMode { /// Any path in a type context. Explicit, - /// Path in a type definition, where the anonymous lifetime `'_` is not allowed. - ExplicitNamed, /// The `module::Type` in `module::Type::method` in an expression. Optional, } |
