Uh oh!
There was an error while loading. Please reload this page.
Remove unwrap() from cabi_x86_64.rs - #47378
Conversation
rust-highfive
commented
Jan 12, 2018
r? @estebank (rust_highfive has picked a reviewer for you, use r? to override) |
topecongiro
commented
Jan 12, 2018
Added a test for #38763. |
There was a problem hiding this comment.
Are the tests now passing because of the if let Ok(cls) or the if let Some(target)? I feel like instead of silently passing this should fail with a diagnostic error, but I'm not knowledgeable enough about this part fo the language. Otherwise the code seems ready to merge.
@eddyb could you take a look?
There was a problem hiding this comment.
See #38763 (comment) - I think this needs further investigation.
There was a problem hiding this comment.
These don't seem right - if the unwrap can fail that means there's a logic error somewhere within this file, which this seems to hide.
There was a problem hiding this comment.
Updated to call bug!() when this failed.
topecongiro
commented
Jan 14, 2018
eddyb
commented
Jan 14, 2018
@topecongiro I'm still not happy - I haven't seen any explanation for what's happening. |
topecongiro
commented
Jan 14, 2018
I am sorry for being lazy about explaining what I was working on. Let me clarify a bit. I first tried to compile the following file using 83ba46f: // test.rs#![feature(repr_align)]#![feature(attr_literals)]#[repr(align(16))]pubstructFoo(i32);#[no_mangle]pubextern"C"fnfoo(x:Foo){}fnmain(){}and got the following error (an irrelevant part is omitted): Here, the content of
The new commits do not paper over errors, they will call |
Yes, because it should never fail. I think I see what's wrong here, we assumed primitives would fit into EDIIT: I mean, specifically when |
eddyb
commented
Jan 15, 2018
topecongiro
commented
Jan 15, 2018
Cool, I will close this PR in favor of those two. @eddyb Thank you very much for your help! |
@topecongiro thank you for taking the time to dig into this in the first place! |
This PR is a follow-up of #47014. I am not certain whether simply removing
unwrap()suffices, but at least no test failed.Closes#38763. Closes#45662.