// Regression test for . // We were previously suppressing the copy error in the `Clone` impl because we assumed // that the only way we get `Copy` ambiguity errors was due to incoherent impls. This is // not true, since ambiguities can be encountered due to overflows (among other ways). struct S(Option<&'static T>); impl Copy for S where S: Copy + Clone {} impl Clone for S { fn clone(&self) -> Self { *self //~^ ERROR cannot move out of `*self` which is behind a shared reference } } fn main() {}