Skip to content

Commit 3eec292

Browse files
committed
Flag as unsafe several macros in the codebase for now.
1 parent 7206642 commit 3eec292

File tree

10 files changed

+10
-0
lines changed

10 files changed

+10
-0
lines changed

src/librustc/hir/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ use std::fmt;
5555
/// of `Vec` to avoid keeping extra capacity.
5656
pub type HirVec<T> = P<[T]>;
5757

58+
#[rustc_unsafe_macro]
5859
macro_rules! hir_vec {
5960
($elem:expr; $n:expr) => (
6061
$crate::hir::HirVec::from(vec![$elem; $n])

src/librustc/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#![feature(libc)]
3434
#![feature(nonzero)]
3535
#![feature(quote)]
36+
#![feature(rustc_attrs)]
3637
#![feature(rustc_diagnostic_macros)]
3738
#![feature(rustc_private)]
3839
#![feature(slice_patterns)]

src/librustc/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[rustc_unsafe_macro]
1112
macro_rules! enum_from_u32 {
1213
($(#[$attr:meta])* pub enum $name:ident {
1314
$($variant:ident = $e:expr,)*

src/librustc_metadata/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#![feature(box_patterns)]
2121
#![feature(enumset)]
2222
#![feature(quote)]
23+
#![feature(rustc_attrs)]
2324
#![feature(rustc_diagnostic_macros)]
2425
#![feature(rustc_private)]
2526
#![feature(staged_api)]

src/librustc_metadata/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[rustc_unsafe_macro]
1112
macro_rules! enum_from_u32 {
1213
($(#[$attr:meta])* pub enum $name:ident {
1314
$($variant:ident = $e:expr,)*

src/librustc_mir/build/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ impl BlockAndExtension for BasicBlock {
139139

140140
/// Update a block pointer and return the value.
141141
/// Use it like `let x = unpack!(block = self.foo(block, foo))`.
142+
#[rustc_unsafe_macro]
142143
macro_rules! unpack {
143144
($x:ident = $c:expr) => {
144145
{

src/librustc_mir/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2222

2323
#![feature(associated_consts)]
2424
#![feature(box_patterns)]
25+
#![feature(rustc_attrs)]
2526
#![feature(rustc_diagnostic_macros)]
2627
#![feature(rustc_private)]
2728
#![feature(staged_api)]

src/libsyntax/feature_gate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ macro_rules! setter {
4848
}}
4949
}
5050

51+
#[rustc_unsafe_macro]
5152
macro_rules! declare_features {
5253
($((active, $feature: ident, $ver: expr, $issue: expr)),+) => {
5354
/// Represents active features that are currently being implemented or

src/libsyntax/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#![feature(const_fn)]
2929
#![feature(filling_drop)]
3030
#![feature(libc)]
31+
#![feature(rustc_attrs)]
3132
#![feature(rustc_private)]
3233
#![feature(staged_api)]
3334
#![feature(str_escape)]

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ macro_rules! maybe_whole_expr {
148148
}
149149

150150
/// As maybe_whole_expr, but for things other than expressions
151+
#[rustc_unsafe_macro]
151152
macro_rules! maybe_whole {
152153
($p:expr, $constructor:ident) => (
153154
{

0 commit comments

Comments
 (0)