diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index 73d109f3c8d41..f87c450eda5ed 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -252,11 +252,14 @@ pub fn strong_count(this: &Arc) -> usize { this.inner().strong.load(SeqCst /// /// ``` /// # #![feature(alloc)] -/// use std::alloc::arc; +/// extern crate alloc; +/// # fn main() { +/// use alloc::arc; /// /// let mut four = arc::Arc::new(4); /// /// arc::unique(&mut four).map(|num| *num = 5); +/// # } /// ``` #[inline] #[unstable(feature = "alloc")] diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index e4d9fac5b9cb5..e0ed83f401945 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -2392,7 +2392,7 @@ fn resolve_type(cx: &DocContext, }; match def { - def::DefSelfTy(..) => { + def::DefSelfTy(..) if path.segments.len() == 1 => { return Generic(token::get_name(special_idents::type_self.name).to_string()); } def::DefPrimTy(p) => match p { @@ -2412,7 +2412,9 @@ fn resolve_type(cx: &DocContext, ast::TyFloat(ast::TyF32) => return Primitive(F32), ast::TyFloat(ast::TyF64) => return Primitive(F64), }, - def::DefTyParam(_, _, _, n) => return Generic(token::get_name(n).to_string()), + def::DefTyParam(_, _, _, n) => { + return Generic(token::get_name(n).to_string()) + } _ => {} }; let did = register_def(&*cx, def);