Skip to content

Commit 836df36

Browse files
committed
---
yaml --- r: 273919 b: refs/heads/beta c: b6c1f1c h: refs/heads/master i: 273917: 9ecfef2 273915: e3d6603 273911: 69a8869 273903: e6dc220 273887: b11c9c6 273855: b0b0150 273791: 9efe71e 273663: 1e1e71c 273407: ab0d916
1 parent fa8f13d commit 836df36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+2133
-830
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: f486b7c3b31a483fee944970c725cf741a4969db
26+
refs/heads/beta: b6c1f1cf3f392af6bad6018a9e8fd25cf608c475
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ opt inject-std-version 1 "inject the current compiler version of libstd into pro
608608
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
609609
opt rustbuild 0 "use the rust and cargo based build system"
610610
opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
611+
opt codegen-tests 1 "run the src/test/codegen tests"
611612

612613
# Optimization and debugging options. These may be overridden by the release channel, etc.
613614
opt_nosave optimize 1 "build optimized rust code"
@@ -1497,7 +1498,9 @@ do
14971498
LLVM_INST_DIR=$CFG_LLVM_ROOT
14981499
do_reconfigure=0
14991500
# Check that LLVm FileCheck is available. Needed for the tests
1500-
need_cmd $LLVM_INST_DIR/bin/FileCheck
1501+
if [ -z "$CFG_DISABLE_CODEGEN_TESTS" ]; then
1502+
need_cmd $LLVM_INST_DIR/bin/FileCheck
1503+
fi
15011504
fi
15021505

15031506
if [ ${do_reconfigure} -ne 0 ]

branches/beta/mk/rt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
157157
# If the test suite passes, however, without symbol prefixes then we should be
158158
# good to go!
159159
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
160+
else ifeq ($(findstring dragonfly, $(OSTYPE_$(1))), dragonfly)
161+
JEMALLOC_ARGS_$(1) := --with-jemalloc-prefix=je_
160162
endif
161163

162164
ifdef CFG_ENABLE_DEBUG_JEMALLOC

branches/beta/mk/tests.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,15 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
305305
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
306306
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
307307
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
308-
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
309-
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
310308
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
311309
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
312310

311+
ifndef CFG_DISABLE_CODEGEN_TESTS
312+
check-stage$(1)-T-$(2)-H-$(3)-exec: \
313+
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
314+
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec
315+
endif
316+
313317
# Only test the compiler-dependent crates when the target is
314318
# able to build a compiler (when the target triple is in the set of host triples)
315319
ifneq ($$(findstring $(2),$$(CFG_HOST)),)

branches/beta/src/liballoc_jemalloc/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ fn main() {
8686
// should be good to go!
8787
cmd.arg("--with-jemalloc-prefix=je_");
8888
cmd.arg("--disable-tls");
89+
} else if target.contains("dragonfly") {
90+
cmd.arg("--with-jemalloc-prefix=je_");
8991
}
9092

9193
if cfg!(feature = "debug-jemalloc") {

branches/beta/src/liballoc_jemalloc/lib.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,27 @@ use libc::{c_int, c_void, size_t};
4242
extern {}
4343

4444
// Note that the symbols here are prefixed by default on OSX (we don't
45-
// explicitly request it), and on Android we explicitly request it as
46-
// unprefixing cause segfaults (mismatches in allocators).
45+
// explicitly request it), and on Android and DragonFly we explicitly request
46+
// it as unprefixing cause segfaults (mismatches in allocators).
4747
extern {
48-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
48+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
49+
target_os = "dragonfly"),
4950
link_name = "je_mallocx")]
5051
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
51-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
52+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
53+
target_os = "dragonfly"),
5254
link_name = "je_rallocx")]
5355
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
54-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
56+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
57+
target_os = "dragonfly"),
5558
link_name = "je_xallocx")]
5659
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
57-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
60+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
61+
target_os = "dragonfly"),
5862
link_name = "je_sdallocx")]
5963
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
60-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
64+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
65+
target_os = "dragonfly"),
6166
link_name = "je_nallocx")]
6267
fn nallocx(size: size_t, flags: c_int) -> size_t;
6368
}

branches/beta/src/libcollections/btree/map.rs

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ pub struct Values<'a, K: 'a, V: 'a> {
285285
inner: Iter<'a, K, V>,
286286
}
287287

