Skip to content

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

cuviper and others added 19 commits April 17, 2020 11:36
This adds a hint on `mem::replace`, "if you don't need the old value,
you can just assign the new value directly". This is in similar spirit
to the `must_use` on `ManuallyDrop::take`.
…rror code and also that 'compile_fail' isn't mispelled
Lint must_use on mem::replace

This adds a hint on `mem::replace`, "if you don't need the old value,
you can just assign the new value directly". This is in similar spirit
to the `must_use` on `ManuallyDrop::take`.
…on-extra-check, r=oli-obk

Error code explanation extra check

r? @Mark-Simulacrum
…ic-morse

allow wasm32 compilation of librustc_data_structures/profiling.rs

I'm trying to use rustfmt from a wasm app. I ran into this compilation problem rust-lang/rustfmt#4132 and after investigating, it looked like just adjusting a few cfg's. I based it on how measureme added support in rust-lang/measureme#43.

My testing on my macbook was just that librustc_data_structures builds now with both:
- cargo build
- cargo build --target wasm32-unknown-unknown
proc_macro::is_available()

This PR adds `proc_macro::is_available() -> bool` to determine whether proc_macro has been made accessible to the currently running program.

The proc_macro crate is only intended for use inside the implementation of procedural macros. All the functions in the crate panic if invoked from outside of a procedural macro, such as from a build script or unit test or ordinary Rust binary.

Unfortunately those panics made it impossible for libraries that are designed to support both macro and non-macro use cases (e.g. Syn) to be used from binaries that are compiled with panic=abort. In panic=unwind mode we're able to attempt a proc macro call inside catch_unwind and use libproc_macro's result if it succeeds, otherwise fall back to a non-macro alternative implementation. But in panic=abort there was no way to determine which implementation needs to be used.

r? @eddyb
attn: @petrochenkov @adetaylor
ref: dtolnay/cxx#130
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Apr 22, 2020

📌 Commit bb13aab has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Apr 22, 2020
@Dylan-DPC-zz Dylan-DPC-zz added the rollup A PR which is a rollup label Apr 22, 2020
@bors
Copy link
Collaborator

bors commented Apr 23, 2020

⌛ Testing commit bb13aab with merge fc145e1...

@bors
Copy link
Collaborator

bors commented Apr 23, 2020

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing fc145e1 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 23, 2020
@bors bors merged commit fc145e1 into rust-lang:master Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants