X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_ast_pretty%2Fsrc%2Fpprust%2Fstate.rs;h=789d2c296e291c3d905ce9ed3bf9bd5fa1d60caf;hb=32be124e306e537590cedcb56e6c16db7f9d8ce7;hp=cb6f567c55140b7bdf0096838996d6c3a88f363c;hpb=0464f638af99a7c0876e9b8f96db5bbf917e3fe2;p=rust.git diff --git a/compiler/rustc_ast_pretty/src/pprust/state.rs b/compiler/rustc_ast_pretty/src/pprust/state.rs index cb6f567c551..789d2c296e2 100644 --- a/compiler/rustc_ast_pretty/src/pprust/state.rs +++ b/compiler/rustc_ast_pretty/src/pprust/state.rs @@ -2149,10 +2149,10 @@ enum AsmArg<'a> { None => s.word("_"), } } - InlineAsmOperand::Const { expr } => { + InlineAsmOperand::Const { anon_const } => { s.word("const"); s.space(); - s.print_expr(expr); + s.print_expr(&anon_const.value); } InlineAsmOperand::Sym { expr } => { s.word("sym"); @@ -2292,10 +2292,6 @@ enum AsmArg<'a> { } } - pub fn print_usize(&mut self, i: usize) { - self.s.word(i.to_string()) - } - crate fn print_name(&mut self, name: Symbol) { self.s.word(name.to_string()); self.ann.post(self, AnnNode::Name(&name)) @@ -2659,8 +2655,10 @@ pub fn print_type_bounds(&mut self, prefix: &'static str, bounds: &[ast::Generic s.word_space(":"); s.print_type(ty); s.print_type_bounds(":", ¶m.bounds); - if let Some(ref _default) = default { - // FIXME(const_generics_defaults): print the `default` value here + if let Some(ref default) = default { + s.s.space(); + s.word_space("="); + s.print_expr(&default.value); } } }