Skip to content

Commit e3e24a8

Browse files
author
Jakub Wieczorek
committed
---
yaml --- r: 128887 b: refs/heads/try c: 9b0f89d h: refs/heads/master i: 128885: d158d51 128883: 1091523 128879: 017076f v: v3
1 parent 37edebf commit e3e24a8

File tree

12 files changed

+49
-86
lines changed

12 files changed

+49
-86
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 07d86b46a949a94223da714e35b343243e4ecce4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a86d9ad15e339ab343a12513f9c90556f677b9ca
5-
refs/heads/try: 3f57c8988dfd2eba8fb751fe72dde503a6ebf2c6
5+
refs/heads/try: 9b0f89d342de06b035c108186f0243a3bdc7528b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/etc/emacs/rust-mode.el

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@
170170
(defconst rust-mode-keywords
171171
'("as"
172172
"box" "break"
173-
"const" "continue" "crate"
173+
"continue" "crate"
174174
"do"
175175
"else" "enum" "extern"
176176
"false" "fn" "for"
@@ -182,8 +182,7 @@
182182
"self" "static" "struct" "super"
183183
"true" "trait" "type"
184184
"unsafe" "use"
185-
"virtual"
186-
"where" "while"))
185+
"while"))
187186

188187
(defconst rust-special-types
189188
'("u8" "i8"

branches/try/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
<keyword>trait</keyword>
7272
<keyword>unsafe</keyword>
7373
<keyword>use</keyword>
74-
<keyword>virtual</keyword>
75-
<keyword>where</keyword>
7674
<keyword>while</keyword>
7775
</context>
7876

branches/try/src/etc/kate/rust.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<item> as </item>
2020
<item> break </item>
2121
<item> box </item>
22-
<item> const </item>
2322
<item> continue </item>
2423
<item> crate </item>
2524
<item> do </item>
@@ -45,8 +44,6 @@
4544
<item> trait </item>
4645
<item> unsafe </item>
4746
<item> use </item>
48-
<item> virtual </item>
49-
<item> where </item>
5047
<item> while </item>
5148
</list>
5249
<list name="traits">

branches/try/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ syn keyword rustKeyword fn nextgroup=rustFuncName skipwhite skipempty
2626
syn keyword rustKeyword for in if impl let
2727
syn keyword rustKeyword loop once proc pub
2828
syn keyword rustKeyword return super
29-
syn keyword rustKeyword unsafe virtual where while
29+
syn keyword rustKeyword unsafe virtual while
3030
syn keyword rustKeyword use nextgroup=rustModPath,rustModPathInUse skipwhite skipempty
3131
" FIXME: Scoped impl's name is also fallen in this category
3232
syn keyword rustKeyword mod trait struct enum type nextgroup=rustIdentifier skipwhite skipempty

branches/try/src/libcollections/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ impl BitvSet {
12711271
/// let a = BitvSet::from_bitv(bitv::from_bytes([0b01101000]));
12721272
/// let b = BitvSet::from_bitv(bitv::from_bytes([0b10100000]));
12731273
///
1274-
/// // Print 1, 4 in arbitrary order
1274+
/// // Print 2, 4 in arbitrary order
12751275
/// for x in a.difference(&b) {
12761276
/// println!("{}", x);
12771277
/// }

branches/try/src/libcollections/btree.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
// btree.rs
1212
//
1313

14-
// NB. this is not deprecated for removal, just deprecating the
15-
// current implementation. If the major pain-points are addressed
16-
// (overuse of by-value self and .clone), this can be removed.
17-
#![deprecated = "the current implementation is extremely inefficient, \
18-
prefer a HashMap, TreeMap or TrieMap"]
19-
#![allow(deprecated)]
20-
2114
//! Starting implementation of a btree for rust.
2215
//! Structure inspired by github user davidhalperin's gist.
2316

branches/try/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/try/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/try/src/librustc/middle/typeck/check/_match.rs

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

358-
pub fn check_struct_pat(pcx: &pat_ctxt, _pat_id: ast::NodeId, span: Span,
359-
_expected: ty::t, _path: &ast::Path,
358+
pub fn check_struct_pat(pcx: &pat_ctxt, span: Span,
360359
fields: &[ast::FieldPat], etc: bool,
361360
struct_id: ast::DefId,
362361
substitutions: &subst::Substs) {
@@ -529,8 +528,7 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
529528
},
530529
}
531530

532-
check_struct_pat(pcx, pat.id, pat.span, expected, path,
533-
fields.as_slice(), etc, cid, substs);
531+
check_struct_pat(pcx, pat.span, fields.as_slice(), etc, cid, substs);
534532
}
535533
ty::ty_enum(eid, ref substs) => {
536534
check_struct_like_enum_variant_pat(pcx,
@@ -557,15 +555,11 @@ pub fn check_pat(pcx: &pat_ctxt, pat: &ast::Pat, expected: ty::t) {
557555
None);
558556
match tcx.def_map.borrow().find(&pat.id) {
559557
Some(def) => {
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());
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);
569563
}
570564
None => {
571565
tcx.sess.span_bug(pat.span,
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::raw::Slice;
12+
13+
fn main() {
14+
let Slice { data: data, len: len } = "foo";
15+
//~^ ERROR mismatched types: expected `&'static str` but found a structure pattern
16+
}
17+
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::raw::Slice;
12+
13+
fn main() {
14+
match () {
15+
Slice { data: data, len: len } => (),
16+
//~^ ERROR mismatched types: expected `()` but found a structure pattern
17+
_ => unreachable!()
18+
}
19+
}

0 commit comments

Comments
 (0)