]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/bounds-are-checked-2.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / type-alias-impl-trait / bounds-are-checked-2.rs
CommitLineData
29967ef6
XL
1// Make sure that we check that impl trait types implement the traits that they
2// claim to.
3
6a06907d
XL
4// revisions: min_tait full_tait
5#![feature(min_type_alias_impl_trait)]
6#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
7//[full_tait]~^ WARN incomplete
29967ef6
XL
8
9type X<T> = impl Clone;
10//~^ ERROR the trait bound `T: Clone` is not satisfied
11
12fn f<T: Clone>(t: T) -> X<T> {
13 t
14}
15
16fn g<T>(o: Option<X<T>>) -> Option<X<T>> {
17 o.clone()
18}
19
20fn main() {
21 g(None::<X<&mut ()>>);
22}