Merge pull request #1189 from Pursuit92/master

Quick fix for "impl Trait"
This commit is contained in:
Nick Cameron 2016-10-14 10:10:18 +13:00 committed by GitHub
commit 171d917888
3 changed files with 10 additions and 3 deletions

View File

@ -618,9 +618,8 @@ impl Rewrite for ast::Ty {
ast::TyKind::Mac(..) |
ast::TyKind::Typeof(..) => unreachable!(),
ast::TyKind::ImplicitSelf => Some(String::from("")),
ast::TyKind::ImplTrait(..) => {
// FIXME(#1154) Implement impl Trait
Some(String::from("impl TODO"))
ast::TyKind::ImplTrait(ref it) => {
it.rewrite(context, width, offset).map(|it_str| format!("impl {}", it_str))
}
}
}

View File

@ -14,3 +14,7 @@ struct F {
}
fn issue_1006(def_id_to_string: for<'a, 'b> unsafe fn(TyCtxt<'b, 'tcx, 'tcx>, DefId) -> String) {}
fn impl_trait_fn_1() -> impl Fn(i32) -> Option<u8> {}
fn impl_trait_fn_2<E>() -> impl Future<Item=&'a i64,Error=E> {}

View File

@ -23,3 +23,7 @@ struct F {
}
fn issue_1006(def_id_to_string: for<'a, 'b> unsafe fn(TyCtxt<'b, 'tcx, 'tcx>, DefId) -> String) {}
fn impl_trait_fn_1() -> impl Fn(i32) -> Option<u8> {}
fn impl_trait_fn_2<E>() -> impl Future<Item = &'a i64, Error = E> {}