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.
This commit is contained in:
commit
b3b6baf833
@ -764,18 +764,7 @@ pub(super) fn lower_field_def(
|
|||||||
&mut self,
|
&mut self,
|
||||||
(index, f): (usize, &FieldDef),
|
(index, f): (usize, &FieldDef),
|
||||||
) -> hir::FieldDef<'hir> {
|
) -> hir::FieldDef<'hir> {
|
||||||
let ty = if let TyKind::Path(qself, path) = &f.ty.kind {
|
let ty = self.lower_ty(&f.ty, ImplTraitContext::Disallowed(ImplTraitPosition::FieldTy));
|
||||||
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 hir_id = self.lower_node_id(f.id);
|
let hir_id = self.lower_node_id(f.id);
|
||||||
self.lower_attrs(hir_id, &f.attrs);
|
self.lower_attrs(hir_id, &f.attrs);
|
||||||
hir::FieldDef {
|
hir::FieldDef {
|
||||||
|
@ -482,8 +482,6 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
|
|||||||
enum ParamMode {
|
enum ParamMode {
|
||||||
/// Any path in a type context.
|
/// Any path in a type context.
|
||||||
Explicit,
|
Explicit,
|
||||||
/// Path in a type definition, where the anonymous lifetime `'_` is not allowed.
|
|
||||||
ExplicitNamed,
|
|
||||||
/// The `module::Type` in `module::Type::method` in an expression.
|
/// The `module::Type` in `module::Type::method` in an expression.
|
||||||
Optional,
|
Optional,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user