Merge remote-tracking branch 'origin/master' into gen
This commit is contained in:
commit
c25ddf21f1
280 changed files with 17756 additions and 2240 deletions
|
|
@ -1547,6 +1547,8 @@ pub enum PrimitiveType {
|
|||
Array,
|
||||
Tuple,
|
||||
RawPointer,
|
||||
Reference,
|
||||
Fn,
|
||||
}
|
||||
|
||||
#[derive(Clone, RustcEncodable, RustcDecodable, Copy, Debug)]
|
||||
|
|
@ -1581,6 +1583,8 @@ impl Type {
|
|||
Array(..) | BorrowedRef { type_: box Array(..), .. } => Some(PrimitiveType::Array),
|
||||
Tuple(..) => Some(PrimitiveType::Tuple),
|
||||
RawPointer(..) => Some(PrimitiveType::RawPointer),
|
||||
BorrowedRef { type_: box Generic(..), .. } => Some(PrimitiveType::Reference),
|
||||
BareFunction(..) => Some(PrimitiveType::Fn),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
@ -1633,6 +1637,8 @@ impl PrimitiveType {
|
|||
"slice" => Some(PrimitiveType::Slice),
|
||||
"tuple" => Some(PrimitiveType::Tuple),
|
||||
"pointer" => Some(PrimitiveType::RawPointer),
|
||||
"reference" => Some(PrimitiveType::Reference),
|
||||
"fn" => Some(PrimitiveType::Fn),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
@ -1661,6 +1667,8 @@ impl PrimitiveType {
|
|||
Slice => "slice",
|
||||
Tuple => "tuple",
|
||||
RawPointer => "pointer",
|
||||
Reference => "reference",
|
||||
Fn => "fn",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2556,6 +2564,8 @@ fn build_deref_target_impls(cx: &DocContext,
|
|||
Array => tcx.lang_items.slice_impl(),
|
||||
Tuple => None,
|
||||
RawPointer => tcx.lang_items.const_ptr_impl(),
|
||||
Reference => None,
|
||||
Fn => None,
|
||||
};
|
||||
if let Some(did) = did {
|
||||
if !did.is_local() {
|
||||
|
|
@ -2777,6 +2787,9 @@ fn resolve_type(cx: &DocContext,
|
|||
Def::SelfTy(..) if path.segments.len() == 1 => {
|
||||
return Generic(keywords::SelfType.name().to_string());
|
||||
}
|
||||
Def::TyParam(..) if path.segments.len() == 1 => {
|
||||
return Generic(format!("{:#}", path));
|
||||
}
|
||||
Def::SelfTy(..) | Def::TyParam(..) | Def::AssociatedTy(..) => true,
|
||||
_ => false,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -607,11 +607,9 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool) -> fmt:
|
|||
decl.generics,
|
||||
decl.decl)
|
||||
} else {
|
||||
write!(f, "{}{}fn{}{}",
|
||||
UnsafetySpace(decl.unsafety),
|
||||
AbiSpace(decl.abi),
|
||||
decl.generics,
|
||||
decl.decl)
|
||||
write!(f, "{}{}", UnsafetySpace(decl.unsafety), AbiSpace(decl.abi))?;
|
||||
primitive_link(f, PrimitiveType::Fn, "fn")?;
|
||||
write!(f, "{}{}", decl.generics, decl.decl)
|
||||
}
|
||||
}
|
||||
clean::Tuple(ref typs) => {
|
||||
|
|
@ -665,26 +663,29 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool) -> fmt:
|
|||
_ => "".to_string(),
|
||||
};
|
||||
let m = MutableSpace(mutability);
|
||||
let amp = if f.alternate() {
|
||||
"&".to_string()
|
||||
} else {
|
||||
"&".to_string()
|
||||
};
|
||||
match **ty {
|
||||
clean::Slice(ref bt) => { // BorrowedRef{ ... Slice(T) } is &[T]
|
||||
match **bt {
|
||||
clean::Generic(_) => {
|
||||
if f.alternate() {
|
||||
primitive_link(f, PrimitiveType::Slice,
|
||||
&format!("&{}{}[{:#}]", lt, m, **bt))
|
||||
&format!("{}{}{}[{:#}]", amp, lt, m, **bt))
|
||||
} else {
|
||||
primitive_link(f, PrimitiveType::Slice,
|
||||
&format!("&{}{}[{}]", lt, m, **bt))
|
||||
&format!("{}{}{}[{}]", amp, lt, m, **bt))
|
||||
}
|
||||
}
|
||||
_ => {
|
||||
primitive_link(f, PrimitiveType::Slice,
|
||||
&format!("{}{}{}[", amp, lt, m))?;
|
||||
if f.alternate() {
|
||||
primitive_link(f, PrimitiveType::Slice,
|
||||
&format!("&{}{}[", lt, m))?;
|
||||
write!(f, "{:#}", **bt)?;
|
||||
} else {
|
||||
primitive_link(f, PrimitiveType::Slice,
|
||||
&format!("&{}{}[", lt, m))?;
|
||||
write!(f, "{}", **bt)?;
|
||||
}
|
||||
primitive_link(f, PrimitiveType::Slice, "]")
|
||||
|
|
@ -692,23 +693,18 @@ fn fmt_type(t: &clean::Type, f: &mut fmt::Formatter, use_absolute: bool) -> fmt:
|
|||
}
|
||||
}
|
||||
clean::ResolvedPath { typarams: Some(ref v), .. } if !v.is_empty() => {
|
||||
if f.alternate() {
|
||||
write!(f, "&{}{}", lt, m)?;
|
||||
} else {
|
||||
write!(f, "&{}{}", lt, m)?;
|
||||
}
|
||||
write!(f, "(")?;
|
||||
write!(f, "{}{}{}(", amp, lt, m)?;
|
||||
fmt_type(&ty, f, use_absolute)?;
|
||||
write!(f, ")")
|
||||
}
|
||||
clean::Generic(..) => {
|
||||
primitive_link(f, PrimitiveType::Reference,
|
||||
&format!("{}{}{}", amp, lt, m))?;
|
||||
fmt_type(&ty, f, use_absolute)
|
||||
}
|
||||
_ => {
|
||||
if f.alternate() {
|
||||
write!(f, "&{}{}", lt, m)?;
|
||||
fmt_type(&ty, f, use_absolute)
|
||||
} else {
|
||||
write!(f, "&{}{}", lt, m)?;
|
||||
fmt_type(&ty, f, use_absolute)
|
||||
}
|
||||
write!(f, "{}{}{}", amp, lt, m)?;
|
||||
fmt_type(&ty, f, use_absolute)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2235,6 +2235,13 @@ fn item_trait(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
|
|||
_ => false,
|
||||
};
|
||||
fmt_impl_for_trait_page(&implementor.impl_, w, use_absolute)?;
|
||||
for it in &implementor.impl_.items {
|
||||
if let clean::TypedefItem(ref tydef, _) = it.inner {
|
||||
write!(w, "<span class=\"where fmt-newline\"> ")?;
|
||||
assoc_type(w, it, &vec![], Some(&tydef.type_), AssocItemLink::Anchor(None))?;
|
||||
write!(w, ";</span>")?;
|
||||
}
|
||||
}
|
||||
writeln!(w, "</code></li>")?;
|
||||
}
|
||||
}
|
||||
|
|
@ -2962,7 +2969,15 @@ fn render_impl(w: &mut fmt::Formatter, cx: &Context, i: &Impl, link: AssocItemLi
|
|||
write!(w, "<code>")?;
|
||||
render_assoc_item(w, item, link.anchor(&id), ItemType::Impl)?;
|
||||
write!(w, "</code>")?;
|
||||
render_stability_since_raw(w, item.stable_since(), outer_version)?;
|
||||
if let Some(l) = (Item { cx, item }).src_href() {
|
||||
write!(w, "</span><span class='out-of-band'>")?;
|
||||
write!(w, "<div class='ghost'></div>")?;
|
||||
render_stability_since_raw(w, item.stable_since(), outer_version)?;
|
||||
write!(w, "<a class='srclink' href='{}' title='{}'>[src]</a>",
|
||||
l, "goto source code")?;
|
||||
} else {
|
||||
render_stability_since_raw(w, item.stable_since(), outer_version)?;
|
||||
}
|
||||
write!(w, "</span></h4>\n")?;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -274,9 +274,13 @@ nav.sub {
|
|||
border-bottom: 1px solid;
|
||||
}
|
||||
|
||||
.docblock h1 { font-size: 1.3em; }
|
||||
.docblock h2 { font-size: 1.15em; }
|
||||
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
|
||||
#main > .docblock h1 { font-size: 1.3em; }
|
||||
#main > .docblock h2 { font-size: 1.15em; }
|
||||
#main > .docblock h3, #main > .docblock h4, #main > .docblock h5 { font-size: 1em; }
|
||||
|
||||
.docblock h1 { font-size: 1em; }
|
||||
.docblock h2 { font-size: 0.95em; }
|
||||
.docblock h3, .docblock h4, .docblock h5 { font-size: 0.9em; }
|
||||
|
||||
.docblock {
|
||||
margin-left: 24px;
|
||||
|
|
@ -297,6 +301,10 @@ h3.impl > .out-of-band {
|
|||
font-size: 21px;
|
||||
}
|
||||
|
||||
h4.method > .out-of-band {
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
h4 > code, h3 > code, .invisible > code {
|
||||
position: inherit;
|
||||
}
|
||||
|
|
@ -434,10 +442,6 @@ a {
|
|||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.content span.enum, .content a.enum, .block a.current.enum { color: #5e9766; }
|
||||
.content span.struct, .content a.struct, .block a.current.struct { color: #df3600; }
|
||||
.content span.type, .content a.type, .block a.current.type { color: #e57300; }
|
||||
.content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
|
||||
.block a.current.crate { font-weight: 500; }
|
||||
|
||||
.search-input {
|
||||
|
|
|
|||
|
|
@ -64,21 +64,6 @@ pre {
|
|||
background-color: #f6fdb0 !important;
|
||||
}
|
||||
|
||||
:target { background: #FDFFD3; }
|
||||
.content .highlighted {
|
||||
color: #000 !important;
|
||||
background-color: #ccc;
|
||||
}
|
||||
.content .highlighted a, .content .highlighted span { color: #000 !important; }
|
||||
.content .highlighted.trait { background-color: #fece7e; }
|
||||
.content .highlighted.mod { background-color: #afc6e4; }
|
||||
.content .highlighted.enum { background-color: #b4d1b9; }
|
||||
.content .highlighted.struct { background-color: #e7b1a0; }
|
||||
.content .highlighted.fn { background-color: #c6afb3; }
|
||||
.content .highlighted.method { background-color: #c6afb3; }
|
||||
.content .highlighted.tymethod { background-color: #c6afb3; }
|
||||
.content .highlighted.type { background-color: #c6afb3; }
|
||||
|
||||
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
|
||||
border-bottom-color: #DDD;
|
||||
}
|
||||
|
|
@ -97,13 +82,42 @@ pre {
|
|||
border-bottom-color: #ddd;
|
||||
}
|
||||
|
||||
.content span.primitive, .content a.primitive, .block a.current.primitive { color: #39a7bf; }
|
||||
:target { background: #FDFFD3; }
|
||||
.content .highlighted {
|
||||
color: #000 !important;
|
||||
background-color: #ccc;
|
||||
}
|
||||
.content .highlighted a, .content .highlighted span { color: #000 !important; }
|
||||
.content .highlighted.trait { background-color: #c7b6ff; }
|
||||
.content .highlighted.mod,
|
||||
.content .highlighted.externcrate { background-color: #afc6e4; }
|
||||
.content .highlighted.enum { background-color: #b4d1b9; }
|
||||
.content .highlighted.struct { background-color: #e7b1a0; }
|
||||
.content .highlighted.union { background-color: #b7bd49; }
|
||||
.content .highlighted.fn,
|
||||
.content .highlighted.method,
|
||||
.content .highlighted.tymethod { background-color: #c6afb3; }
|
||||
.content .highlighted.type { background-color: #ffc891; }
|
||||
.content .highlighted.macro { background-color: #8ce488; }
|
||||
.content .highlighted.constant,
|
||||
.content .highlighted.static { background-color: #c3e0ff; }
|
||||
.content .highlighted.primitive { background-color: #9aecff; }
|
||||
|
||||
.content span.enum, .content a.enum, .block a.current.enum { color: #508157; }
|
||||
.content span.struct, .content a.struct, .block a.current.struct { color: #df3600; }
|
||||
.content span.type, .content a.type, .block a.current.type { color: #ba5d00; }
|
||||
.content span.macro, .content a.macro, .block a.current.macro { color: #068000; }
|
||||
.content span.union, .content a.union, .block a.current.union { color: #767b27; }
|
||||
.content span.constant, .content a.constant, .block a.current.constant,
|
||||
.content span.static, .content a.static, .block a.current.static { color: #546e8a; }
|
||||
.content span.primitive, .content a.primitive, .block a.current.primitive { color: #2c8093; }
|
||||
.content span.externcrate,
|
||||
.content span.mod, .content a.mod, .block a.current.mod { color: #4d76ae; }
|
||||
.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }
|
||||
.content span.fn, .content a.fn, .block a.current.fn,
|
||||
.content span.method, .content a.method, .block a.current.method,
|
||||
.content span.tymethod, .content a.tymethod, .block a.current.tymethod,
|
||||
.content .fnname { color: #8c6067; }
|
||||
.content .fnname { color: #9a6e31; }
|
||||
|
||||
pre.rust .comment { color: #8E908C; }
|
||||
pre.rust .doccomment { color: #4D4D4C; }
|
||||
|
|
@ -130,8 +144,6 @@ a.test-arrow {
|
|||
color: #f5f5f5;
|
||||
}
|
||||
|
||||
.content span.trait, .content a.trait, .block a.current.trait { color: #7c5af3; }
|
||||
|
||||
.search-input {
|
||||
color: #555;
|
||||
box-shadow: 0 0 0 1px #e0e0e0, 0 0 0 2px transparent;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue