os-rust/tests/ui/pattern/rfc-3627-match-ergonomics-2024/min_match_ergonomics_success.rs

19 lines
427 B
Rust

//@ revisions: normal min_match_ergonomics
//@ check-pass
#![cfg_attr(min_match_ergonomics, feature(min_match_ergonomics_2024))]
#![allow(incomplete_features)]
fn main() {}
// Tests type equality in a way that avoids coercing `&&T` to `&T`.
trait Eq<T> {}
impl<T> Eq<T> for T {}
fn assert_type_eq<T, U: Eq<T>>(_: T, _: U) {}
#[derive(Copy, Clone)]
struct T;
fn test() {
let (x,) = &(&T,);
assert_type_eq(x, &&T);
}