Skip to content

Commit b3b6baf

Browse files
authored
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.
2 parents 3d8d9da + b4d3fa4 commit b3b6baf

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

compiler/rustc_ast_lowering/src/item.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -764,18 +764,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
764764
&mut self,
765765
(index, f): (usize, &FieldDef),
766766
) -> hir::FieldDef<'hir> {
767-
let ty = if let TyKind::Path(qself, path) = &f.ty.kind {
768-
let t = self.lower_path_ty(
769-
&f.ty,
770-
qself,
771-
path,
772-
ParamMode::ExplicitNamed, // no `'_` in declarations (Issue #61124)
773-
ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy),
774-
);
775-
self.arena.alloc(t)
776-
} else {
777-
self.lower_ty(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy))
778-
};
767+
let ty = self.lower_ty(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy));
779768
let hir_id = self.lower_node_id(f.id);
780769
self.lower_attrs(hir_id, &f.attrs);
781770
hir::FieldDef {

compiler/rustc_ast_lowering/src/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,6 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
482482
enum ParamMode {
483483
/// Any path in a type context.
484484
Explicit,
485-
/// Path in a type definition, where the anonymous lifetime `'_` is not allowed.
486-
ExplicitNamed,
487485
/// The `module::Type` in `module::Type::method` in an expression.
488486
Optional,
489487
}

0 commit comments

Comments
 (0)