Uh oh!
There was an error while loading. Please reload this page.
Remove the old AST-based backend from rustc_trans. - #35764
Conversation
rust-highfive
commented
Aug 17, 2016
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
alexcrichton
commented
Aug 17, 2016
Dat diff. |
retep998
commented
Aug 17, 2016
Praise be, the world will no longer be blocked on MIR, and development of new features can finally take place! |
nrc
commented
Aug 17, 2016
Much as I'd love to r+ this, r? @nikomatsakis |
There was a problem hiding this comment.
It looks like this trait can also be deleted?
bors
commented
Aug 18, 2016
☔ The latest upstream changes (presumably #35684) made this pull request unmergeable. Please resolve the merge conflicts. |
eddyb
commented
Aug 18, 2016
FWIW, this appears to fix #35408 locally, possibly due to |
4b7129b to
9a9cd63Comparenikomatsakis
commented
Aug 23, 2016
@bors r+ |
bors
commented
Aug 23, 2016
📌 Commit 9a9cd63 has been approved by |
Remove the old AST-based backend from rustc_trans. Starting with Rust 1.13, `--disable-orbit` , `-Z orbit=off` and `#[rustc_no_mir]` have been removed. Only the new MIR backend is left in the compiler, and only early const_eval uses ASTs from other crates. Filling drop (previously "zeroing drop"), `#[unsafe_no_drop_flag]` and associated unstable APIs are gone. Implementing `Drop` doesn't add a flag anymore to the type, all of the dynamic drop is function local. This is a [breaking-change], please use `Option::None` and/or `mem::forget` if you are unsure about your ability to prevent/control the drop of a value. In the future, `union` will be usable in some such cases. **NOTE**: DO NOT MERGE before we get the new beta as the stage0, there's some cruft to remove. All of this will massively simplify any efforts to implement (and as such it blocks) features such as `union`s, safe use of `#[packed]` or new type layout optimizations, not to mention many other experiments.
bors
commented
Aug 24, 2016
💔 Test failed - auto-mac-cross-ios-opt |
eddyb
commented
Aug 24, 2016
@bors retry |
bors
commented
Aug 24, 2016
Remove the old AST-based backend from rustc_trans. Starting with Rust 1.13, `--disable-orbit` , `-Z orbit=off` and `#[rustc_no_mir]` have been removed. Only the new MIR backend is left in the compiler, and only early const_eval uses ASTs from other crates. Filling drop (previously "zeroing drop"), `#[unsafe_no_drop_flag]` and associated unstable APIs are gone. Implementing `Drop` doesn't add a flag anymore to the type, all of the dynamic drop is function local. This is a [breaking-change], please use `Option::None` and/or `mem::forget` if you are unsure about your ability to prevent/control the drop of a value. In the future, `union` will be usable in some such cases. **NOTE**: DO NOT MERGE before we get the new beta as the stage0, there's some cruft to remove. All of this will massively simplify any efforts to implement (and as such it blocks) features such as `union`s, safe use of `#[packed]` or new type layout optimizations, not to mention many other experiments.
bors
commented
Aug 25, 2016
Implement untagged unions (RFC 1444) cc #32836 Notes: - The RFC doesn't talk about `#[packed]` unions, this implementation supports them, packing changes union's alignment to 1 and removes trailing padding. - The RFC doesn't talk about dynamically sized unions, this implementation doesn't support them and rejects them during wf-checking (similarly, dynamically sized enums are not supported as well). - The lint for drop fields in unions can't work precisely before monomorphization, so it works pessimistically - non-`Copy` generic fields are reported, types not implementing `Drop` directly, but having non-trivial drop code are reported. ``` struct S(String); // Doesn't implement `Drop` union U<T> { a: S, // Reported b: T, // Reported } ``` - #35764 was indeed helpful and landed timely, I didn't have to implement internal drop flags for unions. - Unions are not permitted in constant patterns, because matching on union fields is unsafe, I didn't want unsafety checker to dig into all constants to uncover this possible unsafety. - The RFC doesn't talk about `#[derive]`, generally trait impls cannot be derived for unions, but some of them can. I implemented only `#[derive(Copy)]` so far. In theory shallow `#[derive(Clone)]` can be derived as well if all union fields are `Copy`, I left it for later though, it requires changing how `Clone` impls are generated. - Moving union fields is implemented as per #32836 (comment). - Testing strategy: union specific behavior is tested, sometimes very basically (e.g. debuginfo), behavior common for all ADTs (e.g. something like coherence checks) is not generally tested. r? @eddyb
Starting with Rust 1.13,
--disable-orbit,-Z orbit=offand#[rustc_no_mir]have been removed.Only the new MIR backend is left in the compiler, and only early const_eval uses ASTs from other crates.
Filling drop (previously "zeroing drop"),
#[unsafe_no_drop_flag]and associated unstable APIs are gone.Implementing
Dropdoesn't add a flag anymore to the type, all of the dynamic drop is function local.This is a [breaking-change], please use
Option::Noneand/ormem::forgetif you are unsure about your ability to prevent/control the drop of a value. In the future,unionwill be usable in some such cases.NOTE: DO NOT MERGE before we get the new beta as the stage0, there's some cruft to remove.
All of this will massively simplify any efforts to implement (and as such it blocks) features such as
unions, safe use of#[packed]or new type layout optimizations, not to mention many other experiments.