-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make MSVC detection ludicrously robust #34492
Conversation
} | ||
} else { None } | ||
} else { vec![] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps this could just be:
match (arch, host_arch()) {
// ...
}
Can you also add docs as to what's being returned here? It's not clear to me at least what these are vectors of nor what each element of the pair is.
f460adc
to
40a7175
Compare
Updated Also added a commit with one function converted to use |
Yeah the logic has gotten complicated enough in a few places that I'd be fine using that macro for most of the functions, other than that looks good to me! |
19ebd6b
to
570fd7a
Compare
I've converted what I could to using the macro. |
Some(val) => val, | ||
None => return None, | ||
}) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This macro has been written at least twice in librustc
under different names 😆
try_opt!
:rust/src/librustc/dep_graph/dep_node.rs
Lines 13 to 20 in 382ab92
macro_rules! try_opt { ($e:expr) => ( match $e { Some(r) => r, None => return None, } ) } option_try!
:rust/src/librustc/util/common.rs
Lines 72 to 74 in bb4b3fb
macro_rules! option_try( ($e:expr) => (match $e { Some(e) => e, None => return None }) );
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clearly this just indicates the need for this sort of macro in libstd. Sure would be nice if the new ?
stuff supported Option
.
Tidy looks like it's failing on travis, but otherwise r=me |
Should fix a few more edge cases Fixes rust-lang#31151 Fixes rust-lang#32159 Fixes rust-lang#34484 Improves rust-lang-deprecated/rust-packaging#50 Signed-off-by: Peter Atashian <retep998@gmail.com>
570fd7a
to
a1b33b4
Compare
Travis appears to have passed. |
@bors r=alexcrichton |
📌 Commit a1b33b4 has been approved by |
⌛ Testing commit a1b33b4 with merge ed33659... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
@bors: retry
On Fri, Jul 1, 2016 at 5:38 AM, bors notifications@github.com wrote:
|
⌛ Testing commit a1b33b4 with merge 23095ae... |
💔 Test failed - auto-win-msvc-64-opt-rustbuild |
Make MSVC detection ludicrously robust Resurrection of #31158 r? @alexcrichton
Resurrection of #31158
r? @alexcrichton