Skip to content

Instantly share code, notes, and snippets.

@eholk
eholk / gist:db6764473448099c128f7a9e1e664292
Created February 17, 2017 23:13
mir2wasm compile error
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> src/trans.rs:76:21
|
76 | let ref mut v = BinaryenModuleCtxt {
| ^^^^^^^^^^^^^^^^^^
|
help: consider using an explicit lifetime parameter as shown: fn trans_crate<'a>(tcx: &TyCtxt<'a, 'a, 'a>, entry_fn: Option<NodeId>,
options: &WasmTransOptions) -> Result<()>
--> src/trans.rs:65:1
|
impl to_str<T> for T {
fn to_str() -> str { "a" }
}
fn foo<T>(_f:fn()) -> T { fail }
fn main() {
log(error,
// 16 in a row
[do foo::<~@&*()>{;}]/_.
macro_rules! foo (
// 24 in a row!
(!@#~=|%^&:/+*(){,}[;].$_x:ident) => { 5 }
)
fn main() {}
// beginning a Binaryen API trace
#include <math.h>
#include <map>
#include "src/binaryen-c.h"
int main() {
std::map<size_t, BinaryenFunctionTypeRef> functionTypes;
std::map<size_t, BinaryenExpressionRef> expressions;
std::map<size_t, BinaryenFunctionRef> functions;
std::map<size_t, RelooperBlockRef> relooperBlocks;
BinaryenModuleRef the_module = NULL;
[wasm-validator error in function $real_main] 1 != 0: function body type must match, if function returns, on
[none] [none] (block
[unreachable] (block $block$1$break
[none] (set_local $6
[i32] (i32.load
[i32] (i32.const 0)
)
)
[unreachable] [unreachable] (block
[unreachable] (br $block$1$break)
(module
(type $rustfn-0-2 (func (param i32) (result i32)))
(type $rustfn-0-4 (func))
(type $rustfn-0-5 (func))
(type $__wasm_start (func))
(type $rustfn-0-19 (func (param i32 i32) (result i32)))
(type $rustfn-0-33 (func (param i32 i32) (result i32)))
(type $rustfn-0-44 (func (param i32 i32) (result i32)))
(type $rustfn-0-53 (func (param i32 i32)))
(memory $0 1024 1024)
// beginning a Binaryen API trace
#include <math.h>
#include <map>
#include "src/binaryen-c.h"
int main() {
std::map<size_t, BinaryenFunctionTypeRef> functionTypes;
std::map<size_t, BinaryenExpressionRef> expressions;
std::map<size_t, BinaryenFunctionRef> functions;
std::map<size_t, RelooperBlockRef> relooperBlocks;
BinaryenModuleRef the_module = NULL;
[binaryen] FAILED with exit code Some(101)
command: "/usr/local/google/home/eholk/wasm/mir2wasm/target/debug/mir2wasm" "tests/compile-pass/iterator.rs" "-Dwarnings" "--run" "-o" "/usr/local/google/home/eholk/wasm/mir2wasm/target/debug/tests/run-compile-pass/iterator.wasm"
stdout:
stderr:
[wasm-validator error in function $main] 1 != 0: set_local type must match function, on
[none] (set_local $12
[none] (get_local $0)
)
[wasm-validator error in function $main] 1 != 0: set_local type must match function, on
$ ./wasm-install/bin/emscripten/emcc hello-wasm.c -s BINARYEN=1
Unknown option '--total-memory'
Traceback (most recent call last):
File "./wasm-install/bin/emscripten/emcc", line 13, in <module>
emcc.run()
File "/usr/local/google/home/eholk/nacl/native_client/toolchain_build/src/subzero/wasm-install/bin/emscripten/emcc.py", line 1848, in run
subprocess.check_call(cmd, stdout=open(wasm_text_target, 'w'))
File "/usr/lib/python2.7/subprocess.py", line 540, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/google/home/eholk/wasm/binaryen/bin/asm2wasm', 'a.out.asm.js', '--mapped-globals=a.out.wast.mappedGlobals', '--total-memory=16777216']' returned non-zero exit status 1
define internal <4 x float> @testConstFloat4() {
; ASM-LABEL: testConstFloat4:
; DIS-LABEL: 00000000 <testConstFloat4>:
; IASM-LABEL: testConstFloat4:
entry:
ret <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>
; ASM: vadd.f32 q10, q10, q11
; DIS: 1c: ee3aaa0b