Parser: Suggest Placing the Return Type After Function Parameters

This commit is contained in:
Veera 2024-07-04 19:19:15 -04:00
parent 5834772177
commit 4cad705017
6 changed files with 123 additions and 39 deletions

View file

@ -21,6 +21,11 @@ use rustc_span::symbol::{kw, sym, Ident};
use rustc_span::{ErrorGuaranteed, Span, Symbol};
use thin_vec::{thin_vec, ThinVec};
/// Signals whether parsing a type should allow `+`.
///
/// For example, let T be the type `impl Default + 'static`
/// With `AllowPlus::Yes`, T will be parsed successfully
/// With `AllowPlus::No`, parsing T will return a parse error
#[derive(Copy, Clone, PartialEq)]
pub(super) enum AllowPlus {
Yes,