2018-08-02 15:42:02 -05:00
|
|
|
//prior to fixing `everybody_loops` to preserve items, rustdoc would crash on this file, as it
|
|
|
|
//didn't see that `SomeStruct` implemented `Clone`
|
|
|
|
|
|
|
|
pub struct Bounded<T: Clone>(T);
|
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has traits_in_bodies/struct.SomeStruct.html
|
|
|
|
//@ has - '//h3[@class="code-header"]' 'impl Clone for SomeStruct'
|
2018-08-02 15:42:02 -05:00
|
|
|
pub struct SomeStruct;
|
|
|
|
|
|
|
|
fn asdf() -> Bounded<SomeStruct> {
|
|
|
|
impl Clone for SomeStruct {
|
|
|
|
fn clone(&self) -> SomeStruct {
|
|
|
|
SomeStruct
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Bounded(SomeStruct)
|
|
|
|
}
|
2018-08-07 10:10:05 -05:00
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has traits_in_bodies/struct.Point.html
|
|
|
|
//@ has - '//h3[@class="code-header"]' 'impl Copy for Point'
|
2018-08-07 10:10:05 -05:00
|
|
|
#[derive(Clone)]
|
|
|
|
pub struct Point {
|
|
|
|
x: i32,
|
|
|
|
y: i32,
|
|
|
|
}
|
|
|
|
|
|
|
|
const _FOO: () = {
|
|
|
|
impl Copy for Point {}
|
|
|
|
()
|
|
|
|
};
|
2018-08-27 12:42:43 -05:00
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has traits_in_bodies/struct.Inception.html
|
|
|
|
//@ has - '//h3[@class="code-header"]' 'impl Clone for Inception'
|
2018-08-27 12:42:43 -05:00
|
|
|
pub struct Inception;
|
|
|
|
|
|
|
|
static _BAR: usize = {
|
|
|
|
trait HiddenTrait {
|
|
|
|
fn hidden_fn(&self) {
|
|
|
|
for _ in 0..5 {
|
|
|
|
impl Clone for Inception {
|
|
|
|
fn clone(&self) -> Self {
|
|
|
|
// we need to go deeper
|
|
|
|
Inception
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
5
|
|
|
|
};
|