File tree Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Expand file tree Collapse file tree 3 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -574,4 +574,5 @@ mod std {
574
574
mod collections {
575
575
pub use hash; // deriving(Hsah)
576
576
pub use string; // format!()
577
+ pub use vec; // vec!()
577
578
}
Original file line number Diff line number Diff line change 11
11
#![ macro_escape]
12
12
13
13
/// Creates a `std::vec::Vec` containing the arguments.
14
+ #[ macro_export]
14
15
macro_rules! vec(
15
16
( $( $e: expr) ,* ) => ( {
16
17
// leading _ to allow empty construction without a warning.
17
- let mut _temp = :: vec:: Vec :: new( ) ;
18
+ let mut _temp = :: collections :: vec:: Vec :: new( ) ;
18
19
$( _temp. push( $e) ; ) *
19
20
_temp
20
21
} ) ;
Original file line number Diff line number Diff line change
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
+ #![ feature( phase) ]
12
+ #![ no_std]
13
+
14
+ #[ phase( plugin, link) ]
15
+ extern crate core;
16
+
17
+ #[ phase( plugin, link) ]
18
+ extern crate collections;
19
+
20
+ extern crate native;
21
+
22
+ use core:: option:: Some ;
23
+ use collections:: vec:: Vec ;
24
+ use collections:: MutableSeq ;
25
+
26
+ // Issue #16806
27
+
28
+ fn main ( ) {
29
+ let x: Vec < u8 > = vec ! ( 0 , 1 , 2 ) ;
30
+ match x. last ( ) {
31
+ Some ( & 2 ) => ( ) ,
32
+ _ => fail ! ( ) ,
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments