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

Update assertion on constant test #4402

Closed

Conversation

tesuji
Copy link
Contributor

@tesuji tesuji commented Aug 17, 2019

changelog: none

@phansch
Copy link
Member

phansch commented Aug 17, 2019

Hm, I'm not sure if this should stop being linted. The test for debug_assert!(true) was added in #3740. I think this is now not linted due to rust-lang/rust#63613 and we have to update the logic for detecting the debug_assert macro. But I'm not really sure where exactly.

I don't have time to check myself, but maybe one of these functions now returns a different boolean than before?

if let Some(assert_span) = is_direct_expn_of(e.span, "assert");
if !in_macro_or_desugar(assert_span)
|| is_direct_expn_of(assert_span, "debug_assert")
.map_or(false, debug_assert_not_in_macro_or_desugar);

cc @flip1995

@tesuji
Copy link
Contributor Author

tesuji commented Aug 17, 2019

Closed in favor of #4406

@tesuji tesuji closed this Aug 17, 2019
@tesuji tesuji deleted the update-assert-on-constant-test branch August 17, 2019 19:37
bors added a commit that referenced this pull request Aug 18, 2019
Fix assertions on const lint

Replaces #4402
changelog: none
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.

2 participants