Make sure we deny unimplemented RTN on qpath segments

This commit is contained in:
Michael Goulet
2024-06-28 14:10:32 -04:00
parent b1a0c0b123
commit 82b4af7511
5 changed files with 112 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
use crate::ImplTraitPosition;
use super::errors::{
AsyncBoundNotOnTrait, AsyncBoundOnlyForFnTraits, GenericTypeWithParentheses, UseAngleBrackets,
AsyncBoundNotOnTrait, AsyncBoundOnlyForFnTraits, BadReturnTypeNotation,
GenericTypeWithParentheses, UseAngleBrackets,
};
use super::ResolverAstLoweringExt;
use super::{GenericArgsCtor, LifetimeRes, ParenthesizedGenericArgs};
@@ -276,8 +277,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
)
}
},
GenericArgs::ParenthesizedElided(_span) => {
todo!()
GenericArgs::ParenthesizedElided(span) => {
self.dcx().emit_err(BadReturnTypeNotation::Position { span: *span });
(
GenericArgsCtor {
args: Default::default(),
constraints: &[],
parenthesized: hir::GenericArgsParentheses::ReturnTypeNotation,
span: *span,
},
false,
)
}
}
} else {