rust/src/test/run-pass-fulldeps
Alex Crichton 80ff0f74b0 std: Add a new wasm32-unknown-unknown target
This commit adds a new target to the compiler: wasm32-unknown-unknown. This
target is a reimagining of what it looks like to generate WebAssembly code from
Rust. Instead of using Emscripten which can bring with it a weighty runtime this
instead is a target which uses only the LLVM backend for WebAssembly and a
"custom linker" for now which will hopefully one day be direct calls to lld.

Notable features of this target include:

* There is zero runtime footprint. The target assumes nothing exists other than
  the wasm32 instruction set.
* There is zero toolchain footprint beyond adding the target. No custom linker
  is needed, rustc contains everything.
* Very small wasm modules can be generated directly from Rust code using this
  target.
* Most of the standard library is stubbed out to return an error, but anything
  related to allocation works (aka `HashMap`, `Vec`, etc).
* Naturally, any `#[no_std]` crate should be 100% compatible with this new
  target.

This target is currently somewhat janky due to how linking works. The "linking"
is currently unconditional whole program LTO (aka LLVM is being used as a
linker). Naturally that means compiling programs is pretty slow! Eventually
though this target should have a linker.

This target is also intended to be quite experimental. I'm hoping that this can
act as a catalyst for further experimentation in Rust with WebAssembly. Breaking
changes are very likely to land to this target, so it's not recommended to rely
on it in any critical capacity yet. We'll let you know when it's "production
ready".

---

Currently testing-wise this target is looking pretty good but isn't complete.
I've got almost the entire `run-pass` test suite working with this target (lots
of tests ignored, but many passing as well). The `core` test suite is still
getting LLVM bugs fixed to get that working and will take some time. Relatively
simple programs all seem to work though!

---

It's worth nothing that you may not immediately see the "smallest possible wasm
module" for the input you feed to rustc. For various reasons it's very difficult
to get rid of the final "bloat" in vanilla rustc (again, a real linker should
fix all this). For now what you'll have to do is:

    cargo install --git https://github.com/alexcrichton/wasm-gc
    wasm-gc foo.wasm bar.wasm

And then `bar.wasm` should be the smallest we can get it!

---

