Skip to content

report const_err on all expressions that can fail #33214

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

Merged
merged 7 commits into from
Apr 27, 2016

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 26, 2016

also a drive-by fix for reporting an "overflow in shift left" when shifting an i64 right

This increases the warning noise for shifting by more than the bitwidth and for -T::MIN. I can silence the bitwidth warnings explicitly and fix the const evaluator to make sure --$expr is treated exactly like $expr (which is kinda wrong, but mathematically right).

r? @eddyb

@eddyb
Copy link
Member

eddyb commented Apr 26, 2016

Disqualifying expressions leads to ICEs like the one Travis found in run-pass/associated-const-type-parameters.rs.

@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 26, 2016

yea... that's because associated constants aren't implemented in const eval, only in trans/consts. I decided to err on the safe side and ignored all errors due to non-const-path. This kind of distinction will become irrelevant with miri anyway. So for now we report fewer errors than we could.

this might introduce subtle bugs to code generation
@oli-obk oli-obk force-pushed the const_err_var_exprs branch from 98991ab to d3c489c Compare April 26, 2016 13:32
@eddyb
Copy link
Member

eddyb commented Apr 26, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 26, 2016

📌 Commit d3c489c has been approved by eddyb

@bors
Copy link
Collaborator

bors commented Apr 26, 2016

⌛ Testing commit d3c489c with merge ef4379f...

@bors
Copy link
Collaborator

bors commented Apr 26, 2016

💔 Test failed - auto-linux-64-opt-rustbuild

@eddyb
Copy link
Member

eddyb commented Apr 26, 2016

@oli-obk Forgot to update Cargo.toml?

@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 27, 2016

yep. done.

@eddyb
Copy link
Member

eddyb commented Apr 27, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Apr 27, 2016

📌 Commit 5cdcad9 has been approved by eddyb

@bors
Copy link
Collaborator

bors commented Apr 27, 2016

⌛ Testing commit 5cdcad9 with merge b52d76a...

bors added a commit that referenced this pull request Apr 27, 2016
report `const_err` on all expressions that can fail

also a drive-by fix for reporting an "overflow in shift *left*" when shifting an `i64` *right*

This increases the warning noise for shifting by more than the bitwidth and for `-T::MIN`. I can silence the bitwidth warnings explicitly and fix the const evaluator to make sure `--$expr` is treated exactly like `$expr` (which is kinda wrong, but mathematically right).

r? @eddyb
@bors
Copy link
Collaborator

bors commented Apr 27, 2016

💔 Test failed - auto-win-gnu-32-opt

@oli-obk
Copy link
Contributor Author

oli-obk commented Apr 27, 2016

failed to decode compiler output as json: ParseError(SyntaxError(InvalidSyntax, 1, 116))

Huh? The error occurred on compile-fail\dep-graph-trait-impl-two-traits.rs

@alexcrichton
Copy link
Member

@bors: retry

@oli-obk oli-obk deleted the const_err_var_exprs branch June 22, 2016 17:24
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