Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect misparsed binop caused by missing semi #117292

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Oct 27, 2023

When encountering

foo()
*bar = baz;

We currently emit potentially two errors, one for the return type of
foo not being multiplicative by the type of bar, and another for
foo() * bar not being assignable.

We now check for this case and suggest adding a semicolon in the right
place and emit only a single error.

Fix #80446.

When encountering

```rust
foo()
*bar = baz;
```

We currently emit potentially two errors, one for the return type of
`foo` not being multiplyiable by the type of `bar`, and another for
`foo() * bar` not being assignable.

We now check for this case and suggest adding a semicolon in the right
place.

Fix rust-lang#80446.
@rustbot
Copy link
Collaborator

rustbot commented Oct 27, 2023

r? @davidtwco

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 27, 2023
Copy link
Member

@davidtwco davidtwco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me with this change

compiler/rustc_hir_typeck/src/op.rs Show resolved Hide resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2023
@estebank
Copy link
Contributor Author

estebank commented Nov 6, 2023

@bors r=davidtwco

@bors
Copy link
Contributor

bors commented Nov 6, 2023

📌 Commit 4b7aaca has been approved by davidtwco

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 6, 2023
@bors
Copy link
Contributor

bors commented Nov 6, 2023

⌛ Testing commit 4b7aaca with merge fb61292...

@bors
Copy link
Contributor

bors commented Nov 6, 2023

☀️ Test successful - checks-actions
Approved by: davidtwco
Pushing fb61292 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 6, 2023
@bors bors merged commit fb61292 into rust-lang:master Nov 6, 2023
12 checks passed
@rustbot rustbot added this to the 1.75.0 milestone Nov 6, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fb61292): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.4%, 0.4%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.4%, 1.0%] 3
Regressions ❌
(secondary)
2.1% [0.7%, 3.6%] 2
Improvements ✅
(primary)
-0.9% [-1.3%, -0.6%] 3
Improvements ✅
(secondary)
-3.4% [-3.5%, -3.3%] 2
All ❌✅ (primary) -0.1% [-1.3%, 1.0%] 6

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.4%, 0.4%] 1

Binary size

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.0%, -0.0%] 2
All ❌✅ (primary) - - 0

Bootstrap: 663.447s -> 662.377s (-0.16%)
Artifact size: 308.96 MiB -> 308.98 MiB (0.01%)

bors-ferrocene bot added a commit to ferrocene/ferrocene that referenced this pull request Nov 7, 2023
89: Automated pull from upstream `master` r=Dajamante a=github-actions[bot]


This PR pulls the following changes from the upstream repository:

* rust-lang/rust#117006
* rust-lang/rust#117511
* rust-lang/rust#117641
  * rust-lang/rust#117637
  * rust-lang/rust#117631
  * rust-lang/rust#117516
  * rust-lang/rust#117190
* rust-lang/rust#117292
* rust-lang/rust#117603
* rust-lang/rust#116988
* rust-lang/rust#117630
  * rust-lang/rust#117615
  * rust-lang/rust#117613
  * rust-lang/rust#117592
* rust-lang/rust#117578
* rust-lang/rust#117435
* rust-lang/rust#117607



90: bump serde and serde_derive r=tshepang a=Dajamante

Trying to get around the failure seen in #86 

