From bbb6038b92aa1ce17eebad96a904543e867f18b2 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Sat, 28 May 2016 21:50:25 +0100 Subject: Treat chains with just expr? specially. Fixes #1004 --- tests/source/chains.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests/source') diff --git a/tests/source/chains.rs b/tests/source/chains.rs index 66c982082e7..deed8f6d8d8 100644 --- a/tests/source/chains.rs +++ b/tests/source/chains.rs @@ -133,3 +133,18 @@ fn try_shorthand() { |tcx| tcx.lookup_item_type(def_id).generics)?; fooooooooooooooooooooooooooo()?.bar()?.baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?; } + +fn issue_1004() { + match *self { + ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i), + ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i), + ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i), + } + ?; + + ty::tls::with(|tcx| { + let tap = ty::Binder(TraitAndProjections(principal, projections)); + in_binder(f, tcx, &ty::Binder(""), Some(tap)) + }) + ?; +} -- cgit 1.4.1-3-g733a5