]> git.proxmox.com Git - rustc.git/blob - src/test/ui/specialization/min_specialization/issue-79224.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / ui / specialization / min_specialization / issue-79224.rs
1 #![feature(min_specialization)]
2 use std::fmt::{self, Display};
3
4 pub enum Cow<'a, B: ?Sized + 'a, O = <B as ToOwned>::Owned>
5 where
6 B: ToOwned,
7 {
8 Borrowed(&'a B),
9 Owned(O),
10 }
11
12 impl ToString for Cow<'_, str> {
13 fn to_string(&self) -> String {
14 String::new()
15 }
16 }
17
18 impl<B: ?Sized> Display for Cow<'_, B> { //~ ERROR: the trait bound `B: Clone` is not satisfied [E0277]
19 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR: the trait bound `B: Clone` is not satisfied [E0277]
20 write!(f, "foo")
21 }
22 }
23
24 fn main() {}