Skip to content

Commit 785932f

Browse files
committed
Auto merge of #28980 - nrc:unsafe-macros, r=@pnkfelix
This is a [breaking change]. @brson could you do a Crater run with this PR please? Lets not land till Crater says its OK. This was discussed at https://internals.rust-lang.org/t/does-anyone-use-the-push-pop-unsafe-macros/2702
2 parents eafe106 + d399098 commit 785932f

File tree

9 files changed

+2
-251
lines changed

9 files changed

+2
-251
lines changed

src/librustc_front/lowering.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1479,8 +1479,6 @@ pub fn lower_block_check_mode(_lctx: &LoweringContext, b: &BlockCheckMode) -> hi
14791479
match *b {
14801480
DefaultBlock => hir::DefaultBlock,
14811481
UnsafeBlock(u) => hir::UnsafeBlock(lower_unsafe_source(_lctx, u)),
1482-
PushUnsafeBlock(u) => hir::PushUnsafeBlock(lower_unsafe_source(_lctx, u)),
1483-
PopUnsafeBlock(u) => hir::PopUnsafeBlock(lower_unsafe_source(_lctx, u)),
14841482
}
14851483
}
14861484

src/libsyntax/ast.rs

-2
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,6 @@ pub type SpannedIdent = Spanned<Ident>;
765765
pub enum BlockCheckMode {
766766
DefaultBlock,
767767
UnsafeBlock(UnsafeSource),
768-
PushUnsafeBlock(UnsafeSource),
769-
PopUnsafeBlock(UnsafeSource),
770768
}
771769

772770
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, Copy)]

src/libsyntax/ext/base.rs

-6
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,6 @@ fn initial_syntax_expander_table<'feat>(ecfg: &expand::ExpansionConfig<'feat>)
544544
syntax_expanders.insert(intern("cfg"),
545545
builtin_normal_expander(
546546
ext::cfg::expand_cfg));
547-
syntax_expanders.insert(intern("push_unsafe"),
548-
builtin_normal_expander(
549-
ext::pushpop_safe::expand_push_unsafe));
550-
syntax_expanders.insert(intern("pop_unsafe"),
551-
builtin_normal_expander(
552-
ext::pushpop_safe::expand_pop_unsafe));
553547
syntax_expanders.insert(intern("trace_macros"),
554548
builtin_normal_expander(
555549
ext::trace_macros::expand_trace_macros));

src/libsyntax/ext/pushpop_safe.rs

-94
This file was deleted.

src/libsyntax/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ pub mod ext {
121121
pub mod log_syntax;
122122
pub mod mtwt;
123123
pub mod quote;
124-
pub mod pushpop_safe;
125124
pub mod source_util;
126125
pub mod trace_macros;
127126

src/libsyntax/print/pprust.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1672,8 +1672,8 @@ impl<'a> State<'a> {
16721672
attrs: &[ast::Attribute],
16731673
close_box: bool) -> io::Result<()> {
16741674
match blk.rules {
1675-
ast::UnsafeBlock(..) | ast::PushUnsafeBlock(..) => try!(self.word_space("unsafe")),
1676-
ast::DefaultBlock | ast::PopUnsafeBlock(..) => ()
1675+
ast::UnsafeBlock(..) => try!(self.word_space("unsafe")),
1676+
ast::DefaultBlock => ()
16771677
}
16781678
try!(self.maybe_print_comment(blk.span.lo));
16791679
try!(self.ann.pre(self, NodeBlock(blk)));

src/test/compile-fail/feature-gate-pushpop-unsafe.rs

-14
This file was deleted.

src/test/compile-fail/pushpop-unsafe-rejects.rs

-74
This file was deleted.

src/test/run-pass/pushpop-unsafe-okay.rs

-56
This file was deleted.

0 commit comments

Comments
 (0)