Skip to content

Commit

Permalink
Rollup merge of rust-lang#54024 - alexcrichton:compile-to-wasm, r=pet…
Browse files Browse the repository at this point in the history
…rochenkov

Fix compiling some rustc crates to wasm

I was dabbling recently seeing what it would take to compile `rustfmt` to the
`wasm32-unknown-unknown` target and it turns out not much effort is needed!
Currently `rustfmt` depends on a few rustc crates published to crates.io, so
this commit touches up those crates to compile for wasm themselves. Notably:

* The `rustc_data_structures` crate's `flock` implementation is stubbed out to
  unconditionally return errors on unsupported platforms.
* The `rustc_errors` crate is extended to not do any locking for all non-windows
  platforms.

In both of these cases if we port the compiler to new platforms the
functionality isn't critical but will be discovered over time as it comes up, so
this hopefully doesn't make it too too hard to compile to new platforms!
  • Loading branch information
kennytm authored Sep 14, 2018
2 parents b3303ed + 0c89243 commit 33bc6c3
Show file tree
Hide file tree
Showing 2 changed files with 299 additions and 293 deletions.
Loading

0 comments on commit 33bc6c3

Please sign in to comment.