Skip to content

Commit

Permalink
Fix HIR printing of existential type rust-lang#60662
Browse files Browse the repository at this point in the history
This fixes rust-lang#60662
  • Loading branch information
Pulkit07 committed May 11, 2019
1 parent af98304 commit 3b78a47
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 3b78a47

Please sign in to comment.