Skip to content

Commit 7fa08c4

Browse files
committed
---
yaml --- r: 275995 b: refs/heads/master c: c31e2e7 h: refs/heads/master i: 275993: 6f3f61d 275991: 884c337
1 parent d2457b9 commit 7fa08c4

File tree

143 files changed

+1703
-3276
lines changed

Some content is hidden

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

143 files changed

+1703
-3276
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: ea6b3ddee9663e27221f366671261b21618394a0
2+
refs/heads/master: c31e2e77ed955faafffe7b22859f045cc1e5deec
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
44
refs/heads/try: 49312a405e14a449b98fe0056b12a40ac128be4a
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir
120120
log syntax serialize rustc_llvm rustc_platform_intrinsics \
121121
rustc_const_math rustc_const_eval rustc_incremental
122122
DEPS_rustc_incremental := rbml rustc serialize rustc_data_structures
123-
DEPS_rustc_save_analysis := rustc log syntax serialize
123+
DEPS_rustc_save_analysis := rustc log syntax
124124
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics rustc_const_math \
125125
rustc_const_eval
126126

trunk/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
623623
--lldb-python $$(CFG_LLDB_PYTHON) \
624624
--gdb-version="$(CFG_GDB_VERSION)" \
625625
--lldb-version="$(CFG_LLDB_VERSION)" \
626-
--android-cross-path=$(CFG_ARM_LINUX_ANDROIDEABI_NDK) \
626+
--android-cross-path=$(CFG_ANDROID_CROSS_PATH) \
627627
--adb-path=$(CFG_ADB) \
628628
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
629629
--host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \

trunk/src/doc/book/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ enter the following commands:
412412

413413
```bash
414414
$ mkdir src
415-
$ mv main.rs src/main.rs # or 'move main.rs src/main.rs' on Windows
415+
$ mv main.rs src/main.rs
416416
$ rm main # or 'del main.exe' on Windows
417417
```
418418

trunk/src/doc/book/lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Lifetimes
22

3-
This is the last of three sections presenting Rust’s ownership system. This is one of
4-
Rust’s most distinct and compelling features, with which Rust developers should
3+
This guide is three of three presenting Rust’s ownership system. This is one of
4+
Rust’s most unique and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
66
memory safety. There are a few distinct concepts, each with its own chapter:
77

trunk/src/doc/book/ownership.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Ownership
22

3-
This is the first of three sections presenting Rust’s ownership system. This is one of
4-
Rust’s most distinct and compelling features, with which Rust developers should
3+
This guide is one of three presenting Rust’s ownership system. This is one of
4+
Rust’s most unique and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
66
memory safety. There are a few distinct concepts, each with its own
77
chapter:

trunk/src/doc/book/references-and-borrowing.md

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% References and Borrowing
22

