You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interestingly, impl<Idx> Clone for Range<Idx> where Idx: Clone + Clone + Clone has Clone three times. My theory is that there's an extra bound for each use of the type parameter inside the struct, since Wrapping<T> has one T field and Range<Idx> has two Idx fields.
#![feature(no_std)]#![no_std]#[prelude_import]use std::prelude::v1::*;#[macro_use]externcrate std as std;structFoo<T>(pubT);#[automatically_derived]impl<T:::std::clone::Clone>::std::clone::CloneforFoo<T>whereT:::std::clone::Clone{#[inline]fnclone(&self) -> Foo<T>{match*self{Foo(ref __self_0_0) =>
Foo(::std::clone::Clone::clone(&(*__self_0_0))),}}}fnmain(){}
Note the extra bound on T. The only weird thing rustdoc is doing is writing that as a where clause, which I'd expect because that's all it can do for bounds on an inlined doc item such as std::num::Wrapping (for now).
Activity
solson commentedon May 6, 2015
Interestingly,
impl<Idx> Clone for Range<Idx> where Idx: Clone + Clone + Clone
hasClone
three times. My theory is that there's an extra bound for each use of the type parameter inside the struct, sinceWrapping<T>
has oneT
field andRange<Idx>
has twoIdx
fields.tomjakubowski commentedon Jun 5, 2015
I think this is a bug in
#[derive(Clone)]
, actually.The results of
--pretty=expanded
:Note the extra bound on
T
. The only weird thing rustdoc is doing is writing that as a where clause, which I'd expect because that's all it can do for bounds on an inlined doc item such asstd::num::Wrapping
(for now).