about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-08 19:30:33 -0700
committerbors <bors@rust-lang.org>2016-06-08 19:30:33 -0700
commitbb4b3fb7f97924919f072ec9a360bdf943218dbf (patch)
tree3765d3082b94546c8ea1b23ae75e12aa7b43924b /src/librustdoc/html
parent34505e22289d3b2416ab0922131e8526d0d5cc0b (diff)
parent2de6ea7a35fb53ce5e4a7e5541a2adf425b7da23 (diff)
downloadrust-bb4b3fb7f97924919f072ec9a360bdf943218dbf.tar.gz
rust-bb4b3fb7f97924919f072ec9a360bdf943218dbf.zip
Auto merge of #32202 - arielb1:slice-patterns, r=nikomatsakis
Implement RFC495 semantics for slice patterns

non-MIR translation is still not supported for these and will happily ICE.

This is a [breaking-change] for many uses of slice_patterns.

[RFC 495 text](https://github.com/rust-lang/rfcs/blob/master/text/0495-array-pattern-changes.md)
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/format.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 92401a5c55f..760e84622cf 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -20,6 +20,7 @@ use std::iter::repeat;
 
 use rustc::middle::cstore::LOCAL_CRATE;
 use rustc::hir::def_id::{CRATE_DEF_INDEX, DefId};
+use rustc::util::common::slice_pat;
 use syntax::abi::Abi;
 use rustc::hir;
 
@@ -474,9 +475,9 @@ impl fmt::Display for clean::Type {
                        decl.decl)
             }
             clean::Tuple(ref typs) => {
-                match &**typs {
-                    [] => primitive_link(f, clean::PrimitiveTuple, "()"),
-                    [ref one] => {
+                match slice_pat(&&**typs) {
+                    &[] => primitive_link(f, clean::PrimitiveTuple, "()"),
+                    &[ref one] => {
                         primitive_link(f, clean::PrimitiveTuple, "(")?;
                         write!(f, "{},", one)?;
                         primitive_link(f, clean::PrimitiveTuple, ")")