about summary refs log tree commit diff
path: root/tests/source/chains.rs
diff options
context:
space:
mode:
authorNick Cameron <ncameron@mozilla.com>2016-05-28 21:50:25 +0100
committerNick Cameron <ncameron@mozilla.com>2016-05-29 09:32:48 +0100
commitbbb6038b92aa1ce17eebad96a904543e867f18b2 (patch)
tree2ed3eaa253cdc221a00fd030126489f4f6421d8e /tests/source/chains.rs
parent6e01fac285169c24db8e8c64d3bea0d368197650 (diff)
Treat chains with just expr? specially.
Fixes #1004
Diffstat (limited to 'tests/source/chains.rs')
-rw-r--r--tests/source/chains.rs15
1 files changed, 15 insertions, 0 deletions
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))
+            })
+            ?;
+}