Skip to content

Commit d33d1af

Browse files
committed
---
yaml --- r: 128439 b: refs/heads/auto c: 61b9036 h: refs/heads/master i: 128437: 4839d7a 128435: df0231c 128431: 16e101d v: v3
1 parent e0df3ba commit d33d1af

File tree

8 files changed

+35
-114
lines changed

8 files changed

+35
-114
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: 776c17f476c4be92f6cfe4dab528886973ea8c03
16+
refs/heads/auto: 61b9036bb8612d6330f9cb6bb3b52219bebe1802
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/doc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for the 'std' and 'extra' libraries.
1919
To generate HTML documentation from one source file/crate, do something like:
2020

2121
~~~~
22-
rustdoc --output-dir html-doc/ --output-format html ../src/libstd/path.rs
22+
rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
2323
~~~~
2424

2525
(This, of course, requires a working build of the `rustdoc` tool.)

branches/auto/src/libnum/bigint.rs

Lines changed: 1 addition & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
use Integer;
6060
use rand::Rng;
6161

62-
use std::{cmp, fmt, hash};
62+
use std::{cmp, fmt};
6363
use std::default::Default;
6464
use std::from_str::FromStr;
6565
use std::num::CheckedDiv;
@@ -150,22 +150,6 @@ impl Default for BigUint {
150150
fn default() -> BigUint { Zero::zero() }
151151
}
152152

153-
impl<S: hash::Writer> hash::Hash<S> for BigUint {
154-
fn hash(&self, state: &mut S) {
155-
// hash 0 in case it's all 0's
156-
0u32.hash(state);
157-
158-
let mut found_first_value = false;
159-
for elem in self.data.iter().rev() {
160-
// don't hash any leading 0's, they shouldn't affect the hash
161-
if found_first_value || *elem != 0 {
162-
found_first_value = true;
163-
elem.hash(state);
164-
}
165-
}
166-
}
167-
}
168-
169153
impl fmt::Show for BigUint {
170154
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
171155
write!(f, "{}", self.to_str_radix(10))
@@ -897,13 +881,6 @@ impl fmt::Show for BigInt {
897881
}
898882
}
899883

900-
impl<S: hash::Writer> hash::Hash<S> for BigInt {
901-
fn hash(&self, state: &mut S) {
902-
(self.sign == Plus).hash(state);
903-
self.data.hash(state);
904-
}
905-
}
906-
907884
impl FromStr for BigInt {
908885
#[inline]
909886
fn from_str(s: &str) -> Option<BigInt> {
@@ -1432,7 +1409,6 @@ mod biguint_tests {
14321409
use std::num::CheckedDiv;
14331410
use std::rand::task_rng;
14341411
use std::u64;
1435-
use std::hash::hash;
14361412

14371413
#[test]
14381414
fn test_from_slice() {
@@ -1484,19 +1460,6 @@ mod biguint_tests {
14841460
}
14851461
}
14861462

1487-
#[test]
1488-
fn test_hash() {
1489-
let a = BigUint::new(vec!());
1490-
let b = BigUint::new(vec!(0));
1491-
let c = BigUint::new(vec!(1));
1492-
let d = BigUint::new(vec!(1,0,0,0,0,0));
1493-
let e = BigUint::new(vec!(0,0,0,0,0,1));
1494-
assert!(hash(&a) == hash(&b));
1495-
assert!(hash(&b) != hash(&c));
1496-
assert!(hash(&c) == hash(&d));
1497-
assert!(hash(&d) != hash(&e));
1498-
}
1499-
15001463
#[test]
15011464
fn test_bitand() {
15021465
fn check(left: &[BigDigit],
@@ -2294,7 +2257,6 @@ mod bigint_tests {
22942257
use std::num::{ToPrimitive, FromPrimitive};
22952258
use std::rand::task_rng;
22962259
use std::u64;
2297-
use std::hash::hash;
22982260

22992261
#[test]
23002262
fn test_from_biguint() {
@@ -2352,21 +2314,6 @@ mod bigint_tests {
23522314
}
23532315
}
23542316

2355-
#[test]
2356-
fn test_hash() {
2357-
let a = BigInt::new(Zero, vec!());
2358-
let b = BigInt::new(Zero, vec!(0));
2359-
let c = BigInt::new(Plus, vec!(1));
2360-
let d = BigInt::new(Plus, vec!(1,0,0,0,0,0));
2361-
let e = BigInt::new(Plus, vec!(0,0,0,0,0,1));
2362-
let f = BigInt::new(Minus, vec!(1));
2363-
assert!(hash(&a) == hash(&b));
2364-
assert!(hash(&b) != hash(&c));
2365-
assert!(hash(&c) == hash(&d));
2366-
assert!(hash(&d) != hash(&e));
2367-
assert!(hash(&c) != hash(&f));
2368-
}
2369-
23702317
#[test]
23712318
fn test_convert_i64() {
23722319
fn check(b1: BigInt, i: i64) {

branches/auto/src/libnum/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
//! [newt]: https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method
4444
4545
#![feature(macro_rules)]
46-
#![feature(default_type_params)]
4746

4847
#![crate_name = "num"]
4948
#![experimental]

branches/auto/src/librustc/middle/trans/debuginfo.rs

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,13 @@ This file consists of three conceptual sections:
5353
3. Minor utility functions
5454
5555
56-
## Recursive Types Some kinds of types, such as structs and enums can be
57-
recursive. That means that the type definition of some type X refers to some
58-
other type which in turn (transitively) refers to X. This introduces cycles into
59-
the type referral graph. A naive algorithm doing an on-demand, depth-first
60-
traversal of this graph when describing types, can get trapped in an endless
61-
loop when it reaches such a cycle.
56+
## Recursive Types
57+
58+
Some kinds of types, such as structs and enums can be recursive. That means that
59+
the type definition of some type X refers to some other type which in turn (transitively)
60+
refers to X. This introduces cycles into the type referral graph. A naive algorithm doing
61+
an on-demand, depth-first traversal of this graph when describing types, can get trapped
62+
in an endless loop when it reaches such a cycle.
6263
6364
For example, the following simple type for a singly-linked list...
6465
@@ -96,10 +97,12 @@ traversal at the type members after the type has been registered with the cache.
9697
the future)
9798
9899
99-
## Source Locations and Line Information In addition to data type descriptions
100-
the debugging information must also allow to map machine code locations back to
101-
source code locations in order to be useful. This functionality is also handled
102-
in this module. The following functions allow to control source mappings:
100+
## Source Locations and Line Information
101+
102+
In addition to data type descriptions the debugging information must also allow
103+
to map machine code locations back to source code locations in order to be useful.
104+
This functionality is also handled in this module. The following functions allow
105+
to control source mappings:
103106
104107
+ set_source_location()
105108
+ clear_source_location()
@@ -139,10 +142,12 @@ of the prologue, however, they are ignored by LLVM's prologue detection. The
139142
source location emission is still disabled, so there is no need to do anything
140143
special with source location handling here.
141144
142-
## Unique Type Identification In order for link-time optimization to work
143-
properly, LLVM needs a unique type identifier that tells it across compilation
144-
units which types are the same as others. This type identifier is created by
145-
TypeMap::get_unique_type_id_of_type() using the following algorithm:
145+
## Unique Type Identification
146+
147+
In order for link-time optimization to work properly, LLVM needs a unique type
148+
identifier that tells it across compilation units which types are the same as
149+
others. This type identifier is created by TypeMap::get_unique_type_id_of_type()
150+
using the following algorithm:
146151
147152
(1) Primitive types have their name as ID
148153
(2) Structs, enums and traits have a multipart identifier

branches/auto/src/librustc/middle/typeck/check/_match.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ pub fn check_struct_pat_fields(pcx: &pat_ctxt,
355355
}
356356
}
357357

358-
pub fn check_struct_pat(pcx: &pat_ctxt, span: Span,
358+
pub fn check_struct_pat(pcx: &pat_ctxt, _pat_id: ast::NodeId, span: Span,
359+
_expected: ty::t, _path: &ast::Path,
359360
fields: &[ast::FieldPat], etc: bool,
360361
struct_id: ast::DefId,
361362
substitutions: &subst::Substs) {
@@ -528,7 +529,8 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
528529
},
529530
}
530531

531-
check_struct_pat(pcx, pat.span, fields.as_slice(), etc, cid, substs);
532+
check_struct_pat(pcx, pat.id, pat.span, expected, path,
533+
fields.as_slice(), etc, cid, substs);
532534
}
533535
ty::ty_enum(eid, ref substs) => {
534536
check_struct_like_enum_variant_pat(pcx,
@@ -555,11 +557,15 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
555557
None);
556558
match tcx.def_map.borrow().find(&pat.id) {
557559
Some(def) => {
558-
let item_type = ty::lookup_item_type(tcx, def.def_id());
559-
let substitutions = fcx.infcx().fresh_substs_for_type(
560-
pat.span, &item_type.generics);
561-
check_struct_pat(pcx, pat.span, fields.as_slice(),
562-
etc, def.def_id(), &substitutions);
560+
check_struct_pat(pcx,
561+
pat.id,
562+
pat.span,
563+
ty::mk_err(),
564+
path,
565+
fields.as_slice(),
566+
etc,
567+
def.def_id(),
568+
&subst::Substs::empty());
563569
}
564570
None => {
565571
tcx.sess.span_bug(pat.span,

branches/auto/src/test/compile-fail/issue-16338.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

branches/auto/src/test/compile-fail/issue-16401.rs

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)