diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 21:09:22 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-24 07:48:47 +1100 |
| commit | ec9af0d6cb6386c7be6056a71366d275d5ca3e1e (patch) | |
| tree | bc1f47d1b6ffcd24303a9572161c463408f5e0e5 /compiler/rustc_parse/src/parser/generics.rs | |
| parent | d86a48278f7bcd069a56870a70c6376e77bd4ee5 (diff) | |
| download | rust-ec9af0d6cb6386c7be6056a71366d275d5ca3e1e.tar.gz rust-ec9af0d6cb6386c7be6056a71366d275d5ca3e1e.zip | |
Remove `Parser` methods that duplicate `DiagCtxt` methods.
Diffstat (limited to 'compiler/rustc_parse/src/parser/generics.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/generics.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs index 20f67b284b2..6a3b4c1bcb0 100644 --- a/compiler/rustc_parse/src/parser/generics.rs +++ b/compiler/rustc_parse/src/parser/generics.rs @@ -64,7 +64,7 @@ impl<'a> Parser<'a> { Ok(p) => { if let TyKind::ImplTrait(_, bounds) = &p.kind { let span = impl_span.to(self.token.span.shrink_to_lo()); - let mut err = self.struct_span_err( + let mut err = self.dcx().struct_span_err( span, "expected trait bound, found `impl Trait` type", ); @@ -141,7 +141,7 @@ impl<'a> Parser<'a> { // Parse optional const generics default value. let default = if self.eat(&token::Eq) { Some(self.parse_const_arg()?) } else { None }; - let mut err = self.struct_span_err( + let mut err = self.dcx().struct_span_err( mistyped_const_ident.span, format!("`const` keyword was mistyped as `{}`", mistyped_const_ident.as_str()), ); |
