From 1829fa5199bae5a192c771807c532badce14be37 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 5 Jun 2015 08:31:27 +0200 Subject: Hack for "unsafety hygiene" -- `push_unsafe!` and `pop_unsafe!`. Even after expansion, the generated expressions still track depth of such pushes (i.e. how often you have "pushed" without a corresponding "pop"), and we add a rule that in a context with a positive `push_unsafe!` depth, it is effectively an `unsafe` block context. (This way, we can inject code that uses `unsafe` features, but still contains within it a sub-expression that should inherit the outer safety checking setting, outside of the injected code.) This is a total hack; it not only needs a feature-gate, but probably should be feature-gated forever (if possible). ignore-pretty in test/run-pass/pushpop-unsafe-okay.rs --- src/libsyntax/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src/libsyntax/lib.rs') diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index d93af5da13c..5424c0b214a 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -120,6 +120,7 @@ pub mod ext { pub mod log_syntax; pub mod mtwt; pub mod quote; + pub mod pushpop_safe; pub mod source_util; pub mod trace_macros; -- cgit 1.4.1-3-g733a5