ty::TySlice(ty) | ty::TyArray(ty, _) => match *ctor {
Slice(length) => (0..length).map(|_| ty).collect(),
ConstantValue(_) => vec![],
- Single => vec![ty],
_ => bug!("bad slice pattern {:?} {:?}", ctor, ty)
},
ty::TyRef(_, ref ty_and_mut) => vec![ty_and_mut.ty],
// Use T as the sub pattern type of Box<T>.
vec![substs.type_at(0)]
} else {
- if let ConstantValue(_) = *ctor {
- return vec![];
- }
adt.variants[ctor.variant_index_for_adt(adt)].fields.iter().map(|field| {
let is_visible = adt.is_enum()
|| field.vis.is_accessible_from(cx.module, cx.tcx);
(end == RangeEnd::Excluded && to == Ordering::Equal);
Ok(some_or_ok!(cmp_from(&from.val)) && end)
}
- Variant(_) |
Single => Ok(true),
_ => bug!(),
}
--- /dev/null
+// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// must-compile-successfully
+
+#![feature(const_fn)]
+
+struct S(pub &'static u32, pub u32);
+
+const fn g(ss: &S) -> &u32 { &ss.1 }
+
+static T: S = S(g(&T), 0);
+
+fn main () { }
],
"label": null,
"suggested_replacement": null,
+ "suggestion_approximate": null,
"expansion": null
}
],
],
"label": null,
"suggested_replacement": null,
+ "suggestion_approximate": null,
"expansion": null
}
],
],
"label": null,
"suggested_replacement": "1 / (2 + 3)",
+ "suggestion_approximate": null,
"expansion": null
}
],
],
"label": "not found in this scope",
"suggested_replacement": null,
+ "suggestion_approximate": null,
"expansion": null
}
],
"suggested_replacement": "use std::collections::binary_heap::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::collections::btree_map::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::collections::btree_set::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::collections::hash_map::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::collections::hash_set::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::collections::linked_list::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::collections::vec_deque::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::option::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::path::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::result::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::slice::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
},
{
"suggested_replacement": "use std::sync::mpsc::Iter;
",
+ "suggestion_approximate": null,
"expansion": null
}
],