Uh oh!
There was an error while loading. Please reload this page.
Implement the ! type - #35162
Conversation
rust-highfive
commented
Aug 1, 2016
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
canndrew
commented
Aug 1, 2016
How much effort is it worth going to to get this working without MIR? It works currently except for one weirdly failing test. But if we're going to be launching MIR soon is it worth keeping old trans working at all? |
There was a problem hiding this comment.
This can be a bit more formal, e.g. "Remove this in the next snapshot." and not_stage0 instead of args.
cc @alexcrichton Does "SNAP" work anymore?
f57d48f to
143ba6eCompareThere was a problem hiding this comment.
@nikomatsakis What do you think about these impls?
There was a problem hiding this comment.
I'm pretty sure I added these out of necessity to make a test pass. Also ! is trivially totally ordered so it should impl Ord.
f9c44b3 to
54b7243Comparebors
commented
Aug 3, 2016
☔ The latest upstream changes (presumably #35174) made this pull request unmergeable. Please resolve the merge conflicts. |
54b7243 to
2c62c30CompareThere was a problem hiding this comment.
I think that this function should be renamed -- it sounds very much like it is checking for TyEmpty, when in fact it does more (not sure if this happens in a later commit)
OK so @eddyb and I chatted a bunch on IRC. In general, I'm feeling nervous about how the "never-to-any" adjustment is different from other adjustments. For one thing, it's applied eagerly, in I can see various ways to go forward:
Honestly without trying to work through either of those latter two options, I'm not quite sure how easy/hard they would be, but it seems like option 3 probably leaves us with a cleaner setup than we started with overall (presuming it works), so maybe worth a try. |
bors
commented
Aug 6, 2016
☔ The latest upstream changes (presumably #35116) made this pull request unmergeable. Please resolve the merge conflicts. |
bors
commented
Aug 14, 2016
💔 Test failed - auto-linux-64-opt-no-mir |
arielb1
commented
Aug 14, 2016
@bors retry |
eddyb
commented
Aug 14, 2016
arielb1
commented
Aug 14, 2016
Old trans apparently sometimes drops rvalue datums from other branches. You should use an lvalue datum instead. fix: diff --git a/src/librustc_trans/expr.rs b/src/librustc_trans/expr.rs
index 0ea5715..18bafdb 100644
--- a/src/librustc_trans/expr.rs
+++ b/src/librustc_trans/expr.rs
@@ -385,7 +385,7 @@ fnapply_adjustments<'blk,'tcx>(bcx:Block<'blk,'tcx>,
let mono_target = bcx.monomorphize(target);let llty = type_of::type_of(bcx.ccx(),mono_target);let dummy = C_undef(llty.ptr_to());
- datum = Datum::new(dummy, mono_target,Rvalue::new(ByRef)).to_expr_datum();
+ datum = Datum::new(dummy, mono_target,Lvalue::new("never")).to_expr_datum();}AdjustReifyFnPointer => {match datum.ty.sty{test case (sans assertions): pubstructReceiver(u32);implDropforReceiver{fndrop(&mutself){}}pubfnrecv(f1:bool,f2:bool) -> Receiver{match f1 {false => Receiver(0),true => {match f2 {true => returnReceiver(0),false => returnReceiver(0),}}}}fnmain(){} |
eddyb
commented
Aug 15, 2016
@bors r=nikomatsakis |
bors
commented
Aug 15, 2016
📌 Commit f59f1f0 has been approved by |
canndrew
commented
Aug 15, 2016
@eddyb Thanks! |
canndrew
commented
Aug 15, 2016
Also @arielb1 thanks! |
bors
commented
Aug 15, 2016
⌛ Testing commit f59f1f0 with merge 1f58506... |
bors
commented
Aug 15, 2016
💔 Test failed - auto-win-msvc-64-opt-no-mir |
arielb1
commented
Aug 15, 2016
@bors retry |
canndrew
commented
Aug 16, 2016
Anyone know what happened here? Has the problem with msvc wanting libm been fixed? |
retep998
commented
Aug 16, 2016
I really doubt msvc wants libm. If that legitimately happened I'd be quite worried. It is probably just some other bug causing a random "m" to appear in the command to the linker. |
bors
commented
Aug 16, 2016
Implement the `!` type This implements the never type (`!`) and hides it behind the feature gate `#[feature(never_type)]`. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on, `!` is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to `!` instead of `()`.
bors
commented
Aug 16, 2016
durka
commented
Aug 22, 2016
For the record this indirectly introduced some issues (see #35883 (comment)) and parts of it will need to be semi-reverted (old |
This implements the never type (
!) and hides it behind the feature gate#[feature(never_type)]. With the feature gate off, things should build as normal (although some error messages may be different). With the gate on,!is usable as a type and diverging type variables (ie. types that are unconstrained by anything in the code) will default to!instead of().(tracking issue #35121 )