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

Report CONST_ERR lint in external macros #65320

Merged
merged 2 commits into from
Oct 13, 2019
Merged

Conversation

memoryruins
Copy link
Contributor

fixes #65300
fixes #61058

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 11, 2019
use external_macro::static_assert;

fn main() {
static_assert!(2 + 2 == 5); //~ ERROR
Copy link
Member

Choose a reason for hiding this comment

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

This works outside "expression" scope too, right? Can we test it there? I seem to recall some differences, but maybe that was a transient state...

Copy link
Contributor Author

@memoryruins memoryruins Oct 12, 2019

Choose a reason for hiding this comment

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

Something like the following? which now works too with the param set.

static_assert!(false); //~ ERROR
fn main() { /* ... */ }

@oli-obk
Copy link
Contributor

oli-obk commented Oct 13, 2019

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 13, 2019

📌 Commit 95a65cd has been approved by oli-obk

@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-review Status: Awaiting review from the assignee but also interested parties. labels Oct 13, 2019
Centril added a commit to Centril/rust that referenced this pull request Oct 13, 2019
bors added a commit that referenced this pull request Oct 13, 2019
Rollup of 13 pull requests

Successful merges:

 - #65039 (Document missing deny by default lints)
 - #65069 (Implement Clone::clone_from for VecDeque)
 - #65165 (Improve docs on some char boolean methods)
 - #65248 (Suggest `if let` on `let` refutable binding)
 - #65250 (resolve: fix error title regarding private constructors)
 - #65295 (Move diagnostics code out of the critical path)
 - #65320 (Report `CONST_ERR` lint in external macros)
 - #65327 (replace the hand-written binary search with the library one)
 - #65339 (do not reference LLVM for our concurrency memory model)
 - #65357 (syntax: simplify maybe_annotate_with_ascription)
 - #65358 (simplify maybe_stage_features)
 - #65359 (simplify integer_lit)
 - #65360 (mbe: reduce panictry! uses.)

Failed merges:

r? @ghost
@bors bors merged commit 95a65cd into rust-lang:master Oct 13, 2019
@memoryruins memoryruins deleted the const_err branch October 16, 2019 13:54
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.
Projects
None yet
5 participants