In any case for now I'd love feedback on this, particularly on the various
integration points if you've got better ideas of how to approach them!
2017-11-19 21:07:41 -08:00
..
auxiliary Add several lints into unused lint group 2017-10-29 22:14:23 +03:00
proc-macro Add several lints into unused lint group 2017-10-29 22:14:23 +03:00
ast_stmt_expr_attr.rs Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
binary-heap-panic-safe.rs std: Remove rand crate and module 2017-11-08 20:41:17 -08:00
compiler-calls.rs Remove the cstore reference from Session in order to prepare encapsulating CrateStore access in tcx. 2017-09-12 07:19:06 -07:00
create-dir-all-bare.rs Ignore cross-compilation in some fulldeps tests. 2015-04-22 20:32:14 -07:00
custom-derive-partial-eq.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
derive-totalsum-attr.rs Add test for custom deriving plugins which rely on field attributes 2015-05-01 15:49:05 +05:30
derive-totalsum.rs Make #[derive(Anything)] into sugar for #[derive_Anything] 2015-03-06 18:20:16 -08:00
deriving-encodable-decodable-box.rs Removes FIXMEs related to #22405 2017-01-31 21:27:13 -05:00
deriving-encodable-decodable-cell-refcell.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
deriving-global.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
dropck_tarena_sound_drop.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
empty-struct-braces-derive.rs Partially stabilize RFC 1506 "Clarify relationships between ADTs" 2016-11-08 22:34:05 +03:00
env.rs std: Remove rand crate and module 2017-11-08 20:41:17 -08:00
extern-mod-syntax.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
flt2dec.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
issue-2804.rs Merge crate collections into alloc 2017-06-13 23:37:34 -07:00
issue-4016.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-4036.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-11881.rs rustc_metadata: replace RBML with a simple and type-safe scheme. 2016-09-20 20:08:05 +03:00
issue-13560.rs Update ignored tests for dynamic musl 2017-08-22 16:24:29 -05:00
issue-14021.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-15149.rs Removed many pointless calls to *iter() and iter_mut() 2015-06-10 21:14:03 +01:00
issue-15778-pass.rs Add regression tests for #15778 2015-03-02 13:22:03 -08:00
issue-15924.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-16822.rs rollup merge of #23786: alexcrichton/less-quotes 2015-03-27 16:10:25 -07:00
issue-16992.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
issue-18502.rs Fix fallout of removing quotes in crate names 2015-03-27 11:43:40 -07:00
issue-18763-quote-token-tree.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
issue-24972.rs mk: Distribute fewer TARGET_CRATES 2016-03-07 13:05:12 -08:00
issue-35829.rs Inclusive range updated to ..= syntax 2017-11-06 13:43:59 +01:00
issue-40663.rs Ignore tests that fail on stage1 2017-08-08 18:33:43 +02:00
issue_16723_multiple_items_syntax_ext.rs Auto merge of #21774 - ejjeong:enable-test-for-android, r=alexcrichton 2015-02-17 19:35:12 +00:00
issue_24106.rs add regression test for issue #24106 2017-05-04 19:34:48 -04:00
linkage-visibility.rs Update ignored tests for dynamic musl 2017-08-22 16:24:29 -05:00
llvm-pass-plugin.rs Allow plugins to register LLVM passes 2015-04-08 14:01:59 -07:00
lto-syntax-extension.rs test: Fix lto-syntax-extension 2015-07-27 10:42:04 -07:00
macro-crate-does-hygiene-work.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
macro-crate-multi-decorator-literals.rs Implement RFC#1559: allow all literals in attributes. 2016-08-25 13:25:22 -07:00
macro-crate-multi-decorator.rs Get tests passing 2015-05-01 17:14:52 +12:00
macro-crate-outlive-expansion-phase.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
macro-crate.rs Test derive expansion ordering. 2016-10-10 22:15:57 +00:00
macro-quote-cond.rs Implement quote! and other proc_macro API. 2017-06-26 02:06:26 +00:00
macro-quote-test.rs Implement quote! and other proc_macro API. 2017-06-26 02:06:26 +00:00
mbe_matching_test_macro.rs Add syntax::ext::tt::quoted::{TokenTree, ..} and remove tokenstream::TokenTree::Sequence. 2017-02-28 22:14:29 +00:00
myriad-closures.rs Move the myriad-closures.rs test case to run-pass-full test suite. 2016-11-22 15:16:54 -05:00
plugin-args-1.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
plugin-args-2.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
plugin-args-3.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
plugin-lib-ok-in-plugin.rs Warn when linking a plugin into a non-plugin crate 2015-02-12 12:44:31 -08:00
plugin-plus-extern-crate.rs Warn when linking a plugin into a non-plugin crate 2015-02-12 12:44:31 -08:00
pprust-expr-roundtrip.rs better explanatory comment for the pprust-expr-roundtrip test 2017-09-06 10:30:00 -04:00
proc_macro.rs Implement quote! and other proc_macro API. 2017-06-26 02:06:26 +00:00
qquote.rs Implement a file-path remapping feature in support of debuginfo and reproducible builds. 2017-04-26 15:44:02 +02:00
quote-tokens.rs Add syntax::ext::tt::quoted::{TokenTree, ..} and remove tokenstream::TokenTree::Sequence. 2017-02-28 22:14:29 +00:00
quote-unused-sp-no-warning.rs Fix some pretty printing tests 2016-10-18 23:23:40 +03:00
regions-mock-tcx.rs Merge crate collections into alloc 2017-06-13 23:37:34 -07:00
rename-directory.rs std: Stabilize library APIs for 1.5 2015-10-25 09:36:32 -07:00
roman-numerals-macro.rs Use a crate attribute to load plugins 2015-02-09 13:27:27 -08:00
rustc_encodable_hygiene.rs prevent other encode methods from breaking derive(RustcEncodable) 2016-04-12 15:41:46 +02:00
sort-unstable.rs std: Add a new wasm32-unknown-unknown target 2017-11-19 21:07:41 -08:00
stdio-from.rs Add conversions from File and Child* handles to Stdio 2017-06-06 15:42:55 -07:00
switch-stdout.rs std: Don't cache stdio handles on Windows 2017-03-23 07:22:48 -07:00
syntax-extension-with-dll-deps.rs Require feature attributes, and add them where necessary 2015-03-23 14:40:26 -07:00
vector-sort-panic-safe.rs std: Remove rand crate and module 2017-11-08 20:41:17 -08:00