Skip to content

Commit 7bcab6c

Browse files
committed
---
yaml --- r: 220942 b: refs/heads/auto c: fec23d9 h: refs/heads/master v: v3
1 parent 5a4826b commit 7bcab6c

File tree

34 files changed

+569
-218
lines changed

34 files changed

+569
-218
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 778c89c1bb86dbd370e8b51911e2916180f42aec
11+
refs/heads/auto: fec23d9d59cd4fda9a5642d63ad27f8dcc6c3bd8
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/configure

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,17 @@ envopt() {
323323
fi
324324
}
325325

326+
enable_if_not_disabled() {
327+
local OP=$1
328+
local UOP=$(echo $OP | tr '[:lower:]' '[:upper:]' | tr '\-' '\_')
329+
local ENAB_V="CFG_ENABLE_$UOP"
330+
local EXPLICITLY_DISABLED="CFG_DISABLE_${UOP}_PROVIDED"
331+
eval VV=\$$EXPLICITLY_DISABLED
332+
if [ -z "$VV" ]; then
333+
eval $ENAB_V=1
334+
fi
335+
}
336+
326337
to_llvm_triple() {
327338
case $1 in
328339
i686-w64-mingw32) echo i686-pc-windows-gnu ;;
@@ -671,10 +682,12 @@ if [ -n "$CFG_ENABLE_DEBUG" ]; then
671682
CFG_DISABLE_OPTIMIZE=1
672683
CFG_DISABLE_OPTIMIZE_CXX=1
673684
fi
674-
CFG_ENABLE_DEBUG_ASSERTIONS=1
675-
CFG_ENABLE_DEBUG_JEMALLOC=1
676-
CFG_ENABLE_DEBUGINFO=1
677-
CFG_ENABLE_LLVM_ASSERTIONS=1
685+
686+
# Set following variables to 1 unless setting already provided
687+
enable_if_not_disabled debug-assertions
688+
enable_if_not_disabled debug-jemalloc
689+
enable_if_not_disabled debuginfo
690+
enable_if_not_disabled llvm-assertions
678691
fi
679692

680693
# OK, now write the debugging options

branches/auto/src/libcore/atomic.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ use intrinsics;
7878
use cell::UnsafeCell;
7979

8080
use default::Default;
81+
use fmt;
8182

8283
/// A boolean type which can be safely shared between threads.
8384
#[stable(feature = "rust1", since = "1.0.0")]
@@ -1089,3 +1090,23 @@ pub fn fence(order: Ordering) {
10891090
}
10901091
}
10911092
}
1093+
1094+
macro_rules! impl_Debug {
1095+
($($t:ident)*) => ($(
1096+
#[stable(feature = "atomic_debug", since = "1.3.0")]
1097+
impl fmt::Debug for $t {
1098+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1099+
f.debug_tuple(stringify!($t)).field(&self.load(Ordering::SeqCst)).finish()
1100+
}
1101+
}
1102+
)*);
1103+
}
1104+
1105+
impl_Debug!{ AtomicUsize AtomicIsize AtomicBool }
1106+
1107+
#[stable(feature = "atomic_debug", since = "1.3.0")]
1108+
impl<T> fmt::Debug for AtomicPtr<T> {
1109+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1110+
f.debug_tuple("AtomicPtr").field(&self.load(Ordering::SeqCst)).finish()
1111+
}
1112+
}

branches/auto/src/libcore/str/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -635,10 +635,10 @@ impl<'a, P: Pattern<'a>> SplitInternal<'a, P> {
635635

