Skip to content

Commit 8e181b7

Browse files
committed
---
yaml --- r: 55163 b: refs/heads/snap-stage3 c: 7fed480 h: refs/heads/master i: 55161: 1ccc863 55159: ef4cb88 v: v3
1 parent 2c47c14 commit 8e181b7

File tree

8 files changed

+35
-5
lines changed

8 files changed

+35
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 84e97d5596fdc665036646f715f4ffd030d9031f
4+
refs/heads/snap-stage3: 7fed4800733805156f0d157e45b01de405c4b48e
55
refs/heads/try: 8eb2bab100b42f0ba751552d8eff00eb2134c55a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/char.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
//! Utilities for manipulating the char type
1212
13+
#[cfg(notest)]
1314
use cmp::Ord;
1415
use option::{None, Option, Some};
1516
use str;

branches/snap-stage3/src/libcore/vec.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ pub fn uniq_len<T>(v: &const ~[T]) -> uint {
137137
}
138138

139139
/**
140-
* Creates and initializes an owned vector.
140+
* Creates and initializes an immutable vector.
141141
*
142-
* Creates an owned vector of size `n_elts` and initializes the elements
142+
* Creates an immutable vector of size `n_elts` and initializes the elements
143143
* to the value returned by the function `op`.
144144
*/
145145
pub fn from_fn<T>(n_elts: uint, op: old_iter::InitOp<T>) -> ~[T] {
@@ -159,9 +159,9 @@ pub fn from_fn<T>(n_elts: uint, op: old_iter::InitOp<T>) -> ~[T] {
159159
}
160160

161161
/**
162-
* Creates and initializes an owned vector.
162+
* Creates and initializes an immutable vector.
163163
*
164-
* Creates an owned vector of size `n_elts` and initializes the elements
164+
* Creates an immutable vector of size `n_elts` and initializes the elements
165165
* to the value `t`.
166166
*/
167167
pub fn from_elem<T:Copy>(n_elts: uint, t: T) -> ~[T] {

branches/snap-stage3/src/librustc/middle/check_match.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,8 @@ pub fn specialize(cx: @MatchCheckCtxt,
551551
Some(vec::append(args, vec::from_slice(r.tail())))
552552
}
553553
def_variant(_, _) => None,
554+
555+
def_fn(*) |
554556
def_struct(*) => {
555557
// FIXME #4731: Is this right? --pcw
556558
let new_args;

branches/snap-stage3/src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@ pub impl mem_categorization_ctxt {
912912
self.cat_pattern(subcmt, *subpat, op);
913913
}
914914
}
915+
Some(&ast::def_fn(*)) |
915916
Some(&ast::def_struct(*)) => {
916917
for subpats.each |subpat| {
917918
let cmt_field = self.cat_anon_struct_field(*subpat,

branches/snap-stage3/src/librustc/middle/resolve.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4277,6 +4277,7 @@ pub impl Resolver {
42774277
pat_enum(path, _) => {
42784278
// This must be an enum variant, struct or const.
42794279
match self.resolve_path(path, ValueNS, false, visitor) {
4280+
Some(def @ def_fn(*)) |
42804281
Some(def @ def_variant(*)) |
42814282
Some(def @ def_struct(*)) |
42824283
Some(def @ def_const(*)) => {

branches/snap-stage3/src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ pub fn variant_opt(bcx: block, pat_id: ast::node_id)
291291
}
292292
::core::util::unreachable();
293293
}
294+
ast::def_fn(*) |
294295
ast::def_struct(_) => {
295296
return lit(UnitLikeStructLit(pat_id));
296297
}
@@ -818,6 +819,7 @@ pub fn get_options(bcx: block, m: &[@Match], col: uint) -> ~[Opt] {
818819
// This could be one of: a tuple-like enum variant, a
819820
// struct-like enum variant, or a struct.
820821
match ccx.tcx.def_map.find(&cur.id) {
822+
Some(&ast::def_fn(*)) |
821823
Some(&ast::def_variant(*)) => {
822824
add_to_set(ccx.tcx, &mut found,
823825
variant_opt(bcx, cur.id));
@@ -1011,6 +1013,7 @@ pub fn any_tuple_struct_pat(bcx: block, m: &[@Match], col: uint) -> bool {
10111013
match pat.node {
10121014
ast::pat_enum(_, Some(_)) => {
10131015
match bcx.tcx().def_map.find(&pat.id) {
1016+
Some(&ast::def_fn(*)) |
10141017
Some(&ast::def_struct(*)) => true,
10151018
_ => false
10161019
}
@@ -1780,6 +1783,7 @@ pub fn bind_irrefutable_pat(bcx: block,
17801783
}
17811784
}
17821785
}
1786+
Some(&ast::def_fn(*)) |
17831787
Some(&ast::def_struct(*)) => {
17841788
match *sub_pats {
17851789
None => {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2013 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+
// xfail-fast
12+
// aux-build:newtype_struct_xc.rs
13+
14+
extern mod newtype_struct_xc;
15+
16+
fn main() {
17+
let x = newtype_struct_xc::Au(21);
18+
match x {
19+
newtype_struct_xc::Au(n) => assert_eq!(n, 21)
20+
}
21+
}

0 commit comments

Comments
 (0)