diff options
| author | bors <bors@rust-lang.org> | 2024-01-06 15:50:44 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-01-06 15:50:44 +0000 |
| commit | b6a8c762eed0ae0383658c38d65cb91bbd9800a1 (patch) | |
| tree | f8b0eccaad8e13a182a0d397b0ed5e37b8119d4d /compiler/rustc_parse/src/parser | |
| parent | 9212108a9b32cc381995cf509dd2627123c11a25 (diff) | |
| parent | 5f0f02810684e1d08c5d1a38acff79f5300086f0 (diff) | |
| download | rust-b6a8c762eed0ae0383658c38d65cb91bbd9800a1.tar.gz rust-b6a8c762eed0ae0383658c38d65cb91bbd9800a1.zip | |
Auto merge of #119662 - matthiaskrgr:rollup-ehofh5n, r=matthiaskrgr
Rollup of 9 pull requests
Successful merges:
- #118194 (rustdoc: search for tuples and unit by type with `()`)
- #118781 (merge core_panic feature into panic_internals)
- #119486 (pass allow-{dirty,staged} to clippy)
- #119591 (rustc_mir_transform: Make DestinationPropagation stable for queries)
- #119595 (Fixed ambiguity in hint.rs)
- #119624 (rustc_span: More consistent span combination operations)
- #119653 (compiler: update Fuchsia sanitizer support.)
- #119655 (Remove ignore-stage1 that was added when changing error count msg)
- #119661 (Strip lld-wrapper binaries)
r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs index 0b24e784126..880743ddd3c 100644 --- a/compiler/rustc_parse/src/parser/expr.rs +++ b/compiler/rustc_parse/src/parser/expr.rs @@ -2489,7 +2489,7 @@ impl<'a> Parser<'a> { } ExprKind::Block(_, None) => { this.dcx().emit_err(errors::IfExpressionMissingCondition { - if_span: lo.shrink_to_hi(), + if_span: lo.with_neighbor(cond.span).shrink_to_hi(), block_span: self.sess.source_map().start_point(cond_span), }); std::mem::replace(&mut cond, this.mk_expr_err(cond_span.shrink_to_hi())) @@ -3735,7 +3735,7 @@ impl<'a> Parser<'a> { } pub(crate) fn mk_expr(&self, span: Span, kind: ExprKind) -> P<Expr> { - P(Expr { kind, span, attrs: AttrVec::new(), id: DUMMY_NODE_ID, tokens: None }) + self.mk_expr_with_attrs(span, kind, AttrVec::new()) } pub(super) fn mk_expr_err(&self, span: Span) -> P<Expr> { diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 0ac0b678aba..2ce27ff66e1 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -2118,7 +2118,7 @@ impl<'a> Parser<'a> { Applicability::MaybeIncorrect, ); err.span_suggestion( - span.shrink_to_hi(), + span.with_neighbor(self.token.span).shrink_to_hi(), "add a semicolon", ';', Applicability::MaybeIncorrect, @@ -2632,7 +2632,7 @@ impl<'a> Parser<'a> { let is_name_required = match this.token.kind { token::DotDotDot => false, - _ => req_name(this.token.span.edition()), + _ => req_name(this.token.span.with_neighbor(this.prev_token.span).edition()), }; let (pat, ty) = if is_name_required || this.is_named_param() { debug!("parse_param_general parse_pat (is_name_required:{})", is_name_required); |
