Refactor error reporting of constants#51636
Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
src/librustc/mir/interpret/error.rs
Outdated
There was a problem hiding this comment.
I'd rather call this TooGeneric or something more obvious.
src/librustc/middle/const_val.rs
Outdated
There was a problem hiding this comment.
Can this struct be moved to mir::interpret? Also, maybe put the Lrc around the struct, that way you can name the fields that are currently in a tuple.
src/librustc/traits/fulfill.rs
Outdated
8bf8763 to
c93a80c
Compare
|
Addressed all review comments |
There was a problem hiding this comment.
This seems weird, since the constant is not in an Operand::Const, but rather in a type.
There was a problem hiding this comment.
This note means to say that LEN has errors, which is a constant reference right where the span points.
There was a problem hiding this comment.
This is an "error: this expression will panic at runtime" inside non-runtime code though?
There was a problem hiding this comment.
Oh... Looks like const prop is running on array lengths?! I wonder how that happened.
ec32bcb to
8b957ca
Compare
src/librustc/mir/interpret/value.rs
Outdated
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
4064f09 to
c190b3a
Compare
|
r? @eddyb (since I'm still on leave) |
|
☔ The latest upstream changes (presumably #51538) made this pull request unmergeable. Please resolve the merge conflicts. |
a155b37 to
4d47330
Compare
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
|
@bors r+ |
|
📌 Commit 2a55d2f has been approved by |
Refactor error reporting of constants cc @eddyb This PR should not change any behaviour. It solely simplifies the internal handling of the errors
Rollup of 6 pull requests Successful merges: - #51636 (Refactor error reporting of constants) - #51765 (Use assert_eq! in copy_from_slice) - #51822 (Provide existing ref suggestions for more E0308 errors) - #51839 (Detect overflows of non u32 shifts) - #51868 (Remove process::id from 'Stabilized APIs' in 1.27.0 release notes) - #51875 (Explicitely disable WASM code generation for Emscripten) Failed merges: r? @ghost
cc @eddyb
This PR should not change any behaviour. It solely simplifies the internal handling of the errors