3-
This is the second of three sections presenting Rust’s ownership system. This is one of
4-
Rust’s most distinct and compelling features, with which Rust developers should
3+
This guide is two of three presenting Rust’s ownership system. This is one of
4+
Rust’s most unique and compelling features, with which Rust developers should
55
become quite acquainted. Ownership is how Rust achieves its largest goal,
66
memory safety. There are a few distinct concepts, each with its own
77
chapter:
@@ -77,32 +77,6 @@ let answer = foo(&v1, &v2);
7777
// we can use v1 and v2 here!
7878
```
7979

80-
A more concrete example:
81-
82-
```rust
83-
fn main() {
84-
// Don't worry if you don't understand how `fold` works, the point here is that an immutable reference is borrowed.
85-
fn sum_vec(v: &Vec<i32>) -> i32 {
86-
return v.iter().fold(0, |a, &b| a + b);
87-
}
88-
// Borrow two vectors and and sum them.
89-
// This kind of borrowing does not allow mutation to the borrowed.
90-
fn foo(v1: &Vec<i32>, v2: &Vec<i32>) -> i32 {
91-
// do stuff with v1 and v2
92-
let s1 = sum_vec(v1);
93-
let s2 = sum_vec(v2);
94-
// return the answer
95-
s1 + s2
96-
}
97-
98-
let v1 = vec![1, 2, 3];
99-
let v2 = vec![4, 5, 6];
100-
101-
let answer = foo(&v1, &v2);
102-
println!("{}", answer);
103-
}
104-
```
105-
10680
Instead of taking `Vec<i32>`s as our arguments, we take a reference:
10781
`&Vec<i32>`. And instead of passing `v1` and `v2` directly, we pass `&v1` and
10882
`&v2`. We call the `&T` type a ‘reference’, and rather than owning the resource,

trunk/src/libcore/clone.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,6 @@ pub trait Clone : Sized {
7575
}
7676
}
7777

78-
// FIXME(aburka): this method is used solely by #[derive] to
79-
// assert that every component of a type implements Clone.
80-
//
81-
// This should never be called by user code.
82-
#[doc(hidden)]
83-
#[inline(always)]
84-
#[unstable(feature = "derive_clone_copy",
85-
reason = "deriving hack, should not be public",
86-
issue = "0")]
87-
pub fn assert_receiver_is_clone<T: Clone + ?Sized>(_: &T) {}
88-
8978
#[stable(feature = "rust1", since = "1.0.0")]
9079
impl<'a, T: ?Sized> Clone for &'a T {
9180
/// Returns a shallow copy of the reference.

trunk/src/libcore/ptr.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,6 @@ impl<T: ?Sized> *mut T {
459459
/// ```
460460
/// let mut s = [1, 2, 3];
461461
/// let ptr: *mut u32 = s.as_mut_ptr();
462-
/// let first_value = unsafe { ptr.as_mut().unwrap() };
463-
/// *first_value = 4;
464-
/// println!("{:?}", s); // It'll print: "[4, 2, 3]".
465462
/// ```
466463
#[stable(feature = "ptr_as_ref", since = "1.9.0")]
467464
#[inline]

trunk/src/librustc/infer/error_reporting.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl<'tcx> TyCtxt<'tcx> {
157157
"scope of call-site for function"
158158
}
159159
region::CodeExtentData::ParameterScope { .. } => {
160-
"scope of function body"
160+
"scope of parameters for function"
161161
}
162162
region::CodeExtentData::DestructionScope(_) => {
163163
new_string = format!("destruction scope surrounding {}", tag);

trunk/src/librustc/infer/mod.rs

Lines changed: 5 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use ty::fold::TypeFoldable;
3535
use ty::relate::{Relate, RelateResult, TypeRelation};
3636
use traits::{self, PredicateObligations, ProjectionMode};
3737
use rustc_data_structures::unify::{self, UnificationTable};
38-
use std::cell::{Cell, RefCell, Ref};
38+
use std::cell::{RefCell, Ref};
3939
use std::fmt;
4040
use syntax::ast;
4141
use syntax::codemap;
@@ -110,25 +110,6 @@ pub struct InferCtxt<'a, 'tcx: 'a> {
110110
// documentation for `ProjectionMode`.
111111
projection_mode: ProjectionMode,
112112

113-
// When an error occurs, we want to avoid reporting "derived"
114-
// errors that are due to this original failure. Normally, we
115-
// handle this with the `err_count_on_creation` count, which
116-
// basically just tracks how many errors were reported when we
117-
// started type-checking a fn and checks to see if any new errors
118-
// have been reported since then. Not great, but it works.
119-
//
120-
// However, when errors originated in other passes -- notably
121-
// resolve -- this heuristic breaks down. Therefore, we have this
122-
// auxiliary flag that one can set whenever one creates a
123-
// type-error that is due to an error in a prior pass.
124-
//
125-
// Don't read this flag directly, call `is_tainted_by_errors()`
126-
// and `set_tainted_by_errors()`.
127-
tainted_by_errors_flag: Cell<bool>,
128-
129-
// Track how many errors were reported when this infcx is created.
130-
// If the number of errors increases, that's also a sign (line
131-
// `tained_by_errors`) to avoid reporting certain kinds of errors.
132113
err_count_on_creation: usize,
133114
}
134115

