1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Test that we handle binder levels correctly when checking whether a
12 // type can implement `Copy`. In particular, we had a bug where we failed to
13 // liberate the late-bound regions from the impl, and thus wound up
14 // searching for an impl of `for<'tcx> Foo<&'tcx T>`. The impl that
15 // exists however is `impl<T> Copy for Foo<T>` and the current rules
16 // did not consider that a match (something I would like to revise in
19 // pretty-expanded FIXME #23616
23 use std::marker::PhantomData;
25 #[derive(Copy, Clone)]
26 struct Foo<T> { x: T }
28 type Ty<'tcx> = &'tcx TyS<'tcx>;
31 Boop(PhantomData<*mut &'tcx ()>)
34 #[derive(Copy, Clone)]