288+
/// A mutable iterator over a BTreeMap's values.
289+
#[unstable(feature = "map_values_mut", reason = "recently added", issue = "32551")]
290+
pub struct ValuesMut<'a, K: 'a, V: 'a> {
291+
inner: IterMut<'a, K, V>,
292+
}
293+
288294
/// An iterator over a sub-range of BTreeMap's entries.
289295
pub struct Range<'a, K: 'a, V: 'a> {
290296
front: Handle<NodeRef<marker::Immut<'a>, K, V, marker::Leaf>, marker::Edge>,
@@ -1006,6 +1012,33 @@ impl<'a, K, V> Iterator for Range<'a, K, V> {
10061012
}
10071013
}
10081014

1015+
#[unstable(feature = "map_values_mut", reason = "recently added", issue = "32551")]
1016+
impl<'a, K, V> Iterator for ValuesMut<'a, K, V> {
1017+
type Item = &'a mut V;
1018+
1019+
fn next(&mut self) -> Option<&'a mut V> {
1020+
self.inner.next().map(|(_, v)| v)
1021+
}
1022+
1023+
fn size_hint(&self) -> (usize, Option<usize>) {
1024+
self.inner.size_hint()
1025+
}
1026+
}
1027+
1028+
#[unstable(feature = "map_values_mut", reason = "recently added", issue = "32551")]
1029+
impl<'a, K, V> DoubleEndedIterator for ValuesMut<'a, K, V> {
1030+
fn next_back(&mut self) -> Option<&'a mut V> {
1031+
self.inner.next_back().map(|(_, v)| v)
1032+
}
1033+
}
1034+
1035+
#[unstable(feature = "map_values_mut", reason = "recently added", issue = "32551")]
1036+
impl<'a, K, V> ExactSizeIterator for ValuesMut<'a, K, V> {
1037+
fn len(&self) -> usize {
1038+
self.inner.len()
1039+
}
1040+
}
1041+
10091042
impl<'a, K, V> Range<'a, K, V> {
10101043
unsafe fn next_unchecked(&mut self) -> (&'a K, &'a V) {
10111044
let handle = self.front;
@@ -1403,6 +1436,33 @@ impl<K, V> BTreeMap<K, V> {
14031436
Values { inner: self.iter() }
14041437
}
14051438

1439+
/// Gets a mutable iterator over the values of the map, in order by key.
1440+
///
1441+
/// # Examples
1442+
///
1443+
/// Basic usage:
1444+
///
1445+
/// ```
1446+
/// # #![feature(map_values_mut)]
1447+
/// use std::collections::BTreeMap;
1448+
///
1449+
/// let mut a = BTreeMap::new();
1450+
/// a.insert(1, String::from("hello"));
1451+
/// a.insert(2, String::from("goodbye"));
1452+
///
1453+
/// for value in a.values_mut() {
1454+
/// value.push_str("!");
1455+
/// }
1456+
///
1457+
/// let values: Vec<String> = a.values().cloned().collect();
1458+
/// assert_eq!(values, [String::from("hello!"),
1459+
/// String::from("goodbye!")]);
1460+
/// ```
1461+
#[unstable(feature = "map_values_mut", reason = "recently added", issue = "32551")]
1462+
pub fn values_mut<'a>(&'a mut self) -> ValuesMut<'a, K, V> {
1463+
ValuesMut { inner: self.iter_mut() }
1464+
}
1465+
14061466
/// Returns the number of elements in the map.
14071467
///
14081468
/// # Examples

branches/beta/src/libcollectionstest/btree/map.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,21 @@ fn test_iter_rev() {
114114
test(size, map.into_iter().rev());
115115
}
116116

