Skip to content

Commit

Permalink
Rollup merge of #72017 - ctaggart:wasm2, r=ecstatic-morse
Browse files Browse the repository at this point in the history
Work around ICEs during cross-compilation for target, ast, & attr

This applies the fix for #72003 to work around #56935 to three more libraries. With these additional fixes, I'm able to use rustfmt_lib from wasm (rust-lang/rustfmt#4132 (comment)), which was my goal.

To get it working locally and to test, I copied the `.cargo/registry/src` and applied the fix and replaced the reference in my project:
``` toml
[replace]
"rustc-ap-rustc_span:656.0.0" = { path = "../rustc-ap-rustc_span" }
"rustc-ap-rustc_target:656.0.0" = { path = "../rustc-ap-rustc_target" }
"rustc-ap-rustc_ast:656.0.0" = { path = "../rustc-ap-rustc_ast" }
"rustc-ap-rustc_attr:656.0.0" = { path = "../rustc-ap-rustc_attr" }
```
  • Loading branch information
Dylan-DPC committed May 8, 2020
2 parents b750ee4 + 0d60c46 commit 827ec49
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/librustc_ast/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
#![feature(unicode_internals)]
#![recursion_limit = "256"]

// FIXME(#56935): Work around ICEs during cross-compilation.
#[allow(unused)]
extern crate rustc_macros;

#[macro_export]
macro_rules! unwrap_or {
($opt:expr, $default:expr) => {
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_attr/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

#![feature(or_patterns)]

// FIXME(#56935): Work around ICEs during cross-compilation.
#[allow(unused)]
extern crate rustc_macros;

mod builtin;

pub use builtin::*;
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_target/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
#![feature(associated_type_bounds)]
#![feature(exhaustive_patterns)]

// FIXME(#56935): Work around ICEs during cross-compilation.
#[allow(unused)]
extern crate rustc_macros;

#[macro_use]
extern crate log;

Expand Down

0 comments on commit 827ec49

Please sign in to comment.