-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE: invalid asymmetric binary op Lt
#134352
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
struct Struct<const N: i64>(pub [u8; N]); // compiles and ice fixed with `<const N: usize>`
fn function(value: Struct<3>) -> u8 {
value.0[0]
}
pub fn main() {} |
Hmm, annoying that we're running mir passes on something that didn't pass type checking. What's MIR building supposed to be doing in a case like this where the array type is malformed? |
Check for array lengths that aren't actually `usize` I wish typeck wouldn't give us `ty::Array`s that have this problem in the first place, but we can check for it. Fixes rust-lang#134352 cc `@matthiaskrgr`
Rollup merge of rust-lang#134371 - scottmcm:fix-134352, r=oli-obk Check for array lengths that aren't actually `usize` I wish typeck wouldn't give us `ty::Array`s that have this problem in the first place, but we can check for it. Fixes rust-lang#134352 cc ``@matthiaskrgr``
Reopening because #134371 was reverted, cc @compiler-errors |
#133734 which caused the regression was also reverted, right? we just need to re-add (un-revert the addition of) the test and we are good to go? 🤔 |
@matthiaskrgr It's coming back in https://github.com/rust-lang/rust/pull/135748/commits though, so want to make sure this doesn't get lost by accident. |
Properly check that array length is valid type during built-in unsizing in index This results in duplicated errors, but this class of errors is not new; in general, we aren't really equipped to detect cases where a WF error due to a field type would be shadowed by the parent struct of that field also not being WF. This also adds a note for these types of mismatches to make it clear that this is due to an array type. Fixes rust-lang#134352 r? boxyuwu
Properly check that array length is valid type during built-in unsizing in index This results in duplicated errors, but this class of errors is not new; in general, we aren't really equipped to detect cases where a WF error due to a field type would be shadowed by the parent struct of that field also not being WF. This also adds a note for these types of mismatches to make it clear that this is due to an array type. Fixes rust-lang#134352 r? boxyuwu
Rollup merge of rust-lang#136205 - compiler-errors:len-3, r=BoxyUwU Properly check that array length is valid type during built-in unsizing in index This results in duplicated errors, but this class of errors is not new; in general, we aren't really equipped to detect cases where a WF error due to a field type would be shadowed by the parent struct of that field also not being WF. This also adds a note for these types of mismatches to make it clear that this is due to an array type. Fixes rust-lang#134352 r? boxyuwu
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: