From 51b51bb570e076d981e12a8e221ed3a74b3025c6 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Mon, 26 Aug 2024 15:03:30 -0400 Subject: Implement RTN in resolve_bound_vars and HIR ty lowering --- compiler/rustc_ast_lowering/src/lib.rs | 4 ++-- compiler/rustc_ast_lowering/src/path.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_ast_lowering/src') diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index d59197b396a..5266eb0e91f 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -487,11 +487,12 @@ enum ParamMode { #[derive(Copy, Clone, Debug)] enum AllowReturnTypeNotation { + /// Only in types, since RTN is denied later during HIR lowering. Yes, + /// All other positions (path expr, method, use tree). No, } -#[derive(Copy, Clone, Debug)] enum GenericArgsMode { ParenSugar, ReturnTypeNotation, @@ -1239,7 +1240,6 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> { qself, path, param_mode, - // We deny these after the fact in HIR->middle type lowering. AllowReturnTypeNotation::Yes, itctx, None, diff --git a/compiler/rustc_ast_lowering/src/path.rs b/compiler/rustc_ast_lowering/src/path.rs index 491c0dfc42e..6f0641dbc40 100644 --- a/compiler/rustc_ast_lowering/src/path.rs +++ b/compiler/rustc_ast_lowering/src/path.rs @@ -16,10 +16,9 @@ use super::errors::{ GenericTypeWithParentheses, UseAngleBrackets, }; use super::{ - AllowReturnTypeNotation, GenericArgsCtor, GenericArgsMode, ImplTraitContext, LifetimeRes, - LoweringContext, ParamMode, ResolverAstLoweringExt, + AllowReturnTypeNotation, GenericArgsCtor, GenericArgsMode, ImplTraitContext, ImplTraitPosition, + LifetimeRes, LoweringContext, ParamMode, ResolverAstLoweringExt, }; -use crate::ImplTraitPosition; impl<'a, 'hir> LoweringContext<'a, 'hir> { #[instrument(level = "trace", skip(self))] -- cgit 1.4.1-3-g733a5