Live data from Hacker News

Oxidizing Source Maps with Rust and WebAssembly

hacks.mozilla.org

31–32 of 32 posts

Re: Oxidizing Source Maps with Rust and WebAssembly

#31
post #16

parse_mappings is incorrect. It has the following line: Vec:: ::from_raw_parts(capacity_ptr, size, capacity); But size is wrong. size here is the number of bytes that JavaScript instructed Rust to allocate. It's not the size of the Vec:: . This should be harmless as the resulting Vec is immediately deallocated, so the only thing that size is used for is deinitializing values, and since the values are usize there's no…

Great catch -- thanks for reporting this!

Fix is over in https://github.com/fitzgen/source-map-mappings/pull/15

Re: Oxidizing Source Maps with Rust and WebAssembly

#32
post #26

Earlier quoted context omitted.

>You should file bugs! We care deeply about the legibility of error messages, and the whole --explain system is there to try and go above and beyond. Next time I do some Rust I will. I also need to check out that --explain system. I didn't see that when learning Rust.

Take a program that doesn't work, like this one: https://play.rust-lang.org/?gist=2c7b672c6a211e3ab2f3995e37d... > error[E0384]: cannot assign twice to immutable variable `x` That E0384 is a link in the browser. Click it and you go to https://doc.rust-lang.org/error-index.html#E0384 which has a longer version of this error. On the command line, you can run `rustc --explain E0384` and it'll print out the same text to…

Nice, thank you! I always Googled it until now.
Post reply on HN