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

Mark Parser::eat/check methods as #[must_use] #128376

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Jul 30, 2024

These methods return a bool, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists).

I changed a few places from eat to expect, but otherwise I tried to leave a comment explaining why the eat was okay.

This also adds a test for the pattern_type! macro, which used to silently accept a missing is token.

@rustbot
Copy link
Collaborator

rustbot commented Jul 30, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Jul 30, 2024
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

lol rustfmt 🤦

@compiler-errors compiler-errors 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 Jul 30, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

The compiler changes look reasonable to me, not sure what the rustfmt change procedure is.

@compiler-errors
Copy link
Member Author

I'll push a commit on top for rustfmt. I will just suppress the warnings rather than affect any logic.

@rustbot
Copy link
Collaborator

rustbot commented Jul 30, 2024

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks, r=me once PR CI is green

@compiler-errors
Copy link
Member Author

@bors r=jieyouxu

@bors
Copy link
Contributor

bors commented Jul 30, 2024

📌 Commit 4776ac0 has been approved by jieyouxu

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 Jul 30, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 30, 2024
…es, r=jieyouxu

Mark `Parser::eat`/`check` methods as `#[must_use]`

These methods return a `bool`, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists).

I changed a few places from `eat` to `expect`, but otherwise I tried to leave a comment explaining why the `eat` was okay.

This also adds a test for the `pattern_type!` macro, which used to silently accept a missing `is` token.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 30, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#127543 (More unsafe attr verification)
 - rust-lang#128357 (Detect non-lifetime binder params shadowing item params)
 - rust-lang#128367 (CI: rfl: build the generated doctests and documentation)
 - rust-lang#128376 (Mark `Parser::eat`/`check` methods as `#[must_use]`)
 - rust-lang#128379 (the output in stderr expects panic-unwind)
 - rust-lang#128380 (make `///` doc comments compatible with naked functions)
 - rust-lang#128382 (cargo-miri: better error when we seem to run inside bootstrap but something is wrong)
 - rust-lang#128398 (tidy: Fix quote in error message)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 30, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#128357 (Detect non-lifetime binder params shadowing item params)
 - rust-lang#128367 (CI: rfl: build the generated doctests and documentation)
 - rust-lang#128376 (Mark `Parser::eat`/`check` methods as `#[must_use]`)
 - rust-lang#128379 (the output in stderr expects panic-unwind)
 - rust-lang#128380 (make `///` doc comments compatible with naked functions)
 - rust-lang#128382 (cargo-miri: better error when we seem to run inside bootstrap but something is wrong)
 - rust-lang#128398 (tidy: Fix quote in error message)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6f0b237 into rust-lang:master Jul 31, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 31, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jul 31, 2024
Rollup merge of rust-lang#128376 - compiler-errors:finish-ur-vegetables, r=jieyouxu

Mark `Parser::eat`/`check` methods as `#[must_use]`

These methods return a `bool`, but we probably should either use these values or explicitly throw them away (e.g. when we just want to unconditionally eat a token if it exists).

I changed a few places from `eat` to `expect`, but otherwise I tried to leave a comment explaining why the `eat` was okay.

This also adds a test for the `pattern_type!` macro, which used to silently accept a missing `is` token.
@Kobzol
Copy link
Contributor

Kobzol commented Jul 31, 2024

@rust-timer build 61c9d37 (just testing the collector)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (61c9d37): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

This benchmark run did not return any relevant results for this metric.

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 769.587s -> 770.252s (0.09%)
Artifact size: 331.78 MiB -> 331.93 MiB (0.05%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

7 participants