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

Don't trigger assertions_on_constants on debug_assert!(false) #3989

Merged
merged 6 commits into from Apr 19, 2019

Conversation

Projects
None yet
4 participants
@flip1995
Copy link
Collaborator

commented Apr 18, 2019

Fixes #3948
Fixes #3765

changelog: Fix debug_assert! false positive on assertions_on_constants lint

flip1995 added some commits Apr 18, 2019

@flip1995 flip1995 changed the title Assert on const Don't trigger assertions_on_constants on debug_assert!(false) Apr 18, 2019

@phansch

This comment has been minimized.

Copy link
Collaborator

commented Apr 19, 2019

@bors r+

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

📌 Commit 10cd289 has been approved by phansch

@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

⌛️ Testing commit 10cd289 with merge 12e8075...

bors added a commit that referenced this pull request Apr 19, 2019

Auto merge of #3989 - flip1995:assert_on_const, r=phansch
Don't trigger assertions_on_constants on debug_assert!(false)

Fixes #3948
Fixes #3765

changelog: Fix `debug_assert!` false positive on `assertions_on_constants` lint
@bors

This comment has been minimized.

Copy link
Contributor

commented Apr 19, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: phansch
Pushing 12e8075 to master...

@bors bors merged commit 10cd289 into rust-lang:master Apr 19, 2019

3 checks passed

Travis CI - Pull Request Build Passed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details

@flip1995 flip1995 deleted the flip1995:assert_on_const branch Apr 19, 2019

@mikerite

This comment has been minimized.

Copy link
Contributor

commented on clippy_lints/src/assertions_on_constants.rs in 10cd289 Apr 21, 2019

It looks wrong to have a this side effect in here. Basically this closure should only be called after calling is_direct_expn_of(assert_span, "debug_assert").

This comment has been minimized.

Copy link
Collaborator Author

replied Apr 21, 2019

Yeah I agree, that this is kind of weird. But I couldn't come up with a better solution. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.