summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-08-26 15:03:30 -0400
committerMichael Goulet <michael@errs.io>2024-09-20 22:18:57 -0400
commit51b51bb570e076d981e12a8e221ed3a74b3025c6 (patch)
tree06305f9799cc1656ab6edc9bfab4362d4e32e82c /compiler/rustc_ast_lowering
parent19881b5a5a17b4fbc91529f867ca4e577af6438a (diff)
downloadrust-51b51bb570e076d981e12a8e221ed3a74b3025c6.tar.gz
rust-51b51bb570e076d981e12a8e221ed3a74b3025c6.zip
Implement RTN in resolve_bound_vars and HIR ty lowering
Diffstat (limited to 'compiler/rustc_ast_lowering')
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs4
-rw-r--r--compiler/rustc_ast_lowering/src/path.rs5
2 files changed, 4 insertions, 5 deletions
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))]