-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Type annotations needed in assertion #113283
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
probaby caused by #112628 slightly smaller: fn main() {
let array: [Box<i32>; 0] = [];
let _ = array == [];
}
@rustbot label -regression-untriaged +regression-from-stable-to-nightly +T-libs |
Almost no PRs in the #113105 rollup where it landed have artifacts, but it seems likely indeed. Especially when the PR itself has a comment about a similar regression #112628 (comment) |
For visibility, cc PR author @gootorov, and reviewer @joshtriplett. |
I think our best case for now is to revert the commit and figure out what the fix is as time allows. I submitted a PR that adds a regression test and reverts: #113318 The
|
…st-lang#113283) Verify that `PartialEq` implementations do not break type inference when comparing types across different allocators. This catches a regression in current nightly introduced in 001b081 (alloc: Allow comparing `Box`s over different allocators") `Box` is the only type that currently impelements this, but tests are included for `Rc` and `Arc` to prevent future regresssions.
The |
If you just replace fn main() {
let array: [Vec<i32>; 0] = [];
let _ = array == [];
}
The reason why
|
…, r=m-ou-se Revert "alloc: Allow comparing Boxs over different allocators", add regression test Temporary fix for rust-lang#113283 Adds a test to fix the regression introduced in 001b081 and revert that commit. The test fails without the revert.
Closing since the revert has been merged. |
Code
I tried this code:
I expected to see this happen: Compiles and assertion passes.
Instead, this happened: Compiler wants type annotation somewhere in assertion. Span is on whole assertion.
Version it worked on
It most recently worked on: 1.70 stable
Version with regression
Recent nightlies (also occurs on Rust playground)
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: