diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 87c164f7550f9..5c1f6cc12f59e 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -903,10 +903,10 @@ impl<'a> State<'a> { try!(self.print_generics(params)); try!(self.end()); // end the inner ibox + try!(self.print_where_clause(¶ms.where_clause)); try!(space(&mut self.s)); try!(self.word_space("=")); try!(self.print_type(&**ty)); - try!(self.print_where_clause(¶ms.where_clause)); try!(word(&mut self.s, ";")); try!(self.end()); // end the outer ibox } diff --git a/src/test/pretty/issue-25031.rs b/src/test/pretty/issue-25031.rs new file mode 100644 index 0000000000000..6c5a847869e4c --- /dev/null +++ b/src/test/pretty/issue-25031.rs @@ -0,0 +1,17 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +// +// Testing that type items with where clauses output correctly. + +// pp-exact + +fn main() { + type Foo where T: Copy = Box; +}