636636
generate_pattern_iterators! {
637637
forward:
638-
#[doc="Created with the method `.split()`."]
638+
/// Created with the method `.split()`.
639639
struct Split;
640640
reverse:
641-
#[doc="Created with the method `.rsplit()`."]
641+
/// Created with the method `.rsplit()`.
642642
struct RSplit;
643643
stability:
644644
#[stable(feature = "rust1", since = "1.0.0")]
@@ -649,10 +649,10 @@ generate_pattern_iterators! {
649649

650650
generate_pattern_iterators! {
651651
forward:
652-
#[doc="Created with the method `.split_terminator()`."]
652+
/// Created with the method `.split_terminator()`.
653653
struct SplitTerminator;
654654
reverse:
655-
#[doc="Created with the method `.rsplit_terminator()`."]
655+
/// Created with the method `.rsplit_terminator()`.
656656
struct RSplitTerminator;
657657
stability:
658658
#[stable(feature = "rust1", since = "1.0.0")]
@@ -695,10 +695,10 @@ impl<'a, P: Pattern<'a>> SplitNInternal<'a, P> {
695695

696696
generate_pattern_iterators! {
697697
forward:
698-
#[doc="Created with the method `.splitn()`."]
698+
/// Created with the method `.splitn()`.
699699
struct SplitN;
700700
reverse:
701-
#[doc="Created with the method `.rsplitn()`."]
701+
/// Created with the method `.rsplitn()`.
702702
struct RSplitN;
703703
stability:
704704
#[stable(feature = "rust1", since = "1.0.0")]
@@ -729,10 +729,10 @@ impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {
729729

730730
generate_pattern_iterators! {
731731
forward:
732-
#[doc="Created with the method `.match_indices()`."]
732+
/// Created with the method `.match_indices()`.
733733
struct MatchIndices;
734734
reverse:
735-
#[doc="Created with the method `.rmatch_indices()`."]
735+
/// Created with the method `.rmatch_indices()`.
736736
struct RMatchIndices;
737737
stability:
738738
#[unstable(feature = "str_match_indices",
@@ -770,10 +770,10 @@ impl<'a, P: Pattern<'a>> MatchesInternal<'a, P> {
770770

771771
generate_pattern_iterators! {
772772
forward:
773-
#[doc="Created with the method `.matches()`."]
773+
/// Created with the method `.matches()`.
774774
struct Matches;
775775
reverse:
776-
#[doc="Created with the method `.rmatches()`."]
776+
/// Created with the method `.rmatches()`.
777777
struct RMatches;
778778
stability:
779779
#[stable(feature = "str_matches", since = "1.2.0")]

branches/auto/src/librustc/middle/free_region.rs

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,21 @@
1313
use middle::implicator::Implication;
1414
use middle::ty::{self, FreeRegion};
1515
use util::common::can_reach;
16-
use util::nodemap::FnvHashMap;
16+
use util::nodemap::{FnvHashMap, FnvHashSet};
1717

1818
#[derive(Clone)]
1919
pub struct FreeRegionMap {
20-
/// `free_region_map` maps from a free region `a` to a list of
20+
/// `map` maps from a free region `a` to a list of
2121
/// free regions `bs` such that `a <= b for all b in bs`
2222
map: FnvHashMap<FreeRegion, Vec<FreeRegion>>,
23+
/// regions that are required to outlive (and therefore be
24+
/// equal to) 'static.
25+
statics: FnvHashSet<FreeRegion>
2326
}
2427

2528
impl FreeRegionMap {
2629
pub fn new() -> FreeRegionMap {
27-
FreeRegionMap { map: FnvHashMap() }
30+
FreeRegionMap { map: FnvHashMap(), statics: FnvHashSet() }
2831
}
2932

3033
pub fn relate_free_regions_from_implications<'tcx>(&mut self,
@@ -59,6 +62,8 @@ impl FreeRegionMap {
5962
}
6063
ty::Predicate::RegionOutlives(ty::Binder(ty::OutlivesPredicate(r_a, r_b))) => {
6164
match (r_a, r_b) {
65+
(ty::ReStatic, ty::ReFree(_)) => {},
66+
(ty::ReFree(fr_a), ty::ReStatic) => self.relate_to_static(fr_a),
6267
(ty::ReFree(fr_a), ty::ReFree(fr_b)) => {
6368
// Record that `'a:'b`. Or, put another way, `'b <= 'a`.
6469
self.relate_free_regions(fr_b, fr_a);
@@ -76,8 +81,12 @@ impl FreeRegionMap {
7681
}
7782
}
7883

79-
pub fn relate_free_regions(&mut self, sub: FreeRegion, sup: FreeRegion) {
80-
let mut sups = self.map.entry(sub).or_insert(Vec::new());
84+
fn relate_to_static(&mut self, sup: FreeRegion) {
85+
self.statics.insert(sup);
86+
}
87+
88+
fn relate_free_regions(&mut self, sub: FreeRegion, sup: FreeRegion) {
89+
let mut sups = self.map.entry(sub).or_insert(Vec::new());
8190
if !sups.contains(&sup) {
8291
sups.push(sup);
8392
}
@@ -88,7 +97,7 @@ impl FreeRegionMap {
8897
/// it is possible that `sub != sup` and `sub <= sup` and `sup <= sub`
8998
/// (that is, the user can give two different names to the same lifetime).
9099
pub fn sub_free_region(&self, sub: FreeRegion, sup: FreeRegion) -> bool {
91-
can_reach(&self.map, sub, sup)
100+
can_reach(&self.map, sub, sup) || self.is_static(&sup)
92101
}
93102

94103
/// Determines whether one region is a subregion of another. This is intended to run *after
@@ -116,10 +125,17 @@ impl FreeRegionMap {
116125
(ty::ReFree(sub_fr), ty::ReFree(super_fr)) =>
117126
self.sub_free_region(sub_fr, super_fr),
118127

128+
(ty::ReStatic, ty::ReFree(ref sup_fr)) => self.is_static(sup_fr),
129+
119130
_ =>
120131
false,
121132
}
122133
}
123134
}
124-
}
125135

136+
/// Determines whether this free-region is required to be 'static
137+
pub fn is_static(&self, super_region: &ty::FreeRegion) -> bool {
138+
debug!("is_static(super_region={:?})", super_region);
139+
self.statics.iter().any(|s| can_reach(&self.map, *s, *super_region))
140+
}
141+
}

branches/auto/src/librustc/middle/infer/region_inference/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,8 @@ impl<'a, 'tcx> RegionVarBindings<'a, 'tcx> {
869869
// is the scope `s_id`. Otherwise, as we do not know
870870
// big the free region is precisely, the GLB is undefined.
871871
let fr_scope = fr.scope.to_code_extent();
872-
if self.tcx.region_maps.nearest_common_ancestor(fr_scope, s_id) == fr_scope {
872+
if self.tcx.region_maps.nearest_common_ancestor(fr_scope, s_id) == fr_scope ||
873+
free_regions.is_static(fr) {
873874
Ok(s)
874875
} else {
875876
Err(TypeError::RegionsNoOverlap(b, a))

branches/auto/src/librustc_back/target/openbsd_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn opts() -> TargetOptions {
2727
"-Wl,--as-needed".to_string(),
2828
),
2929
position_independent_executables: true,
30-
archive_format: "bsd".to_string(),
30+
archive_format: "gnu".to_string(),
3131
.. Default::default()
3232
}
3333
}

branches/auto/src/librustc_lint/builtin.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,8 +1616,6 @@ impl LintPass for MissingDoc {
16161616
}
16171617
return
16181618
},
1619-
ast::ItemConst(..) => "a constant",
1620-
ast::ItemStatic(..) => "a static",
16211619
_ => return
16221620
};
16231621

branches/auto/src/librustc_trans/trans/common.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -905,11 +905,13 @@ pub fn fulfill_obligation<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>,
905905
let vtable = selection.map(|predicate| {
906906
fulfill_cx.register_predicate_obligation(&infcx, predicate);
907907
});
908-
let vtable = drain_fulfillment_cx_or_panic(span, &infcx, &mut fulfill_cx, &vtable);
908+
let vtable = erase_regions(tcx,
909+
&drain_fulfillment_cx_or_panic(span, &infcx, &mut fulfill_cx, &vtable)
910+
);
909911

910-
info!("Cache miss: {:?}", trait_ref);
911-
ccx.trait_cache().borrow_mut().insert(trait_ref,
912-
vtable.clone());
912+
info!("Cache miss: {:?} => {:?}", trait_ref, vtable);
913+
914+
ccx.trait_cache().borrow_mut().insert(trait_ref, vtable.clone());
913915

914916
vtable
915917
}

branches/auto/src/librustc_typeck/astconv.rs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ fn report_ambiguous_associated_type(tcx: &ty::ctxt,
11121112
// any ambiguity.
11131113
fn find_bound_for_assoc_item<'tcx>(this: &AstConv<'tcx>,
11141114
ty_param_node_id: ast::NodeId,
1115-
ty_param_name: Option<ast::Name>,
1115+
ty_param_name: ast::Name,
11161116
assoc_name: ast::Name,
11171117
span: Span)
11181118
-> Result<ty::PolyTraitRef<'tcx>, ErrorReported>
@@ -1138,21 +1138,11 @@ fn find_bound_for_assoc_item<'tcx>(this: &AstConv<'tcx>,
11381138
.filter(|b| this.trait_defines_associated_type_named(b.def_id(), assoc_name))
11391139
.collect();
11401140

1141-
if let Some(s) = ty_param_name {
1142-
// borrowck doesn't like this any other way
1143-
one_bound_for_assoc_type(tcx,
1144-
suitable_bounds,
1145-
&token::get_name(s),
1146-
&token::get_name(assoc_name),
1147-
span)
1148-
} else {
1149-
one_bound_for_assoc_type(tcx,
1150-
suitable_bounds,
1151-
"Self",
1152-
&token::get_name(assoc_name),
1153-
span)
1154-
1155-
}
1141+
one_bound_for_assoc_type(tcx,
1142+
suitable_bounds,
1143+
&token::get_name(ty_param_name),
1144+
&token::get_name(assoc_name),
1145+
span)
11561146
}
11571147

11581148

@@ -1251,7 +1241,11 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
12511241
}
12521242
(&ty::TyParam(_), def::DefSelfTy(Some(trait_did), None)) => {
12531243
assert_eq!(trait_did.krate, ast::LOCAL_CRATE);
1254-
match find_bound_for_assoc_item(this, trait_did.node, None, assoc_name, span) {
1244+
match find_bound_for_assoc_item(this,
1245+
trait_did.node,
1246+
token::special_idents::type_self.name,
1247+
assoc_name,
1248+
span) {
12551249
Ok(bound) => bound,
12561250
Err(ErrorReported) => return (tcx.types.err, ty_path_def),
12571251
}
@@ -1260,7 +1254,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx>,
12601254
assert_eq!(param_did.krate, ast::LOCAL_CRATE);
12611255
match find_bound_for_assoc_item(this,
12621256
param_did.node,
1263-
Some(param_name),
1257+
param_name,
12641258
assoc_name,
12651259
span) {
12661260
Ok(bound) => bound,

branches/auto/src/librustdoc/clean/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1947,6 +1947,10 @@ impl Span {
19471947

19481948
impl Clean<Span> for syntax::codemap::Span {
19491949
fn clean(&self, cx: &DocContext) -> Span {
1950+
if *self == DUMMY_SP {
1951+
return Span::empty();
1952+
}
1953+
19501954
let cm = cx.sess().codemap();
19511955
let filename = cm.span_to_filename(*self);
19521956
let lo = cm.lookup_char_pos(self.lo);

branches/auto/src/librustdoc/html/format.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,19 @@ impl fmt::Display for clean::Type {
540540
}
541541
}
542542

543+
impl fmt::Display for clean::Impl {
544+
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
545+
try!(write!(f, "impl{} ", self.generics));
546+
if let Some(ref ty) = self.trait_ {
547+
try!(write!(f, "{}{} for ",
548+
if self.polarity == Some(clean::ImplPolarity::Negative) { "!" } else { "" },
549+
*ty));
550+
}
551+
try!(write!(f, "{}{}", self.for_, WhereClause(&self.generics)));
552+
Ok(())
553+
}
554+
}
555+
543556
impl fmt::Display for clean::Arguments {
544557
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
545558
for (i, input) in self.values.iter().enumerate() {

0 commit comments

Comments
 (0)