diff options
| author | bors <bors@rust-lang.org> | 2016-06-16 06:37:18 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-06-16 06:37:18 -0700 |
| commit | 7aba683c76f3db78afa0c10a7b0ecfb02a3e8b63 (patch) | |
| tree | 9ca24d1ae63f36e923a35c92e6e5937fdf9a7c19 /src/libsyntax/util | |
| parent | 6edea2cfda2818f0a76f4bac2d18a30feb54c137 (diff) | |
| parent | 236b67af5197fc76206d402cab99cd0af2bff090 (diff) | |
| download | rust-7aba683c76f3db78afa0c10a7b0ecfb02a3e8b63.tar.gz rust-7aba683c76f3db78afa0c10a7b0ecfb02a3e8b63.zip | |
Auto merge of #34239 - jseyfried:fix_macro_use_scope_regression, r=nrc
Revert a change in the scope of macros imported from crates to fix a regression Fixes #34212. The regression was caused by #34032, which changed the scope of macros imported from extern crates to match the scope of macros imported from modules. r? @nrc
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/small_vector.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index 8b07b21c578..9548805c1f8 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -29,6 +29,16 @@ enum SmallVectorRepr<T> { Many(Vec<T>), } +impl<T> Into<Vec<T>> for SmallVector<T> { + fn into(self) -> Vec<T> { + match self.repr { + Zero => Vec::new(), + One(t) => vec![t], + Many(vec) => vec, + } + } +} + impl<T> FromIterator<T> for SmallVector<T> { fn from_iter<I: IntoIterator<Item=T>>(iter: I) -> SmallVector<T> { let mut v = SmallVector::zero(); |
