mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 11:07:42 +00:00
auto merge of #15605 : blake2-ppc/rust/rustdoc-const-t, r=alexcrichton
Update the formatting of raw immutable pointers to print *const T.
This commit is contained in:
commit
6323e8653c
@ -38,6 +38,8 @@ pub struct FnStyleSpace(pub ast::FnStyle);
|
|||||||
pub struct Method<'a>(pub &'a clean::SelfTy, pub &'a clean::FnDecl);
|
pub struct Method<'a>(pub &'a clean::SelfTy, pub &'a clean::FnDecl);
|
||||||
/// Similar to VisSpace, but used for mutability
|
/// Similar to VisSpace, but used for mutability
|
||||||
pub struct MutableSpace(pub clean::Mutability);
|
pub struct MutableSpace(pub clean::Mutability);
|
||||||
|
/// Similar to VisSpace, but used for mutability
|
||||||
|
pub struct RawMutableSpace(pub clean::Mutability);
|
||||||
/// Wrapper struct for properly emitting the stability level.
|
/// Wrapper struct for properly emitting the stability level.
|
||||||
pub struct Stability<'a>(pub &'a Option<clean::Stability>);
|
pub struct Stability<'a>(pub &'a Option<clean::Stability>);
|
||||||
/// Wrapper struct for emitting the stability level concisely.
|
/// Wrapper struct for emitting the stability level concisely.
|
||||||
@ -442,7 +444,7 @@ impl fmt::Show for clean::Type {
|
|||||||
clean::Unique(ref t) => write!(f, "Box<{}>", **t),
|
clean::Unique(ref t) => write!(f, "Box<{}>", **t),
|
||||||
clean::Managed(ref t) => write!(f, "Gc<{}>", **t),
|
clean::Managed(ref t) => write!(f, "Gc<{}>", **t),
|
||||||
clean::RawPointer(m, ref t) => {
|
clean::RawPointer(m, ref t) => {
|
||||||
write!(f, "*{}{}", MutableSpace(m), **t)
|
write!(f, "*{}{}", RawMutableSpace(m), **t)
|
||||||
}
|
}
|
||||||
clean::BorrowedRef{ lifetime: ref l, mutability, type_: ref ty} => {
|
clean::BorrowedRef{ lifetime: ref l, mutability, type_: ref ty} => {
|
||||||
let lt = match *l {
|
let lt = match *l {
|
||||||
@ -602,6 +604,15 @@ impl fmt::Show for MutableSpace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Show for RawMutableSpace {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
match *self {
|
||||||
|
RawMutableSpace(clean::Immutable) => write!(f, "const "),
|
||||||
|
RawMutableSpace(clean::Mutable) => write!(f, "mut "),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> fmt::Show for Stability<'a> {
|
impl<'a> fmt::Show for Stability<'a> {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
let Stability(stab) = *self;
|
let Stability(stab) = *self;
|
||||||
|
Loading…
Reference in New Issue
Block a user