mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
expand vec![] to Vec::new()
This commit is contained in:
parent
75ff3110ac
commit
4d8273dea5
@ -36,6 +36,9 @@
|
||||
#[stable(feature = "rust1", since = "1.0.0")]
|
||||
#[allow_internal_unstable(box_syntax)]
|
||||
macro_rules! vec {
|
||||
() => (
|
||||
$crate::vec::Vec::new()
|
||||
);
|
||||
($elem:expr; $n:expr) => (
|
||||
$crate::vec::from_elem($elem, $n)
|
||||
);
|
||||
@ -51,6 +54,9 @@ macro_rules! vec {
|
||||
// NB see the slice::hack module in slice.rs for more information
|
||||
#[cfg(test)]
|
||||
macro_rules! vec {
|
||||
() => (
|
||||
$crate::vec::Vec::new()
|
||||
);
|
||||
($elem:expr; $n:expr) => (
|
||||
$crate::vec::from_elem($elem, $n)
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user