@@ -398,7 +379,6 @@ pub fn new_infer_ctxt<'a, 'tcx>(tcx: &'a TyCtxt<'tcx>,
398379
reported_trait_errors: RefCell::new(FnvHashSet()),
399380
normalize: false,
400381
projection_mode: projection_mode,
401-
tainted_by_errors_flag: Cell::new(false),
402382
err_count_on_creation: tcx.sess.err_count()
403383
}
404384
}
@@ -1148,36 +1128,15 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11481128
.map(|method| resolve_ty(method.ty)))
11491129
}
11501130

1151-
/// True if errors have been reported since this infcx was
1152-
/// created. This is sometimes used as a heuristic to skip
1153-
/// reporting errors that often occur as a result of earlier
1154-
/// errors, but where it's hard to be 100% sure (e.g., unresolved
1155-
/// inference variables, regionck errors).
1156-
pub fn is_tainted_by_errors(&self) -> bool {
1157-
debug!("is_tainted_by_errors(err_count={}, err_count_on_creation={}, \
1158-
tainted_by_errors_flag={})",
1159-
self.tcx.sess.err_count(),
1160-
self.err_count_on_creation,
1161-
self.tainted_by_errors_flag.get());
1162-
1163-
if self.tcx.sess.err_count() > self.err_count_on_creation {
1164-
return true; // errors reported since this infcx was made
1165-
}
1166-
self.tainted_by_errors_flag.get()
1167-
}
1168-
1169-
/// Set the "tainted by errors" flag to true. We call this when we
1170-
/// observe an error from a prior pass.
1171-
pub fn set_tainted_by_errors(&self) {
1172-
debug!("set_tainted_by_errors()");
1173-
self.tainted_by_errors_flag.set(true)
1131+
pub fn errors_since_creation(&self) -> bool {
1132+
self.tcx.sess.err_count() - self.err_count_on_creation != 0
11741133
}
11751134

11761135
pub fn node_type(&self, id: ast::NodeId) -> Ty<'tcx> {
11771136
match self.tables.borrow().node_types.get(&id) {
11781137
Some(&t) => t,
11791138
// FIXME
1180-
None if self.is_tainted_by_errors() =>
1139+
None if self.errors_since_creation() =>
11811140
self.tcx.types.err,
11821141
None => {
11831142
bug!("no type for node {}: {} in fcx",
@@ -1199,7 +1158,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
11991158
free_regions: &FreeRegionMap,
12001159
subject_node_id: ast::NodeId) {
12011160
let errors = self.region_vars.resolve_regions(free_regions, subject_node_id);
1202-
if !self.is_tainted_by_errors() {
1161+
if !self.errors_since_creation() {
12031162
// As a heuristic, just skip reporting region errors
12041163
// altogether if other errors have been reported while
12051164
// this infcx was in use. This is totally hokey but

trunk/src/librustc/infer/sub.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ impl<'a, 'tcx> TypeRelation<'a, 'tcx> for Sub<'a, 'tcx> {
9191
}
9292

9393
(&ty::TyError, _) | (_, &ty::TyError) => {
94-
infcx.set_tainted_by_errors();
9594
Ok(self.tcx().types.err)
9695
}
9796

trunk/src/librustc/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl RegionMaps {
389389
// but this isn't the only place
390390
}
391391
let idx = CodeExtent(self.code_extents.borrow().len() as u32);
392-
debug!("CodeExtent({}) = {:?} [parent={}]", idx.0, e, parent.0);
392+
info!("CodeExtent({}) = {:?} [parent={}]", idx.0, e, parent.0);
393393
self.code_extents.borrow_mut().push(e);
394394
self.scope_map.borrow_mut().push(parent);
395395
*v.insert(idx)

trunk/src/librustc/session/config.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -618,9 +618,7 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
618618
ls: bool = (false, parse_bool,
619619
"list the symbols defined by a library crate"),
620620
save_analysis: bool = (false, parse_bool,
621-
"write syntax and type analysis (in JSON format) information in addition to normal output"),
622-
save_analysis_csv: bool = (false, parse_bool,
623-
"write syntax and type analysis (in CSV format) information in addition to normal output"),
621+
"write syntax and type analysis information in addition to normal output"),
624622
print_move_fragments: bool = (false, parse_bool,
625623
"print out move-fragment data for every fn"),
626624
flowgraph_print_loans: bool = (false, parse_bool,

trunk/src/librustc/traits/error_reporting.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -624,12 +624,6 @@ pub fn maybe_report_ambiguity<'a, 'tcx>(infcx: &InferCtxt<'a, 'tcx>,
624624
predicate,
625625
obligation);
626626

627-
// Ambiguity errors are often caused as fallout from earlier
628-
// errors. So just ignore them if this infcx is tainted.
629-
if infcx.is_tainted_by_errors() {
630-
return;
631-
}
632-
633627
match predicate {
634628
ty::Predicate::Trait(ref data) => {
635629
let trait_ref = data.to_poly_trait_ref();

trunk/src/librustc/traits/fulfill.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,12 +542,12 @@ fn process_predicate1<'a,'tcx>(selcx: &mut SelectionContext<'a,'tcx>,
542542
let trait_obligation = obligation.with(data.clone());
543543
match selcx.select(&trait_obligation) {
544544
Ok(Some(vtable)) => {
545-
debug!("selecting trait `{:?}` at depth {} yielded Ok(Some)",
545+
info!("selecting trait `{:?}` at depth {} yielded Ok(Some)",
546546
data, obligation.recursion_depth);
547547
Ok(Some(vtable.nested_obligations()))
548548
}
549549
Ok(None) => {
550-
debug!("selecting trait `{:?}` at depth {} yielded Ok(None)",
550+
info!("selecting trait `{:?}` at depth {} yielded Ok(None)",
551551
data, obligation.recursion_depth);
552552

553553
// This is a bit subtle: for the most part, the
@@ -781,6 +781,8 @@ impl<'tcx> GlobalFulfilledPredicates<'tcx> {
781781
self.dep_graph.read(data.dep_node());
782782
debug!("check_duplicate: global predicate `{:?}` already proved elsewhere", data);
783783

784+
info!("check_duplicate_trait hit: `{:?}`", data);
785+
784786
true
785787
} else {
786788
false
@@ -796,6 +798,7 @@ impl<'tcx> GlobalFulfilledPredicates<'tcx> {
796798
if data.is_global() {
797799
if self.set.insert(data.clone()) {
798800
debug!("add_if_global: global predicate `{:?}` added", data);
801+
info!("check_duplicate_trait entry: `{:?}`", data);
799802
}
800803
}
801804
}

trunk/src/librustc_back/target/arm_linux_androideabi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use target::Target;
1212

1313
pub fn target() -> Target {
1414
let mut base = super::android_base::opts();
15-
base.features = "+v7,+vfp3,+d16".to_string();
15+
base.features = "+v7".to_string();
1616

1717
Target {
1818
llvm_target: "arm-linux-androideabi".to_string(),

trunk/src/librustc_const_eval/eval.rs

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -562,51 +562,44 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
562562
let result = match e.node {
563563
hir::ExprUnary(hir::UnNeg, ref inner) => {
564564
// unary neg literals already got their sign during creation
565-
match inner.node {
566-
hir::ExprLit(ref lit) => {
567-
use syntax::ast::*;
568-
use syntax::ast::LitIntType::*;
569-
const I8_OVERFLOW: u64 = ::std::i8::MAX as u64 + 1;
570-
const I16_OVERFLOW: u64 = ::std::i16::MAX as u64 + 1;
571-
const I32_OVERFLOW: u64 = ::std::i32::MAX as u64 + 1;
572-
const I64_OVERFLOW: u64 = ::std::i64::MAX as u64 + 1;
573-
match (&lit.node, ety.map(|t| &t.sty)) {
574-
(&LitKind::Int(I8_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I8))) |
575-
(&LitKind::Int(I8_OVERFLOW, Signed(IntTy::I8)), _) => {
576-
return Ok(Integral(I8(::std::i8::MIN)))
577-
},
578-
(&LitKind::Int(I16_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I16))) |
579-
(&LitKind::Int(I16_OVERFLOW, Signed(IntTy::I16)), _) => {
580-
return Ok(Integral(I16(::std::i16::MIN)))
581-
},
582-
(&LitKind::Int(I32_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I32))) |
583-
(&LitKind::Int(I32_OVERFLOW, Signed(IntTy::I32)), _) => {
584-
return Ok(Integral(I32(::std::i32::MIN)))
585-
},
586-
(&LitKind::Int(I64_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I64))) |
587-
(&LitKind::Int(I64_OVERFLOW, Signed(IntTy::I64)), _) => {
588-
return Ok(Integral(I64(::std::i64::MIN)))
589-
},
590-
(&LitKind::Int(n, Unsuffixed), Some(&ty::TyInt(IntTy::Is))) |
591-
(&LitKind::Int(n, Signed(IntTy::Is)), _) => {
592-
match tcx.sess.target.int_type {
593-
IntTy::I32 => if n == I32_OVERFLOW {
594-
return Ok(Integral(Isize(Is32(::std::i32::MIN))));
595-
},
596-
IntTy::I64 => if n == I64_OVERFLOW {
597-
return Ok(Integral(Isize(Is64(::std::i64::MIN))));
598-
},
599-
_ => bug!(),
600-
}
601-
},
602-
_ => {},
603-
}
604-
},
605-
hir::ExprUnary(hir::UnNeg, ref inner) => {
606-
// skip `--$expr`
607-
return eval_const_expr_partial(tcx, inner, ty_hint, fn_args);
608-
},
609-
_ => {},
565+
if let hir::ExprLit(ref lit) = inner.node {
566+
use syntax::ast::*;
567+
use syntax::ast::LitIntType::*;
568+
const I8_OVERFLOW: u64 = ::std::i8::MAX as u64 + 1;
569+
const I16_OVERFLOW: u64 = ::std::i16::MAX as u64 + 1;
570+
const I32_OVERFLOW: u64 = ::std::i32::MAX as u64 + 1;
571+
const I64_OVERFLOW: u64 = ::std::i64::MAX as u64 + 1;
572+
match (&lit.node, ety.map(|t| &t.sty)) {
573+
(&LitKind::Int(I8_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I8))) |
574+
(&LitKind::Int(I8_OVERFLOW, Signed(IntTy::I8)), _) => {
575+
return Ok(Integral(I8(::std::i8::MIN)))
576+
},
577+
(&LitKind::Int(I16_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I16))) |
578+
(&LitKind::Int(I16_OVERFLOW, Signed(IntTy::I16)), _) => {
579+
return Ok(Integral(I16(::std::i16::MIN)))
580+
},
581+
(&LitKind::Int(I32_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I32))) |
582+
(&LitKind::Int(I32_OVERFLOW, Signed(IntTy::I32)), _) => {
583+
return Ok(Integral(I32(::std::i32::MIN)))
584+
},
585+
(&LitKind::Int(I64_OVERFLOW, Unsuffixed), Some(&ty::TyInt(IntTy::I64))) |
586+
(&LitKind::Int(I64_OVERFLOW, Signed(IntTy::I64)), _) => {
587+
return Ok(Integral(I64(::std::i64::MIN)))
588+
},
589+
(&LitKind::Int(n, Unsuffixed), Some(&ty::TyInt(IntTy::Is))) |
590+
(&LitKind::Int(n, Signed(IntTy::Is)), _) => {
591+
match tcx.sess.target.int_type {
592+
IntTy::I32 => if n == I32_OVERFLOW {
593+
return Ok(Integral(Isize(Is32(::std::i32::MIN))));
594+
},
595+
IntTy::I64 => if n == I64_OVERFLOW {
596+
return Ok(Integral(Isize(Is64(::std::i64::MIN))));
597+
},
598+
_ => bug!(),
599+
}
600+
},
601+
_ => {},
602+
}
610603
}
611604
match eval_const_expr_partial(tcx, &inner, ty_hint, fn_args)? {
612605
Float(f) => Float(-f),

0 commit comments

Comments
 (0)