Struct rustc_ap_rustc_ast_pretty::pprust::state::State[][src]

pub struct State<'a> {
    pub s: Printer,
    // some fields omitted
}

Fields

s: Printer

Implementations

Methods from Deref<Target = Printer>

Be very careful with this!

“raw box”

Inconsistent breaking box

Consistent breaking box

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

This doesn’t deserve to be called “pretty” printing, but it should be meaning-preserving. A quick hack that might help would be to look at the spans embedded in the TTs to decide where to put spaces and newlines. But it’d be better to parse these according to the grammar of the appropriate macro, transcribe back into the grammar we just parsed from, and then pretty-print the resulting AST nodes (so, e.g., we print expression arguments as expressions). It can be done! I think. Read more

Print the token kind precisely, without converting $crate into its respective crate name.

Print the token precisely, without converting $crate into its respective crate name.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.