Skip to content

Commit

Permalink
Rollup merge of rust-lang#60694 - Pulkit07:issue60662, r=alexreg
Browse files Browse the repository at this point in the history
Fix HIR printing of existential type rust-lang#60662

This fixes rust-lang#60662
  • Loading branch information
Centril authored May 12, 2019
2 parents 0df1e57 + 3b78a47 commit 8327517
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,6 @@ impl<'a> State<'a> {

self.print_where_clause(&exist.generics.where_clause)?;
self.s.space()?;
self.word_space(":")?;
let mut real_bounds = Vec::with_capacity(exist.bounds.len());
for b in exist.bounds.iter() {
if let GenericBound::Trait(ref ptr, hir::TraitBoundModifier::Maybe) = *b {
Expand Down
11 changes: 11 additions & 0 deletions src/test/ui/issues/issue-60662.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// compile-pass
// compile-flags: -Z unpretty=hir

#![feature(existential_type)]

trait Animal {
}

fn main() {
pub existential type ServeFut: Animal;
}
14 changes: 14 additions & 0 deletions src/test/ui/issues/issue-60662.stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// compile-pass
// compile-flags: -Z unpretty=hir

#![feature(existential_type)]
#[prelude_import]
use ::std::prelude::v1::*;
#[macro_use]
extern crate std;

trait Animal { }

fn main() {
pub existential type ServeFut : Animal;
}

0 comments on commit 8327517

Please sign in to comment.