diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-18 21:14:02 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-12-24 07:59:21 +1100 |
| commit | d51db05d7ee1a12ee168f2d1ccc93ccc11b216c7 (patch) | |
| tree | 6a1bd10bfc900bacf504f9b5e5b7b64378d00e04 /compiler/rustc_parse/src/parser/path.rs | |
| parent | ec9af0d6cb6386c7be6056a71366d275d5ca3e1e (diff) | |
| download | rust-d51db05d7ee1a12ee168f2d1ccc93ccc11b216c7.tar.gz rust-d51db05d7ee1a12ee168f2d1ccc93ccc11b216c7.zip | |
Remove `ParseSess` methods that duplicate `DiagCtxt` methods.
Also add missing `#[track_caller]` attributes to `DiagCtxt` methods as necessary to keep tests working.
Diffstat (limited to 'compiler/rustc_parse/src/parser/path.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/path.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 047983836a2..4253c0ae421 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -175,7 +175,7 @@ impl<'a> Parser<'a> { .filter_map(|segment| segment.args.as_ref()) .map(|arg| arg.span()) .collect::<Vec<_>>(); - parser.sess.emit_err(errors::GenericsInPath { span }); + parser.dcx().emit_err(errors::GenericsInPath { span }); } }; @@ -246,7 +246,7 @@ impl<'a> Parser<'a> { && self.look_ahead(1, |token| self.token.span.hi() == token.span.lo()) { self.bump(); // bump past the colon - self.sess.emit_err(PathSingleColon { + self.dcx().emit_err(PathSingleColon { span: self.prev_token.span, type_ascription: self .sess @@ -350,7 +350,7 @@ impl<'a> Parser<'a> { && self.look_ahead(1, |tok| tok.kind == token::DotDot) { self.bump(); - self.sess + self.dcx() .emit_err(errors::BadReturnTypeNotationDotDot { span: self.token.span }); self.bump(); self.expect(&token::CloseDelim(Delimiter::Parenthesis))?; @@ -359,7 +359,7 @@ impl<'a> Parser<'a> { if self.eat_noexpect(&token::RArrow) { let lo = self.prev_token.span; let ty = self.parse_ty()?; - self.sess + self.dcx() .emit_err(errors::BadReturnTypeNotationOutput { span: lo.to(ty.span) }); } @@ -535,7 +535,7 @@ impl<'a> Parser<'a> { // i.e. no multibyte characters, in this range. let span = lo .with_hi(lo.lo() + BytePos(snapshot.unmatched_angle_bracket_count.into())); - self.sess.emit_err(errors::UnmatchedAngle { + self.dcx().emit_err(errors::UnmatchedAngle { span, plural: snapshot.unmatched_angle_bracket_count > 1, }); @@ -678,7 +678,7 @@ impl<'a> Parser<'a> { c.into() } Some(GenericArg::Lifetime(lt)) => { - self.sess.emit_err(errors::AssocLifetime { span, lifetime: lt.ident.span }); + self.dcx().emit_err(errors::AssocLifetime { span, lifetime: lt.ident.span }); self.mk_ty(span, ast::TyKind::Err).into() } None => { |