117+
#[test]
118+
fn test_values_mut() {
119+
let mut a = BTreeMap::new();
120+
a.insert(1, String::from("hello"));
121+
a.insert(2, String::from("goodbye"));
122+
123+
for value in a.values_mut() {
124+
value.push_str("!");
125+
}
126+
127+
let values: Vec<String> = a.values().cloned().collect();
128+
assert_eq!(values, [String::from("hello!"),
129+
String::from("goodbye!")]);
130+
}
131+
117132
#[test]
118133
fn test_iter_mixed() {
119134
let size = 10000;

branches/beta/src/libcollectionstest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#![feature(enumset)]
2323
#![feature(iter_arith)]
2424
#![feature(map_entry_keys)]
25+
#![feature(map_values_mut)]
2526
#![feature(pattern)]
2627
#![feature(rand)]
2728
#![feature(set_recovery)]

branches/beta/src/libcore/num/dec2flt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ from_str_float_impl!(f64);
154154
/// for [`f32`] and [`f64`].
155155
///
156156
/// [`FromStr`]: ../str/trait.FromStr.html
157-
/// [`f32`]: ../primitive.f32.html
158-
/// [`f64`]: ../primitive.f64.html
157+
/// [`f32`]: ../../std/primitive.f32.html
158+
/// [`f64`]: ../../std/primitive.f64.html
159159
#[derive(Debug, Clone, PartialEq)]
160160
#[stable(feature = "rust1", since = "1.0.0")]
161161
pub struct ParseFloatError {

branches/beta/src/librustc/infer/combine.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use super::equate::Equate;
3737
use super::glb::Glb;
3838
use super::lub::Lub;
3939
use super::sub::Sub;
40-
use super::{InferCtxt};
40+
use super::InferCtxt;
4141
use super::{MiscVariable, TypeTrace};
4242
use super::type_variable::{RelationDir, BiTo, EqTo, SubtypeOf, SupertypeOf};
4343

@@ -46,6 +46,7 @@ use ty::{self, Ty, TyCtxt};
4646
use ty::error::TypeError;
4747
use ty::fold::{TypeFolder, TypeFoldable};
4848
use ty::relate::{Relate, RelateResult, TypeRelation};
49+
use traits::PredicateObligations;
4950

5051
use syntax::ast;
5152
use syntax::codemap::Span;
@@ -56,6 +57,7 @@ pub struct CombineFields<'a, 'tcx: 'a> {
5657
pub a_is_expected: bool,
5758
pub trace: TypeTrace<'tcx>,
5859
pub cause: Option<ty::relate::Cause>,
60+
pub obligations: PredicateObligations<'tcx>,
5961
}
6062

6163
pub fn super_combine_tys<'a,'tcx:'a,R>(infcx: &InferCtxt<'a, 'tcx>,

branches/beta/src/librustc/infer/equate.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use super::type_variable::{EqTo};
1616
use ty::{self, Ty, TyCtxt};
1717
use ty::TyVar;
1818
use ty::relate::{Relate, RelateResult, TypeRelation};
19+
use traits::PredicateObligations;
1920

2021
/// Ensures `a` is made equal to `b`. Returns `a` on success.
2122
pub struct Equate<'a, 'tcx: 'a> {
@@ -26,6 +27,10 @@ impl<'a, 'tcx> Equate<'a, 'tcx> {
2627
pub fn new(fields: CombineFields<'a, 'tcx>) -> Equate<'a, 'tcx> {
2728
Equate { fields: fields }
2829
}
30+
31+
pub fn obligations(self) -> PredicateObligations<'tcx> {
32+
self.fields.obligations
33+
}
2934
}
3035

3136
impl<'a, 'tcx> TypeRelation<'a,'tcx> for Equate<'a, 'tcx> {

branches/beta/src/librustc/infer/glb.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use super::Subtype;
1616

1717
use ty::{self, Ty, TyCtxt};
1818
use ty::relate::{Relate, RelateResult, TypeRelation};
19+
use traits::PredicateObligations;
1920

2021
/// "Greatest lower bound" (common subtype)
2122
pub struct Glb<'a, 'tcx: 'a> {
@@ -26,6 +27,10 @@ impl<'a, 'tcx> Glb<'a, 'tcx> {
2627
pub fn new(fields: CombineFields<'a, 'tcx>) -> Glb<'a, 'tcx> {
2728
Glb { fields: fields }
2829
}
30+
31+
pub fn obligations(self) -> PredicateObligations<'tcx> {
32+
self.fields.obligations
33+
}
2934
}
3035

3136
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Glb<'a, 'tcx> {

branches/beta/src/librustc/infer/lub.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use super::Subtype;
1616

1717
use ty::{self, Ty, TyCtxt};
1818
use ty::relate::{Relate, RelateResult, TypeRelation};
19+
use traits::PredicateObligations;
1920

2021
/// "Least upper bound" (common supertype)
2122
pub struct Lub<'a, 'tcx: 'a> {
@@ -26,6 +27,10 @@ impl<'a, 'tcx> Lub<'a, 'tcx> {
2627
pub fn new(fields: CombineFields<'a, 'tcx>) -> Lub<'a, 'tcx> {
2728
Lub { fields: fields }
2829
}
30+
31+
pub fn obligations(self) -> PredicateObligations<'tcx> {
32+
self.fields.obligations
33+
}
2934
}
3035

3136
impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Lub<'a, 'tcx> {

0 commit comments

Comments
 (0)