Skip to content

Commit b4da191

Browse files
committed
---
yaml --- r: 220759 b: refs/heads/master c: 691ce23 h: refs/heads/master i: 220757: 955616b 220755: 3f068f8 220751: 273df9d v: v3
1 parent 9f1bd35 commit b4da191

Some content is hidden

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

60 files changed

+807
-235
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 1e79917bda90d3b7ea53fc08b0c0c4862dfdca53
2+
refs/heads/master: 691ce23479b08a292ad106606dab347306fc381f
33
refs/heads/snap-stage3: d4432b37378ec55450e06799f5344b4b0f4b94e0
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/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

trunk/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+
}

trunk/src/libcore/fmt/num.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
1313
// FIXME: #6220 Implement floating point formatting
1414

15-
#![allow(unsigned_negation)]
16-
1715
use prelude::*;
1816

1917
use fmt;

trunk/src/libcore/ops.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,6 @@ pub trait Neg {
517517
macro_rules! neg_impl_core {
518518
($id:ident => $body:expr, $($t:ty)*) => ($(
519519
#[stable(feature = "rust1", since = "1.0.0")]
520-
#[allow(unsigned_negation)]
521520
impl Neg for $t {
522521
#[stable(feature = "rust1", since = "1.0.0")]
523522
type Output = $t;

trunk/src/libcore/str/mod.rs

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

637637
generate_pattern_iterators! {
638638
forward:
639-
#[doc="Created with the method `.split()`."]
639+
/// Created with the method `.split()`.
640640
struct Split;
641641
reverse:
642-
#[doc="Created with the method `.rsplit()`."]
642+
/// Created with the method `.rsplit()`.
643643
struct RSplit;
644644
stability:
645645
#[stable(feature = "rust1", since = "1.0.0")]
@@ -650,10 +650,10 @@ generate_pattern_iterators! {
650650

651651
generate_pattern_iterators! {
652652
forward:
653-
#[doc="Created with the method `.split_terminator()`."]
653+
/// Created with the method `.split_terminator()`.
654654
struct SplitTerminator;
655655
reverse:
656-
#[doc="Created with the method `.rsplit_terminator()`."]
656+
/// Created with the method `.rsplit_terminator()`.
657657
struct RSplitTerminator;
658658
stability:
659659
#[stable(feature = "rust1", since = "1.0.0")]
@@ -696,10 +696,10 @@ impl<'a, P: Pattern<'a>> SplitNInternal<'a, P> {
696696

697697
generate_pattern_iterators! {
698698
forward:
699-
#[doc="Created with the method `.splitn()`."]
699+
/// Created with the method `.splitn()`.
700700
struct SplitN;
701701
reverse:
702-
#[doc="Created with the method `.rsplitn()`."]
702+
/// Created with the method `.rsplitn()`.
703703
struct RSplitN;
704704
stability:
705705
#[stable(feature = "rust1", since = "1.0.0")]
@@ -730,10 +730,10 @@ impl<'a, P: Pattern<'a>> MatchIndicesInternal<'a, P> {
730730

731731
generate_pattern_iterators! {
732732
forward:
733-
#[doc="Created with the method `.match_indices()`."]
733+
/// Created with the method `.match_indices()`.
734734
struct MatchIndices;
735735
reverse:
736-
#[doc="Created with the method `.rmatch_indices()`."]
736+
/// Created with the method `.rmatch_indices()`.
737737
struct RMatchIndices;
738738
stability:
739739
#[unstable(feature = "str_match_indices",
@@ -771,10 +771,10 @@ impl<'a, P: Pattern<'a>> MatchesInternal<'a, P> {
771771

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

trunk/src/libcoretest/fmt/num.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
10-
#![allow(unsigned_negation)]
11-
1210
use core::fmt::radix;
1311

1412
#[test]

trunk/src/librand/isaac.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ impl IsaacRng {
126126

127127
/// Refills the output buffer (`self.rsl`)
128128
#[inline]
129-
#[allow(unsigned_negation)]
130129
fn isaac(&mut self) {
131130
self.c = self.c + w(1);
132131
// abbreviations

trunk/src/librustc/lint/context.rs

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ enum TargetLint {
7575

7676
/// Temporary renaming, used for easing migration pain; see #16545
7777
Renamed(String, LintId),
78+
79+
/// Lint with this name existed previously, but has been removed/deprecated.
80+
/// The string argument is the reason for removal.
81+
Removed(String),
82+
}
83+
84+
enum FindLintError {
85+
NotFound,
86+
Removed
7887
}
7988

8089
impl LintStore {
@@ -166,30 +175,42 @@ impl LintStore {
166175
self.by_name.insert(old_name.to_string(), Renamed(new_name.to_string(), target));
167176
}
168177

178+
pub fn register_removed(&mut self, name: &str, reason: &str) {
179+
self.by_name.insert(name.into(), Removed(reason.into()));
180+
}
181+
169182
#[allow(unused_variables)]
170183
fn find_lint(&self, lint_name: &str, sess: &Session, span: Option<Span>)
171-
-> Option<LintId>
184+
-> Result<LintId, FindLintError>
172185
{
173186
match self.by_name.get(lint_name) {
174-
Some(&Id(lint_id)) => Some(lint_id),
187+
Some(&Id(lint_id)) => Ok(lint_id),
175188
Some(&Renamed(ref new_name, lint_id)) => {
176189
let warning = format!("lint {} has been renamed to {}",
177190
lint_name, new_name);
178191
match span {
179192
Some(span) => sess.span_warn(span, &warning[..]),
180193
None => sess.warn(&warning[..]),
181194
};
182-
Some(lint_id)
183-
}
184-
None => None
195+
Ok(lint_id)
196+
},
197+
Some(&Removed(ref reason)) => {
198+
let warning = format!("lint {} has been removed: {}", lint_name, reason);
199+
match span {
200+
Some(span) => sess.span_warn(span, &warning[..]),
201+
None => sess.warn(&warning[..])
202+
}
203+
Err(FindLintError::Removed)
204+
},
205+
None => Err(FindLintError::NotFound)
185206
}
186207
}
187208

188209
pub fn process_command_line(&mut self, sess: &Session) {
189210
for &(ref lint_name, level) in &sess.opts.lint_opts {
190211
match self.find_lint(&lint_name[..], sess, None) {
191-
Some(lint_id) => self.set_level(lint_id, (level, CommandLine)),
192-
None => {
212+
Ok(lint_id) => self.set_level(lint_id, (level, CommandLine)),
213+
Err(_) => {
193214
match self.lint_groups.iter().map(|(&x, pair)| (x, pair.0.clone()))
194215
.collect::<FnvHashMap<&'static str,
195216
Vec<LintId>>>()
@@ -398,8 +419,8 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
398419
}
399420
Ok((lint_name, level, span)) => {
400421
match self.lints.find_lint(&lint_name, &self.tcx.sess, Some(span)) {
401-
Some(lint_id) => vec![(lint_id, level, span)],
402-
None => {
422+
Ok(lint_id) => vec![(lint_id, level, span)],
423+
Err(FindLintError::NotFound) => {
403424
match self.lints.lint_groups.get(&lint_name[..]) {
404425
Some(&(ref v, _)) => v.iter()
405426
.map(|lint_id: &LintId|
@@ -412,7 +433,8 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
412433
continue;
413434
}
414435
}
415-
}
436+
},
437+
Err(FindLintError::Removed) => { continue; }
416438
}
417439
}
418440
};

trunk/src/librustc/middle/const_eval.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
// except according to those terms.
1010

1111
#![allow(non_camel_case_types)]
12-
#![allow(unsigned_negation)]
1312

1413
use self::ConstVal::*;
1514

@@ -27,7 +26,6 @@ use util::num::ToPrimitive;
2726
use syntax::ast::{self, Expr};
2827
use syntax::ast_util;
2928
use syntax::codemap::Span;
30-
use syntax::feature_gate;
3129
use syntax::parse::token::InternedString;
3230
use syntax::ptr::P;
3331
use syntax::{codemap, visit};
@@ -745,13 +743,6 @@ pub fn eval_const_expr_with_substs<'tcx, S>(tcx: &ty::ctxt<'tcx>,
745743
Float(f) => Float(-f),
746744
Int(n) => try!(const_int_checked_neg(n, e, expr_int_type)),
747745
Uint(i) => {
748-
if !tcx.sess.features.borrow().negate_unsigned {
749-
feature_gate::emit_feature_err(
750-
&tcx.sess.parse_sess.span_diagnostic,
751-
"negate_unsigned",
752-
e.span,
753-
"unary negation of unsigned integers may be removed in the future");
754-
}
755746
try!(const_uint_checked_neg(i, e, expr_uint_type))
756747
}
757748
Str(_) => signal!(e, NegateOnString),

trunk/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+
}

trunk/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))

trunk/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
}

0 commit comments

Comments
 (0)