Skip to content

Commit

Permalink
fix dropping diagnostic without emit
Browse files Browse the repository at this point in the history
  • Loading branch information
Ezrashaw committed Jan 16, 2023
1 parent e590b93 commit fcd5ed2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_parse/src/parser/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,8 @@ impl<'a> Parser<'a> {
&& let Some(path) = self.recover_path_from_fn()
{
path
} else if !self.token.is_path_start() && self.token.can_begin_type() && let Ok(ty) = self.parse_ty_no_plus() {
} else if !self.token.is_path_start() && self.token.can_begin_type() {
let ty = self.parse_ty_no_plus()?;
// Instead of finding a path (a trait), we found a type.
let mut err = self.struct_span_err(ty.span, "expected a trait, found type");

Expand Down

0 comments on commit fcd5ed2

Please sign in to comment.