Skip to content

report const_err on all expressions that can fail#33214

Merged
bors merged 7 commits into
rust-lang:masterfrom
oli-obk:const_err_var_exprs
Apr 27, 2016
Merged

report const_err on all expressions that can fail#33214
bors merged 7 commits into
rust-lang:masterfrom
oli-obk:const_err_var_exprs

Conversation

@oli-obk

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

Copy link
Copy Markdown
Contributor

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

eddyb commented Apr 26, 2016

Copy link
Copy Markdown
Contributor

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

@oli-obk

oli-obk commented Apr 26, 2016

Copy link
Copy Markdown
Contributor Author

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

eddyb commented Apr 26, 2016

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 26, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit d3c489c has been approved by eddyb

@bors

bors commented Apr 26, 2016

Copy link
Copy Markdown
Collaborator

⌛ Testing commit d3c489c with merge ef4379f...

@bors

bors commented Apr 26, 2016

Copy link
Copy Markdown
Collaborator

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

@eddyb

eddyb commented Apr 26, 2016

Copy link
Copy Markdown
Contributor

@oli-obk Forgot to update Cargo.toml?

@oli-obk

oli-obk commented Apr 27, 2016

Copy link
Copy Markdown
Contributor Author

yep. done.

@eddyb

eddyb commented Apr 27, 2016

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Apr 27, 2016

Copy link
Copy Markdown
Collaborator

📌 Commit 5cdcad9 has been approved by eddyb

@bors

bors commented Apr 27, 2016

Copy link
Copy Markdown
Collaborator

⌛ 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

bors commented Apr 27, 2016

Copy link
Copy Markdown
Collaborator

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

@oli-obk

oli-obk commented Apr 27, 2016

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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