Co-authored-by: Ralf Jung <post@ralfj.de>
Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
Co-authored-by: SparrowLii <liyuan179@huawei.com>
Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
Co-authored-by: Gurinder Singh <frederick.the.fool@gmail.com>
Co-authored-by: Michael Goulet <michael@errs.io>
Co-authored-by: Thom Chiovoloni <thom@shift.click>
Co-authored-by: klensy <klensy@users.noreply.github.com>
Co-authored-by: Jack Huey <31162821+jackh726@users.noreply.github.com>
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Co-authored-by: hkalbasi <hamidrezakalbasi@protonmail.com>
Co-authored-by: bors <bors@rust-lang.org>
Co-authored-by: Sven Marnach <sven@mozilla.com>
Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
Co-authored-by: aissata <aimaiga2@gmail.com>
celinval added a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
Update Rust toolchain from nightly-2023-11-06 to nightly-2023-11-07
without any other source changes.
This is an automatically generated pull request. If any of the CI checks
fail, manual intervention is required. In such a case, review the
changes at https://github.com/rust-lang/rust from
rust-lang@fee5518
up to
rust-lang@189d6c7.
The log for this commit range is:
rust-lang@189d6c71f3 Auto merge of
rust-lang#117641 - matthiaskrgr:rollup-f9c12td, r=matthiaskrgr
rust-lang@9efe60b1eb Rollup merge of
rust-lang#117637 - lqd:trivial-bounds-with-binder-vars, r=compiler-errors
rust-lang@2a1f8bccee Rollup merge of
rust-lang#117631 - smarnach:error-request-doc-fix, r=ChrisDenton
rust-lang@8a34fea835 Rollup merge of
rust-lang#117516 - matthiaskrgr:test_effects_113375_oob, r=fee1-dead
rust-lang@1683df7d3b Rollup merge of
rust-lang#117190 - matthiaskrgr:test_effects_113381, r=fee1-dead
rust-lang@fb61292105 Auto merge of
rust-lang#117292 - estebank:issue-80446, r=davidtwco
rust-lang@4b7aacaa4f Silence redundant
error on typo resulting on binop
rust-lang@aea82b268a Auto merge of
rust-lang#117603 - HKalbasi:make-feature-additive, r=Nilstrieb
rust-lang@58351ae03f add test for trivial
bound not holding in `soa-derive`
rust-lang@2beca157c9 check binders with
bound vars for global bounds that don't hold
rust-lang@b049093560 Auto merge of
rust-lang#116988 - RalfJung:null, r=WaffleLapkin
rust-lang@e1fcecb1b9 Auto merge of
rust-lang#117630 - matthiaskrgr:rollup-v0d5p3f, r=matthiaskrgr
rust-lang@3a096e96fa Documentation
cleanup for core::error::Request.
rust-lang@b88d62e222 Rollup merge of
rust-lang#117615 - bjorn3:misc_changes, r=davidtwco
rust-lang@ec35c03143 Rollup merge of
rust-lang#117613 - jackh726:vacation, r=compiler-errors
rust-lang@60dca87cff Rollup merge of
rust-lang#117592 - thomcc:env-span-wrong, r=davidtwco
rust-lang@6bf2fb3679 Auto merge of
rust-lang#117578 - compiler-errors:derive-encode-in-rustc_type_ir, r=davidtwco
rust-lang@f9b644636f Auto merge of
rust-lang#117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwco
rust-lang@fcca978aa0 Auto merge of
rust-lang#117607 - klensy:clang-17.0.4, r=Mark-Simulacrum
rust-lang@152a4e90d1 Auto merge of
rust-lang#117585 - dnbln:feat/move-kw-span, r=cjgillot
rust-lang@f2a40e99ff use portable
AtomicU64 for powerPC and MIPS
rust-lang@7a892ab8d8 Auto merge of
rust-lang#117576 - the8472:fix-io-copy-vec, r=Mark-Simulacrum
rust-lang@c8a25eddfe Make the randomize
feature of rustc_abi additive
rust-lang@ec29a02071 Update doc comment
for CodegenBackend::link
rust-lang@ba82056a14 Use the actual
computed crate name for -Zprint-vtable-sizes
rust-lang@1a1b10fa63 Don't steal the
parse query when using --pretty
rust-lang@6e33e89337 Remove from vacation
and compiler review group
rust-lang@38ff91c453 bump clang version
for dist-x86_64-linux from 17.0.2 to 17.0.4
rust-lang@86fca873ba Use the correct span
when emitting the `env!` result
rust-lang@c077147200 fix clippy author
and failing test
rust-lang@876f698790 Add the
vis.visit_capture_by() in noop_visit_expr
rust-lang@54ce0346c0 add `fn
visit_capture_by` to MutVisitor and fix pprust-expr-roundtrip.rs
rust-lang@df85b28b72 fixes for rustfmt +
ast visitor
rust-lang@a6b41aa6ba fmt
rust-lang@241a654c07 Fix remaining uses
of `CaptureBy::Value`
rust-lang@8de489918b feat(hir): Store the
`Span` of the `move` keyword
rust-lang@bee7b5889e Derive
TyEncodable/TyDecodable implementations that are parameterized over
interner
rust-lang@78aa5e511c detect EOF earlier
rust-lang@8d8f06b277 avoid excessive
initialization when copying to a Vec
rust-lang@666cad9a5f add test for rust-lang#113375
rust-lang@384f7382ba add test for rust-lang#113381
rust-lang@248dd14fa5 update
config.example.toml
rust-lang@bf5fb7614b update bootstrap
change history
rust-lang@ab8101d019 enable parallel
rustc in nightly builds
rust-lang@231f93524d Detect misparsed
binop caused by missing semi
rust-lang@98d54da1ee document that the
null pointer has the 0 address

---------

Co-authored-by: celinval <celinval@users.noreply.github.com>
Co-authored-by: Zyad Hassan <zyadh@amazon.com>
Co-authored-by: Zyad Hassan <88045115+zhassan-aws@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid error message for a line missing semicolon
5 participants