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

Address comments from PR #8418. #8467

Closed
wants to merge 1 commit into from

Conversation

pnkfelix
Copy link
Member

Comments addressed were:

  • nit: we prefer "expected foo, found bar" to "expected foo but found bar"
  • nit: lowercase initial letter of error message
    • (i fixed other instances of this in the file that were not part of the original PR)
  • "just do let _ = s;" (for suppressing unused variable warning).

@emberian
Copy link
Member

rollup candidate

@pnkfelix
Copy link
Member Author

�So now I'm torn. Maybe this could land with a simply bors retry; I cannot tell from the error message. But it such a minor patch, maybe it should just be put into a rollup instead. Since I cannot decide between those options (and am not inclined to do a roll-up myself), I have just left this PR open.

But then, Graydon asked recently for people to close failed PR's in order to bring down the amount that bors stresses the github API (since it was hitting the rate limit). So now it seems like even leaving the PR open is not a great choice. (But the changes are legitimate, so I don't want to close it unless I can convince myself that I will repost it later...)

Sigh.

@huonw
Copy link
Member

huonw commented Aug 20, 2013

I think this requires some little clean-ups to make the test-cases' error patterns match rustc's.

The error pattern is Unit-like ..., but the error message is unit-like ... (same for all the struct-no-fields tests)

error: error pattern ' Unit-like struct construction is written with no trailing `{ }`' not found!
command: x86_64-unknown-linux-gnu/stage2/bin/rustc /home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt-t/build/src/test/compile-fail/struct-no-fields-4.rs -o x86_64-unknown-linux-gnu/test/compile-fail/struct-no-fields-4.stage2-x86_64-unknown-linux-gnu -L x86_64-unknown-linux-gnu/test/compile-fail -L x86_64-unknown-linux-gnu/test/compile-fail/struct-no-fields-4.stage2-x86_64-unknown-linux-gnu.libaux --target=x86_64-unknown-linux-gnu
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt-t/build/src/test/compile-fail/struct-no-fields-4.rs:15:32: 15:33 error: unit-like struct construction is written with no trailing `{ }`
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt-t/build/src/test/compile-fail/struct-no-fields-4.rs:15     let _end_of_tuple = (3, Foo { });

A missing comma:

error: unexpected compiler error or warning: '/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt-t/build/src/test/compile-fail/issue-3036.rs:16:0: 16:1 error: expected `;`, found `}`'
command: x86_64-unknown-linux-gnu/stage2/bin/rustc /home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt-t/build/src/test/compile-fail/issue-3036.rs -o x86_64-unknown-linux-gnu/test/compile-fail/issue-3036.stage2-x86_64-unknown-linux-gnu -L x86_64-unknown-linux-gnu/test/compile-fail -L x86_64-unknown-linux-gnu/test/compile-fail/issue-3036.stage2-x86_64-unknown-linux-gnu.libaux --target=x86_64-unknown-linux-gnu
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt-t/build/src/test/compile-fail/issue-3036.rs:16:0: 16:1 error: expected `;`, found `}`
/home/rustbuild/src/rust-buildbot/slave/auto-linux-64-nopt-t/build/src/test/compile-fail/issue-3036.rs:16 } //~ ERROR: expected `;` but found `}`
                                                                                                          ^

@pnkfelix
Copy link
Member Author

@huonw Ah, I misinterpreted the bors output (and thought that I had done a make check on my original commit...). Thanks for double-checking that for me.

@pnkfelix
Copy link
Member Author

(closing until I can fix properly.)

@pnkfelix
Copy link
Member Author

(part of #3192.)

flip1995 pushed a commit to flip1995/rust that referenced this pull request Mar 14, 2022
Add `unnecessary_find_map` lint

This PR adds an `unnecessary_find_map` lint. It is essentially just a minor enhancement of `unnecessary_filter_map`.

Closes rust-lang#8467

changelog: New lint `unnecessary_find_map`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants