]> git.proxmox.com Git - rustc.git/blob - src/test/ui/coherence/re-rebalance-coherence-default-generic-associated-type.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / coherence / re-rebalance-coherence-default-generic-associated-type.rs
1 // run-pass
2 // aux-build:re_rebalance_coherence_lib-rpass.rs
3
4 #![allow(dead_code)]
5 // check that a generic type with a default value from an associated type can be used without
6 // specifying the value, and without invoking coherence errors.
7
8 extern crate re_rebalance_coherence_lib_rpass as lib;
9 use lib::*;
10
11 struct MyString {}
12
13 impl LibToOwned for MyString {
14 type Owned = String;
15 }
16
17 impl PartialEq<MyString> for LibCow<MyString> {
18 fn eq(&self, _other: &MyString) -> bool {
19 // Test that the default type is used.
20 let _s: &String = &self.o;
21
22 false
23 }
24 }
25
26 fn main() {}