Add a test for PartialEq
across Allocator
s breaking inference (#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 001b081cc1
(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.
This commit is contained in:
parent
0130c3a06e
commit
3c9a7491c2
18
tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs
Normal file
18
tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs
Normal file
@ -0,0 +1,18 @@
|
||||
// run-pass
|
||||
// Verify that PartialEq implementations do not break type inference when
|
||||
// accepting types with different allocators
|
||||
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
fn main() {
|
||||
let boxed: Vec<Box<i32>> = vec![];
|
||||
assert_eq!(boxed, vec![]);
|
||||
|
||||
let rc: Vec<Rc<i32>> = vec![];
|
||||
assert_eq!(rc, vec![]);
|
||||
|
||||
let arc: Vec<Arc<i32>> = vec![];
|
||||
assert_eq!(arc, vec![]);
|
||||
}
|
Loading…
Reference in New Issue
Block a user