Files
rust/tests/ui/traits/partialeq-ref-mismatch-diagnostic.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
274 B
Rust
Raw Normal View History

2025-07-01 02:46:47 +05:00
//! Check diagnostic messages for `PartialEq` trait bound mismatches between `&T` and `T`.
fn foo<T: PartialEq>(a: &T, b: T) {
a == b; //~ ERROR E0277
}
2025-07-01 02:46:47 +05:00
fn foo2<T: PartialEq>(a: &T, b: T) {
2022-06-05 17:37:45 -07:00
a == b; //~ ERROR E0277
}
fn main() {
foo(&1, 1);
2022-06-05 17:37:45 -07:00
foo2(&1, 1);
}