diff options
| author | bors <bors@rust-lang.org> | 2015-09-06 21:31:26 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-09-06 21:31:26 +0000 |
| commit | 3dd1a48f3f7ac0eeffb2aa5d79bc09daf827fc3f (patch) | |
| tree | 3bfe81ff0c313bbf801c1a3b41a27dc3260b54b1 /src/libsyntax | |
| parent | 01b9cc58ba0c91ec265d8c1ad9225b2ca777464e (diff) | |
| parent | c8a661838ed3f4db7a9402df880e539b46f0a0f1 (diff) | |
| download | rust-3dd1a48f3f7ac0eeffb2aa5d79bc09daf827fc3f.tar.gz rust-3dd1a48f3f7ac0eeffb2aa5d79bc09daf827fc3f.zip | |
Auto merge of #27893 - nikomatsakis:mir, r=nrc
This PR contains a new crate, `rustc_mir`, which implements the MIR as specified in the RFC (more or less). There are no targeted unit tests at the moment, as I didn't decide what kind of infrastructure would be best and didn't take the time to implement it. ~~NB: In packaging up this PR, I realized that MIR construction code is not triggering for methods right now, I think it's only for fixed fns. I'll push a fix for this soon. Hopefully it doesn't stop any crates from building. :)~~ Fixed. Everything still seems to work. However, the MIR construction code (`librustc_mir/build`) is intentionally quite distinct from the code which munges the compiler's data structures (`librustc_mir/tcx`). The interface between the two is the `HIR` trait (`librustc_mir/hir`). To avoid confusion with @nrc's work, perhaps a better name for this trait is warranted, although ultimately this trait *will* be connected to the HIR, I imagine, so in a way the name is perfect. Anyway, I'm open to suggestions. The initial motivation for this split was to allow for the MIR construction code to be unit-tested. But while I didn't end up writing unit tests (yet), I did find the split made the code immensely easier to think about, since the messiness of our existing system, with its myriad hashtables, punning, and so forth, is confined to one part, which simply transforms to a more fully explicit AST-like form. I tried to separate out the commits somewhat, but since this mostly new code, it mostly winds up coming in one fell swoop in the MIR commit. Quick guide to the MIR crate: - `repr.rs` defines the MIR itself; each MIR instance is parameterized by some HIR `H` - `build/` is the MIR construction code, parameterized by a particular HIR - `hir/` is the definition of the HIR interface - `tcx/` is the impl of the HIR interface for the tcx - `dump.rs` is the minimal compiler pass that invokes the HIR One open question: - In the HIR trait, I used exclusively struct-like variants. I found I like this more, since things have names. Should I convert the repr code?
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/feature_gate.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 0c0c68c89a1..1cc2eaa6278 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -272,13 +272,20 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGat feature")), ("rustc_variance", Normal, Gated("rustc_attrs", "the `#[rustc_variance]` attribute \ - is an experimental feature")), + is just used for rustc unit tests \ + and will never be stable")), ("rustc_error", Whitelisted, Gated("rustc_attrs", "the `#[rustc_error]` attribute \ - is an experimental feature")), + is just used for rustc unit tests \ + and will never be stable")), ("rustc_move_fragments", Normal, Gated("rustc_attrs", "the `#[rustc_move_fragments]` attribute \ - is an experimental feature")), + is just used for rustc unit tests \ + and will never be stable")), + ("rustc_mir", Normal, Gated("rustc_attrs", + "the `#[rustc_mir]` attribute \ + is just used for rustc unit tests \ + and will never be stable")), ("allow_internal_unstable", Normal, Gated("allow_internal_unstable", EXPLAIN_ALLOW_INTERNAL_UNSTABLE)), |
