Giter VIP home page Giter VIP logo

browser_wasi_shim's People

Contributors

a-k-o-r-a avatar aandreba avatar amesgen avatar ansemjo avatar bhelx avatar bjorn3 avatar dicej avatar dkourilov avatar harikrishnanbalagopal avatar heroickatora avatar jakebailey avatar jsoverson avatar kateinoigakukun avatar namse avatar prakhar-agarwal-byte avatar shritesh avatar systemcluster avatar terrorjack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

browser_wasi_shim's Issues

feature request: Implement both `path_remove_directory` and `path_unlink_file`

Feature Request

We are implementing 2 of the syscalls that deal with removing files and empty directories.

path_remove_directory(path): number {
return -1;
}

browser_wasi_shim/src/fd.ts

Lines 108 to 110 in 7349f7d

path_unlink_file(path): number {
return -1;
}

https://wasix.org/docs/api-reference/wasi/path_unlink_file
https://wasix.org/docs/api-reference/wasi/path_remove_directory

Status

We have implemented both and it seems to work for empty file and empty directory.
The code is based on https://github.com/bjorn3/browser_wasi_shim/pull/42/files#diff-177a21b9f40c72ea679cf8658d14ed0d9702afcea694e92e0936f11ab182d2a3R331-R333
with some additional checks.

Challenges

  • Fails on a directory that is not empty. In Golang with https://pkg.go.dev/os#RemoveAll it uses a recursive algorithm with unlinkat to unlink the files and remove the empty directories. This goes into an infinite loop.
  • The WASI spec requires that we check file and directory permissions/rights before removing/unlinking but the rights base isn't stored anywhere? We couldn't find many examples of checking rights
    export const RIGHTS_PATH_UNLINK_FILE = 1 << 26;

    other than
    (fs_rights_base & BigInt(wasi.RIGHTS_FD_WRITE)) ==
    BigInt(wasi.RIGHTS_FD_WRITE)

Check pointer alignment

Wasi requires that pointers are aligned and that a trap should happen if pointers are not aligned.

Feature: use Origin-Private Filesystem (OPFS) directory

Hey, I'm not sure how much effort this would be, so: would it be viable to support the Origin-Private Filesystem (OPFS) in the fds: [] argument to the WASI constructor? I suppose that you'd need to write a new Directory subclass, which wraps a FileSystemDirectoryHandle or something like that?

// open directory in OPFS
const opfs = await navigator.storage.getDirectory();
const dir = await opfs.getDirectoryHandle("wasi-context", { create: true });

// initialize WASI shim
let wasi = new WASI(args, envs, [
  new OpenFile(new File([])), // stdin
  new OpenFile(new File([])), // stdout
  new OpenFile(new File([])), // stderr
  new WrapDirHandle(dir),     // <----- ?!
]);

...

As far as I can tell, supporting this API would also allow you to use window.showDirectoryPicker() and use an actual directory on the client machine for the execution context.

Does this support threads?

Hi, thanks for this wonderful effort :)

I'm very interested in running thread code from WASI .wasm file on the browser. Is it possible right now? If not, can I make a PR for that using web workers?

args_sizes_get has different interface

Hello. First of all, thanks for the great project.

I found that in this repo (and in deno/std/wasi which is deprecated and removed), the interface of args_size_get is args_sizes_get(argc: number, argv_buf_size: number): number. However, the standard of wasi has the interface as args_sizes_get() -> Result<(size, size), errno>

May I ask why there's the difference?

feature request: implement `fd_pread`, golang `"archive/zip"` library fails because `fd_pread` returns `-1`

fd_pread(view8: Uint8Array, iovs: Array<wasi.Iovec>, offset: bigint) {
return { ret: -1, nread: 0 };

time="2023-10-11T10:49:24Z" level=fatal msg="impossible to open zip reader: read /language-platforms.zip: errno 4294967295"
proxy for fd_pread !! 4 25784616 1 128772n 25784612
index.js:110 return_value for fd_pread is -1

-1 becomes positive 4294967295 2^32-1 in javascript because of signed 2s complement being interpreted as unsigned javascript number

`fd_seek` fails with with `WHENCE_END` due to "can't convert BigInt to number"

I'm using File/OpenFile to provide a file to the WebAssembly code. It is calling fd_seek(0n, wasi.WHENCE_END), but I receive the error message can't convert BigInt to number on the following line of the function:

calculated_offset = this.file.data.byteLength + offset;

One simple fix might be to explicitly convert to BigInt:

calculated_offset = BigInt(this.file.data.byteLength) + BigInt(offset);

I've done the following monkey-patching and it has resolved the issue for me, but maybe the line mentioned above could instead explicitly convert to BigInt or otherwise handle scenarios where the two values have different types.

const old_fd_seek = OpenFile.prototype.fd_seek;
OpenFile.prototype.fd_seek = function(offset, whence) {
    if (whence == 2 /* WHENCE_END */) {
        return old_fd_seek.call(this, BigInt(this.file.data.byteLength) + BigInt(offset), 0 /* WHENCE_SET */);
    }
    return old_fd_seek.call(this, offset, whence);
}

Add CI testing

  • Find some wasi examples
    • rustc.wasm
    • wasi-testsuite (#56)
  • Run them using browser_wasi_shim on CI using node.js (#56)
  • Check that no node.js only api's are used. (using eg a headless browser) (#62)
  • Check webpack can bundle browser_wasi_shim (#12)

Consider moving rustc.html (and xterm dependencies) to separate project

In order to make this library a bit more streamlined, I'd suggest removing the xterm and xterm-addon-fit dependencies since they're not needed by the library itself. Would it make sense to split this repo into two separate projects, one for the WASI shim itself and another for the rustc-in-a-browser app?

Can't be imported under Jest

I'm trying to use this module in a create-react-app project, and I'm trying to test my project with the built-in Jest test system.

Jest doesn't run Node in ESM mode; it can handle ESM code with import statements, but behind the scenes it does transpilation to run on require().

To use Jest with dependencies that are ESM modules, you have to add them to a negative regular expression in jest.transformIgnorePatterns in your package.json, so that Jest knows it needs to transpile them:

  "jest": {
    "transformIgnorePatterns": [
      "node_modules/(?!(@bjorn3/browser_wasi_shim)/)"
    ]
  }

But even though Jest can transform this module just fine, it can't deal with the conditional export in this project's package.json, which only specifies a file to expose in "import" mode:

"types": "./typings/index.d.ts",
"import": "./dist/index.js"

I get a Jest error like this when I try to run my tests:


> [email protected] test
> react-scripts test --reporters default jest-compact-reporter --seed=1



Jest v27.5.1 node v18.7.0 darwin jest-min-reporter v0.1.0
Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme
 FAIL  src/GBZBaseAPI.test.js
  ● Test suite failed to run

    Cannot find module '@bjorn3/browser_wasi_shim' from 'src/GBZBaseAPI.mjs'

    Require stack:
      src/GBZBaseAPI.mjs
      src/GBZBaseAPI.test.js

      1 | import { APIInterface } from "./APIInterface.mjs";
      2 | import { readFile } from "fs-extra";
    > 3 | import { WASI, File, OpenFile, PreopenDirectory } from "@bjorn3/browser_wasi_shim";
        | ^
      4 |
      5 | // TODO: The Webpack way to get the WASM would be something like:
      6 | //import QueryWasm from "gbz-base/target/wasm32-wasi/release/query.wasm";

      at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.<anonymous> (src/GBZBaseAPI.mjs:3:1)

If I add a "default": "./dist/index.js" export to this project's package.json in my node_modules, Jest can find it and import and transpile it.

There might be a way to give Jest a custom module resolver to work around this, but I think the configuration fields required are not among those that Facebook permits you to use in a create-react-app project.

It would be good if this project exposed an export like "default" that would work in this situation.

Reduce and/or configure `console.log` verbosity

Currently, there are a lot of console.log statements in wasi.js and elsewhere, which is nice for debugging but should probably be turned off for a release scenario. I'm not sure what the current best practice is for this kind of thing in the JS world, so I'm open to suggestions about how to do it.

Don't mix ESM import with CJS exports

index.js currently has both import ... from ... statements and module.exports = ... syntaxes, which are two different import systems.

The current problem I'm facing is I'm trying to bundle a script importing @bjorn3/browser_wasi_shim with webpack, and it fails at buildtime when importing with require() (because @bjorn3/browser_wasi_shim's package.json has an exports field that says index.js is only importable via import statements) and fails at runtime when importing with import (because webpack throws an error if an ESM module tries to set module.exports)

https://stackoverflow.com/a/42450109/4966649

Repro:

mkdir src
echo 'import { WASI } from "@bjorn3/browser_wasi_shim"' > src/index.js
npm install webpack webpack-cli @bjorn3/browser_wasi_shim
npx webpack
node dist/main.js

Expected clean exit, got Error: ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead


Less importantly, it would be great if @bjorn3/browser_wasi_shim could provide a UMD build so that it's easy to just do something like

<script src="//unpkg.com/@bjorn/browser_wasi_shim"></script>
<script>
  const { WASI } = window['@bjorn/browser_wasi_shim']
  new WASI(...)
</script>

For now, I can just bundle the package myself with webpack.

Missing license

I'm interested in using this library, but I noticed there's no license file and no license specified in package.json. Would you mind adding one?

Migrate from flow to typescript

I originally chose flow over typescript because it allows putting type definitions in comments and as such doesn't require a separate compilation step. Unfortunately flow has several limitations including not supporting bigints and some incorrect builtin type declarations. As such I think using typescript is better in the long term.

Example in README does not typecheck

I'm trying to use this package, but, copying the code from the readme leaves me with code that doesn't compile.

Is this still a valid example for a simple usage?

example seems not working ?

Hi, I tried to play the example accoding to https://github.com/bjorn3/browser_wasi_shim#running-the-demo, but the last console log show some error error: could not exec the linker `cc` .

Details ``` INFO rustc_metadata::creader resolving crate `alloc` INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate alloc hash: `4cdff557b4f8f5eaa2be97db4a46b77e` extra filename: `-359908cdc7960fbe` INFO rustc_metadata::creader resolving crate `alloc` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_alloc hash: `5c7139335b5420398cbdde0fc376acca` extra filename: `-f8e02d7936a431a0` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_alloc` INFO rustc_metadata::creader resolving dep crate std_detect hash: `64702ab81b85b7167eaf70713c2e32f7` extra filename: `-81d31c776664c1e1` INFO rustc_metadata::creader resolving crate `std_detect` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-81d31c776664c1e1.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-81d31c776664c1e1.rlib INFO rustc_metadata::creader register crate `std_detect` (cnum = 13. private_dep = true) INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_alloc hash: `5c7139335b5420398cbdde0fc376acca` extra filename: `-f8e02d7936a431a0` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_alloc` INFO rustc_metadata::creader resolving dep crate alloc hash: `4cdff557b4f8f5eaa2be97db4a46b77e` extra filename: `-359908cdc7960fbe` INFO rustc_metadata::creader resolving crate `alloc` INFO rustc_metadata::creader resolving dep crate cfg_if hash: `628cbaf1e54da15e2a8d958ebd13728c` extra filename: `-7473f3420f2605c3` INFO rustc_metadata::creader resolving crate `cfg_if` INFO rustc_metadata::creader resolving dep crate rustc_demangle hash: `425abdb69b12c79bd43fb3c7a6933a5f` extra filename: `-a99802d1dda40ccf` INFO rustc_metadata::creader resolving crate `rustc_demangle` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a99802d1dda40ccf.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a99802d1dda40ccf.rlib INFO rustc_metadata::creader register crate `rustc_demangle` (cnum = 14. private_dep = true) INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate addr2line hash: `de982ca3a11c2edd93cf7849b896842a` extra filename: `-3368a2ecf632bfc6` INFO rustc_metadata::creader resolving crate `addr2line` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-3368a2ecf632bfc6.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-3368a2ecf632bfc6.rlib INFO rustc_metadata::creader register crate `addr2line` (cnum = 15. private_dep = true) INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_alloc hash: `5c7139335b5420398cbdde0fc376acca` extra filename: `-f8e02d7936a431a0` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_alloc` INFO rustc_metadata::creader resolving dep crate alloc hash: `4cdff557b4f8f5eaa2be97db4a46b77e` extra filename: `-359908cdc7960fbe` INFO rustc_metadata::creader resolving crate `alloc` INFO rustc_metadata::creader resolving dep crate gimli hash: `64496d76cc0eee0af281d6a2c527d94d` extra filename: `-803608e8717daecb` INFO rustc_metadata::creader resolving crate `gimli` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-803608e8717daecb.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-803608e8717daecb.rlib INFO rustc_metadata::creader register crate `gimli` (cnum = 16. private_dep = false) INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_alloc hash: `5c7139335b5420398cbdde0fc376acca` extra filename: `-f8e02d7936a431a0` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_alloc` INFO rustc_metadata::creader resolving dep crate alloc hash: `4cdff557b4f8f5eaa2be97db4a46b77e` extra filename: `-359908cdc7960fbe` INFO rustc_metadata::creader resolving crate `alloc` INFO rustc_metadata::creader resolving dep crate gimli hash: `64496d76cc0eee0af281d6a2c527d94d` extra filename: `-803608e8717daecb` INFO rustc_metadata::creader resolving crate `gimli` INFO rustc_metadata::creader resolving dep crate object hash: `7cab393c58eab90f8ca1de31ba848680` extra filename: `-95dcb95966ee8da6` INFO rustc_metadata::creader resolving crate `object` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-95dcb95966ee8da6.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-95dcb95966ee8da6.rlib INFO rustc_metadata::creader register crate `object` (cnum = 17. private_dep = true) INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_alloc hash: `5c7139335b5420398cbdde0fc376acca` extra filename: `-f8e02d7936a431a0` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_alloc` INFO rustc_metadata::creader resolving dep crate alloc hash: `4cdff557b4f8f5eaa2be97db4a46b77e` extra filename: `-359908cdc7960fbe` INFO rustc_metadata::creader resolving crate `alloc` INFO rustc_metadata::creader resolving dep crate memchr hash: `3e90bc9a54dbd72be5595961533c2eec` extra filename: `-c435600275d2183b` INFO rustc_metadata::creader resolving crate `memchr` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-c435600275d2183b.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-c435600275d2183b.rlib INFO rustc_metadata::creader register crate `memchr` (cnum = 18. private_dep = false) INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate memchr hash: `3e90bc9a54dbd72be5595961533c2eec` extra filename: `-c435600275d2183b` INFO rustc_metadata::creader resolving crate `memchr` INFO rustc_metadata::creader resolving dep crate panic_unwind hash: `6c4e9780454068798b01a415dc6165df` extra filename: `-bc7d0e983bae92ba` INFO rustc_metadata::creader resolving crate `panic_unwind` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-bc7d0e983bae92ba.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-bc7d0e983bae92ba.rlib INFO rustc_metadata::creader register crate `panic_unwind` (cnum = 19. private_dep = true) INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate alloc hash: `4cdff557b4f8f5eaa2be97db4a46b77e` extra filename: `-359908cdc7960fbe` INFO rustc_metadata::creader resolving crate `alloc` INFO rustc_metadata::creader resolving dep crate cfg_if hash: `628cbaf1e54da15e2a8d958ebd13728c` extra filename: `-7473f3420f2605c3` INFO rustc_metadata::creader resolving crate `cfg_if` INFO rustc_metadata::creader resolving dep crate unwind hash: `86a7759dd9eb21ce4bf7ad49b2a46db2` extra filename: `-8ca3e01a84805f9e` INFO rustc_metadata::creader resolving crate `unwind` INFO rustc_metadata::creader resolving dep crate libc hash: `83f472bb421e2661a70180cc8412fe16` extra filename: `-5175310f1f21926c` INFO rustc_metadata::creader resolving crate `libc` ┐rustc_expand::mbe::macro_rules::expand_macro sp=/hello.rs:1:13: 1:37 (#0), def_span=/home/gh-bjorn3/rust/library/std/src/macros.rs:138:1: 138:21 (#0), node_id=NodeId(4294967040), name=println#0 ┘ INFO rustc_resolve::effective_visibilities resolve::effective_visibilities: EffectiveVisibilities { map: { DefId(0:0 ~ hello[2490]): EffectiveVisibility { direct: Public, reexported: Public, reachable: Public, reachable_through_impl_trait: Public, }, }, } INFO rustc_metadata::creader injecting a dep from 1 to 19 INFO rustc_metadata::creader panic runtime not found -- loading panic_abort INFO rustc_metadata::creader resolving crate `panic_abort` INFO rustc_metadata::creader falling back to a load INFO rustc_metadata::locator lib candidate: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort-b427edf763e95e4b.rlib INFO rustc_metadata::locator rlib reading metadata from: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort-b427edf763e95e4b.rlib INFO rustc_metadata::creader register crate `panic_abort` (cnum = 20. private_dep = false) INFO rustc_metadata::creader resolving dep crate core hash: `6de7058767466585d20b0dfdf8f1fb29` extra filename: `-4b8e8a815d049db3` INFO rustc_metadata::creader resolving crate `core` INFO rustc_metadata::creader resolving dep crate compiler_builtins hash: `2aaa0f8a220dc43fdaafa551ac3d023d` extra filename: `-71ea7cc1bc898fb7` INFO rustc_metadata::creader resolving crate `compiler_builtins` INFO rustc_metadata::creader resolving dep crate rustc_std_workspace_core hash: `c8de91f6e2009ca66eb6ece9953c7782` extra filename: `-5d8a121daa7eeaa9` INFO rustc_metadata::creader resolving crate `rustc_std_workspace_core` INFO rustc_metadata::creader resolving dep crate cfg_if hash: `628cbaf1e54da15e2a8d958ebd13728c` extra filename: `-7473f3420f2605c3` INFO rustc_metadata::creader resolving crate `cfg_if` INFO rustc_metadata::creader resolving dep crate libc hash: `83f472bb421e2661a70180cc8412fe16` extra filename: `-5175310f1f21926c` INFO rustc_metadata::creader resolving crate `libc` INFO rustc_metadata::creader injecting a dep from 1 to 20 INFO rustc_metadata::creader resolved crates: name: std cnum: 1 hash: a4a4662376d90ba35b9cb67dce1539cc reqd: Explicit dylib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-7b943f62dbb7006a.so rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-7b943f62dbb7006a.rlib name: core cnum: 2 hash: 6de7058767466585d20b0dfdf8f1fb29 reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-4b8e8a815d049db3.rlib name: compiler_builtins cnum: 3 hash: 2aaa0f8a220dc43fdaafa551ac3d023d reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-71ea7cc1bc898fb7.rlib name: rustc_std_workspace_core cnum: 4 hash: c8de91f6e2009ca66eb6ece9953c7782 reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-5d8a121daa7eeaa9.rlib name: alloc cnum: 5 hash: 4cdff557b4f8f5eaa2be97db4a46b77e reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-359908cdc7960fbe.rlib name: libc cnum: 6 hash: 83f472bb421e2661a70180cc8412fe16 reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-5175310f1f21926c.rlib name: unwind cnum: 7 hash: 86a7759dd9eb21ce4bf7ad49b2a46db2 reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-8ca3e01a84805f9e.rlib name: cfg_if cnum: 8 hash: 628cbaf1e54da15e2a8d958ebd13728c reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-7473f3420f2605c3.rlib name: miniz_oxide cnum: 9 hash: a7e5c82c1c71ebbbb2c56eda756cc5aa reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-d34599dcae36be0e.rlib name: adler cnum: 10 hash: 8b5845fe78a2c7157d17cc6385119dfc reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-16845f650eeea12c.rlib name: hashbrown cnum: 11 hash: cd2bc76be3a0fa579e4900a34f24e7e2 reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-78466a7e64363027.rlib name: rustc_std_workspace_alloc cnum: 12 hash: 5c7139335b5420398cbdde0fc376acca reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-f8e02d7936a431a0.rlib name: std_detect cnum: 13 hash: 64702ab81b85b7167eaf70713c2e32f7 reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-81d31c776664c1e1.rlib name: rustc_demangle cnum: 14 hash: 425abdb69b12c79bd43fb3c7a6933a5f reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-a99802d1dda40ccf.rlib name: addr2line cnum: 15 hash: de982ca3a11c2edd93cf7849b896842a reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-3368a2ecf632bfc6.rlib name: gimli cnum: 16 hash: 64496d76cc0eee0af281d6a2c527d94d reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-803608e8717daecb.rlib name: object cnum: 17 hash: 7cab393c58eab90f8ca1de31ba848680 reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-95dcb95966ee8da6.rlib name: memchr cnum: 18 hash: 3e90bc9a54dbd72be5595961533c2eec reqd: Explicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-c435600275d2183b.rlib name: panic_unwind cnum: 19 hash: 6c4e9780454068798b01a415dc6165df reqd: Implicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-bc7d0e983bae92ba.rlib name: panic_abort cnum: 20 hash: 30b624004a3e75b1c5b74e2e0eb05b2f reqd: Implicit rlib: /sysroot/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_abort-b427edf763e95e4b.rlib

INFO rustc_interface::passes 0 parse sess buffered_lints
┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=()

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=InstantiatedPredicates { predicates: [], spans: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=()

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=()

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<() as std::process::Termination>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<() as std::process::Termination>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=Binder { value: fn(), bound_vars: [] }

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=fn()

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=InstantiatedPredicates { predicates: [], spans: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=FnDef(DefId(1:3322 ~ std[56f0]::io::stdio::print), [])

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=fn(std::fmt::Arguments<'?1>)

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?2>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?2>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?3>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=None

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=InstantiatedPredicates { predicates: [], spans: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=['?3, ?0e: bool]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=InstantiatedPredicates { predicates: [Binder { value: ConstArgHasType(?0e: bool, bool), bound_vars: [] }], spans: [/home/gh-bjorn3/rust/library/core/src/fmt/mod.rs:321:9: 321:14 (#0)] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=FnDef(DefId(2:9612 ~ core[a167]::fmt::{impl#2}::new_const), ['?3, ?0e: bool])

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?3>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?2>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?1, '?1), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?2, '?2), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=fn(&'?3 [&ReStatic str]) -> std::fmt::Arguments<'?3>

┐rustc_hir_typeck::coercion::coerce a=&ReStatic str, b=&ReStatic str
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&
as std::ops::CoerceUnsized<&>>
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&
as std::ops::CoerceUnsized<&>>
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?7, '?6), bound_vars: [] }
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<
as std::marker::Unsize<>>, polarity:Positive), bound_vars: [] }
├─┘

┐rustc_hir_typeck::coercion::coerce a=&'?4 [&ReStatic str; 1_usize], b=&'?3 [&ReStatic str]
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&
as std::ops::CoerceUnsized<&>>
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&
as std::ops::CoerceUnsized<&>>
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?9, '?8), bound_vars: [] }
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<
as std::marker::Unsize<>>, polarity:Positive), bound_vars: [] }
├─┘

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate([&ReStatic str], '?3), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<&'static str as std::marker::Sized>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate(str, ReStatic), bound_vars: [] }

┐rustc_hir_typeck::coercion::coerce a=std::fmt::Arguments<'?3>, b=std::fmt::Arguments<'?1>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?3, '?3), bound_vars: [] }

┐rustc_hir_typeck::coercion::coerce a=(), b=()

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?0>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=()

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=&'?3 [&ReStatic str]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?3>

┐rustc_span::source_map::find_width_of_character_at_span forwards=false

┐rustc_span::source_map::find_width_of_character_at_span forwards=false

┐rustc_span::source_map::find_width_of_character_at_span forwards=false

┐rustc_span::source_map::find_width_of_character_at_span forwards=false

┐rustc_span::source_map::find_width_of_character_at_span forwards=false

┐rustc_span::source_map::find_width_of_character_at_span forwards=false

┐rustc_span::source_map::find_width_of_character_at_span forwards=false

┐rustc_mir_build::build::expr::as_constant::lit_to_mir_constant

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<std::fmt::Arguments<'
> as std::marker::Copy>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<std::fmt::Arguments<'> as std::marker::Copy>

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: ConstArgHasType(host/#1: bool, bool), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=FnDef(DefId(2:9612 ~ core[a167]::fmt::{impl#2}::new_const), ['?1, ?0e: bool])

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=Binder { value: ConstArgHasType(?0e: bool, bool), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?2>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=std::fmt::Arguments<'?1>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?1, '?1), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: ConstArgHasType(true, bool), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&
as std::ops::CoerceUnsized<&>>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?5, '?4), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<
as std::marker::Unsize<>>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate([&ReStatic str], '?0), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<&'static str as std::marker::Sized>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate(str, ReStatic), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: OutlivesPredicate('?0, '?0), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<std::fmt::Arguments<'
> as std::marker::Copy>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<std::fmt::Arguments<'_> as std::marker::Copy>

┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [[&ReErased str]], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [[&ReErased str]], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(usize) with 0 obligations
┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [[core::fmt::rt::Placeholder]], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [[core::fmt::rt::Placeholder]], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(usize) with 0 obligations
┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [[core::fmt::rt::Argument]], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [[core::fmt::rt::Argument]], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(usize) with 0 obligations
┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: OutlivesPredicate(ReEarlyParam(DefId(2:42784 ~ core[a167]::fmt::Arguments::'a), 0, 'a), ReEarlyParam(DefId(2:42784 ~ core[a167]::fmt::Arguments::'a), 0, 'a)), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [str], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [str], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(usize) with 0 obligations
┐rustc_const_eval::interpret::eval_context::frame main
├─┐rustc_const_eval::interpret::eval_context::frame main
│ ├─ 4ms INFO rustc_const_eval::interpret::step _1 = [const "Hello World!\n"]
│ ├─ 27ms INFO rustc_const_eval::interpret::step _0 = &_1
│ ├─ 30ms INFO rustc_const_eval::interpret::step return
│ ├─ 35ms INFO rustc_const_eval::interpret::eval_context popping stack frame (returning from function)
├─┘

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

INFO rustc_interface::passes Pre-codegen
Ty interner total ty lt ct all
Adt : 25 9.8%, 0.0% 3.9% 0.0% 0.0%
Array : 12 4.7%, 0.0% 3.5% 0.0% 0.0%
Slice : 11 4.3%, 0.0% 2.0% 0.0% 0.0%
RawPtr : 1 0.4%, 0.0% 0.0% 0.0% 0.0%
Ref : 59 23.0%, 2.3% 15.2% 0.0% 0.0%
FnDef : 11 4.3%, 0.0% 2.3% 0.8% 0.0%
FnPtr : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Placeholder : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Coroutine : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
CoroutineWitness : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Dynamic : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Closure : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Tuple : 1 0.4%, 0.0% 0.0% 0.0% 0.0%
Bound : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Param : 6 2.3%, 0.0% 0.0% 0.0% 0.0%
Infer : 126 49.2%, 39.1% 0.0% 0.0% 0.0%
Alias : 4 1.6%, 0.0% 0.0% 0.0% 0.0%
Foreign : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
total 256 41.4% 27.0% 0.8% 0.0%
GenericArgs interner: #87
Region interner: #549
Const Allocation interner: #3
Layout interner: #9

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: TraitPredicate(<() as std::marker::Sized>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<() as std::process::Termination>, polarity:Positive), bound_vars: [] }, Binder { value: OutlivesPredicate((), ReStatic), bound_vars: [] }]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<() as std::process::Termination>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<() as std::process::Termination>

┐rustc_const_eval::interpret::eval_context::frame Arguments::<'>::new_const
├─ 12ms INFO rustc_const_eval::interpret::step 1 = [const "invalid args"]
├─ 18ms INFO rustc_const_eval::interpret::step 0 = &1
├─ 23ms INFO rustc_const_eval::interpret::step return
├─ 27ms INFO rustc_const_eval::interpret::eval_context popping stack frame (returning from function)

┐rustc_const_eval::interpret::eval_context::frame Arguments::<'
>::new_const
├─ 5ms INFO rustc_const_eval::interpret::step 1 = []
├─┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [Foreign(DefId(2:9570 ~ core[a167]::fmt::rt::{extern#0}::Opaque))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
│ ├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Foreign(DefId(2:9570 ~ core[a167]::fmt::rt::{extern#0}::Opaque))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
│ ├─┘
├─┘
├─ 56ms INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(()) with 0 obligations
├─┐rustc_trait_selection::traits::fully_normalize
│ ├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
│ ├─┘
├─┘
├─┐rustc_infer::infer::lexical_region_resolve::collect_errors
├─┘
├─┐rustc_trait_selection::traits::fully_normalize
│ ├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
│ ├─┘
├─┘
├─┐rustc_infer::infer::lexical_region_resolve::collect_errors
├─┘
├─118ms INFO rustc_const_eval::interpret::step 0 = &1
├─122ms INFO rustc_const_eval::interpret::step return
├─126ms INFO rustc_const_eval::interpret::eval_context popping stack frame (returning from function)

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: TraitPredicate(<Self as std::ops::FnMut>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<Self as std::ops::FnOnce>, polarity:Positive), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&mut _ as std::ops::DispatchFromDyn<&mut >>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&mut _ as std::ops::DispatchFromDyn<&mut >>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<
as std::marker::Unsize<
>>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [dyn [Binder(Trait(std::ops::FnMut), [])] + ReErased], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [dyn [Binder(Trait(std::ops::FnMut), [])] + ReErased], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(std::ptr::DynMetadata<dyn [Binder(Trait(std::ops::FnMut), [])] + ReErased>) with 0 obligations
┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [Foreign(DefId(2:1778 ~ core[a167]::ptr::metadata::{extern#0}::VTable))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Foreign(DefId(2:1778 ~ core[a167]::ptr::metadata::{extern#0}::VTable))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(()) with 0 obligations
┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=(Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnMut<()>>, bound_vars: [] }, Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnMut<()>>, bound_vars: [] })

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: TraitPredicate(<Self as std::ops::Fn>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<Self as std::ops::FnMut>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(<Self as std::ops::FnOnce>, polarity:Positive), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&
as std::ops::DispatchFromDyn<&
>>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<&
as std::ops::DispatchFromDyn<&
>>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<
as std::marker::Unsize<
>>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [dyn [Binder(Trait(std::ops::Fn), [])] + ReErased], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [dyn [Binder(Trait(std::ops::Fn), [])] + ReErased], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(std::ptr::DynMetadata<dyn [Binder(Trait(std::ops::Fn), [])] + ReErased>) with 0 obligations
┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [Foreign(DefId(2:1778 ~ core[a167]::ptr::metadata::{extern#0}::VTable))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Foreign(DefId(2:1778 ~ core[a167]::ptr::metadata::{extern#0}::VTable))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(()) with 0 obligations
┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=(Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::Fn<()>>, bound_vars: [] }, Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::Fn<()>>, bound_vars: [] })

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder(fn(), [])

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: TraitPredicate(<Self as std::ops::FnOnce>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=(Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>, bound_vars: [] }, Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>, bound_vars: [] })

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=<() as std::process::Termination>

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=(Binder { value: <fn() as std::ops::FnOnce<()>>, bound_vars: [] }, Binder { value: <fn() as std::ops::FnOnce<()>>, bound_vars: [] })

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=()

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_const_eval::interpret::eval_context::frame libc::unix::linux_like::EXIT_SUCCESS
├─ 6ms INFO rustc_const_eval::interpret::step _0 = const 0_i32
├─ 13ms INFO rustc_const_eval::interpret::step return
├─ 19ms INFO rustc_const_eval::interpret::eval_context popping stack frame (returning from function)

┐rustc_const_eval::interpret::eval_context::frame std::sys::unix::process::process_common::ExitCode::SUCCESS
├─ 6ms INFO rustc_const_eval::interpret::step StorageLive(_1)
├─ 11ms INFO rustc_const_eval::interpret::step StorageLive(_2)
├─ 17ms INFO rustc_const_eval::interpret::step _2 = const _ as u8 (IntToInt)
├─ 28ms INFO rustc_const_eval::interpret::step _1 = _2
├─ 34ms INFO rustc_const_eval::interpret::step _0 = std::sys::unix::process::process_common::ExitCode(move _1)
├─ 40ms INFO rustc_const_eval::interpret::step StorageDead(_2)
├─ 46ms INFO rustc_const_eval::interpret::step StorageDead(_1)
├─ 51ms INFO rustc_const_eval::interpret::step return
├─ 56ms INFO rustc_const_eval::interpret::eval_context popping stack frame (returning from function)

┐rustc_const_eval::interpret::eval_context::frame ExitCode::SUCCESS
├─ 5ms INFO rustc_const_eval::interpret::step _0 = ExitCode(const _)
├─ 10ms INFO rustc_const_eval::interpret::step return
├─ 15ms INFO rustc_const_eval::interpret::eval_context popping stack frame (returning from function)

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: ProjectionPredicate(AliasTy { args: [F/#0, ()], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }, Term::Ty(T/#1)), bound_vars: [] }, Binder { value: TraitPredicate(<F as std::ops::FnOnce<()>>, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }, Binder { value: TraitPredicate(, polarity:Positive), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: OutlivesPredicate(T/#0, ReStatic), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [Self/#0, Args/#1], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }, depth=0)

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(Alias(Projection, AliasTy { args: [Self/#0, Args/#1], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) })) with 0 obligations
┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [Closure(DefId(1:46 ~ std[56f0]::rt::lang_start::{closure#0}), [(), i8, Binder(extern "RustCall" fn(()) -> i32, []), (Binder(fn(), []),)]), ()], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=(Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>, bound_vars: [] }, Binder { value: <{closure@std::rt::lang_start<()>::{closure#0}} as std::ops::FnOnce<()>>, bound_vars: [] })
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: extern "RustCall" fn(()) -> i32, bound_vars: [] }
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Closure(DefId(1:46 ~ std[56f0]::rt::lang_start::{closure#0}), [(), i8, Binder(extern "RustCall" fn(()) -> i32, []), (Binder(fn(), []),)]), ()], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Closure(DefId(1:46 ~ std[56f0]::rt::lang_start::{closure#0}), [(), i8, Binder(extern "RustCall" fn(()) -> i32, []), (Binder(fn(), []),)]), ()], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(i32) with 0 obligations
┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [Binder(fn(), []), ()], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=(Binder { value: <fn() as std::ops::FnOnce<()>>, bound_vars: [] }, Binder { value: <fn() as std::ops::FnOnce<()>>, bound_vars: [] })
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=()
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: fn(), bound_vars: [] }
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Binder(fn(), []), ()], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }
├─┘
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Binder(fn(), []), ()], def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(()) with 0 obligations
┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=Binder { value: TraitPredicate(<{closure@std::rt::lang_start<()>::{closure#0}} as std::marker::Unpin>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=(Binder(fn(), []),)

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=3, value=Binder { value: TraitPredicate(<(fn(),) as std::marker::Unpin>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=3, value=Binder(fn(), [])

┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=4, value=Binder { value: TraitPredicate(<fn() as std::marker::Unpin>, polarity:Positive), bound_vars: [] }

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [dyn [Binder(Trait(std::ops::Fn<()>), []), Binder(Projection(ExistentialProjection { def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output), args: [()], term: Term::Ty(i32) }), []), Binder(AutoTrait(DefId(2:2805 ~ core[a167]::marker::Sync)), []), Binder(AutoTrait(DefId(2:8670 ~ core[a167]::panic::unwind_safe::RefUnwindSafe)), [])] + ReErased], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [dyn [Binder(Trait(std::ops::Fn<()>), []), Binder(Projection(ExistentialProjection { def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output), args: [()], term: Term::Ty(i32) }), []), Binder(AutoTrait(DefId(2:2805 ~ core[a167]::marker::Sync)), []), Binder(AutoTrait(DefId(2:8670 ~ core[a167]::panic::unwind_safe::RefUnwindSafe)), [])] + ReErased], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(std::ptr::DynMetadata<dyn [Binder(Trait(std::ops::Fn<()>), []), Binder(Projection(ExistentialProjection { def_id: DefId(2:3058 ~ core[a167]::ops::function::FnOnce::Output), args: [()], term: Term::Ty(i32) }), []), Binder(AutoTrait(DefId(2:2805 ~ core[a167]::marker::Sync)), []), Binder(AutoTrait(DefId(2:8670 ~ core[a167]::panic::unwind_safe::RefUnwindSafe)), [])] + ReErased>) with 0 obligations
┐rustc_trait_selection::traits::project::project obligation=Obligation(predicate=AliasTy { args: [Foreign(DefId(2:1778 ~ core[a167]::ptr::metadata::{extern#0}::VTable))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }, depth=0)
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=1, value=AliasTy { args: [Foreign(DefId(2:1778 ~ core[a167]::ptr::metadata::{extern#0}::VTable))], def_id: DefId(2:1751 ~ core[a167]::ptr::metadata::Pointee::Metadata) }
├─┘

INFO rustc_trait_selection::traits::query::normalize normalize::<rustc_middle::ty::generic_args::GenericArg>: result=Ok(()) with 0 obligations
┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[Binder { value: ConstArgHasType(host/#0: bool, bool), bound_vars: [] }]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

┐rustc_trait_selection::traits::fully_normalize
├─┐rustc_trait_selection::traits::project::normalize_with_depth_to depth=0, value=[]
├─┘

┐rustc_infer::infer::lexical_region_resolve::collect_errors

INFO rustc_interface::passes Post-codegen
Ty interner total ty lt ct all
Adt : 46 11.4%, 0.0% 2.5% 0.0% 0.0%
Array : 14 3.5%, 0.0% 2.2% 0.0% 0.0%
Slice : 11 2.7%, 0.0% 1.2% 0.0% 0.0%
RawPtr : 15 3.7%, 0.0% 0.0% 0.0% 0.0%
Ref : 117 28.9%, 2.5% 11.6% 0.0% 0.0%
FnDef : 33 8.1%, 0.0% 1.5% 0.5% 0.0%
FnPtr : 6 1.5%, 0.0% 0.0% 0.0% 0.0%
Placeholder : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Coroutine : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
CoroutineWitness : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Dynamic : 7 1.7%, 0.0% 0.0% 0.0% 0.0%
Closure : 2 0.5%, 0.0% 0.0% 0.0% 0.0%
Tuple : 3 0.7%, 0.0% 0.0% 0.0% 0.0%
Bound : 0 0.0%, 0.0% 0.0% 0.0% 0.0%
Param : 11 2.7%, 0.0% 0.0% 0.0% 0.0%
Infer : 126 31.1%, 24.7% 0.0% 0.0% 0.0%
Alias : 12 3.0%, 0.0% 0.0% 0.0% 0.0%
Foreign : 2 0.5%, 0.0% 0.0% 0.0% 0.0%
total 405 27.2% 19.0% 0.5% 0.0%
GenericArgs interner: #145
Region interner: #563
Const Allocation interner: #13
Layout interner: #28

INFO rustc_codegen_ssa::back::link preparing Executable to "hello"
INFO rustc_codegen_ssa::back::link
error: could not exec the linker cc
|
= note: operation not supported on this platform
= note:

Done

</details> 

Include `ConsoleStdout` for incremental output?

I find ConsoleStdout from an existing test very useful to incrementally get log output while running WASI programs that use stdout/stderr:

class ConsoleStdout extends Fd {
constructor(write) {
super();
this.write = write;
}
fd_filestat_get() {
const filestat = new wasi.Filestat(
wasi.FILETYPE_CHARACTER_DEVICE,
BigInt(0),
);
return { ret: 0, filestat };
}
fd_fdstat_get() {
const fdstat = new wasi.Fdstat(wasi.FILETYPE_CHARACTER_DEVICE, 0);
fdstat.fs_rights_base = BigInt(wasi.RIGHTS_FD_WRITE);
return { ret: 0, fdstat };
}
fd_write(view8, iovs) {
let nwritten = 0;
for (let iovec of iovs) {
let buffer = view8.slice(iovec.buf, iovec.buf + iovec.buf_len);
this.write(buffer);
nwritten += iovec.buf_len;
}
return { ret: 0, nwritten };
}
}

In particular, in conjunction with an additional static method

  static lineBuffered(write) {
    const dec = new TextDecoder("utf-8", { fatal: false });
    let line_buf = "";
    return new ConsoleStdout((buffer) => {
      line_buf += dec.decode(buffer, { stream: true });
      const lines = line_buf.split("\n");
      for (const [i, line] of lines.entries()) {
        if (i < lines.length - 1) {
          write(line);
        } else {
          line_buf = line;
        }
      }
    });
  }

which can eg be used like this

[
  new OpenFile(new File([])), // stdin
  ConsoleStdout.lineBuffered(msg => console.log(`[WASI stdout] ${msg}`)),
  ConsoleStdout.lineBuffered(msg => console.warn(`[WASI stderr] ${msg}`)),
]

Is it in scope to add this to the library such that it can be reused by other projects? If so, happy to create a PR.

Circular dependency between `fs_core.ts` <-> `fs_fd.ts`

Currently fs_core.ts and fs_fd.ts import each other. Fortunately it does not cause any problem at the moment, but Rollup conservatively warns about this. (I faced it while changing default bundled WASI implementation of ruby.wasm: ruby/ruby.wasm#332)

$ npx rollup ./dist/index.js -o /dev/null
./dist/index.js → ../../../../../../dev/null...
(!) Circular dependency
dist/fs_core.js -> dist/fs_fd.js -> dist/fs_core.js
created ../../../../../../dev/null in 174ms

There are some options to address this issue. Which option do you like, @bjorn3? I personally prefer 2. since it is the simplest and does not change any public API.

  1. Just ignore the warning or fix rollup to produce more precise cycle detection
  2. Merge fs_core.ts and fs_fd.ts
  3. Re-organize fs_core.ts and fs_fd.ts's API to avoid cycle

Instantiate a wasm library

Hey @bjorn3,
Thanks for sharing this library - exciting stuff!

I've been trying to find a way to invoke a function on a wasm32-wasi library. As it is a library is has no start function.
Is there a way to avoid calling wasi.start(instance) and instead just call functions exported by the instance?

Something along these lines perhaps?

wasi.invoke(instance.exports.my_func)

Would be awesome - please let me know if I'm just missing something

Leaving `st_ino` as 0 can break applications

Some applications, such as Clang/LLVM compiled to WASI, will break in strange ways if st_ino is zero or the same for every file. Although a user can work around this by subclassing File and Directory and overriding stat to return a unique inode number (e.g. by incrementing a global variable, something like this), I feel like something like this should exist by default in fs_mem

Incidentally, I seem to recall reading a long time ago that leaving st_nlink as 0 can also cause issues, but I can't find evidence to back that up. In any case, the usual stub implementation that I can find (e.g. in examples for FUSE filesystems) sets nlink to 2 for all directories and 1 for all files. This is wrong, sorry. (very old versions of find would in fact fail if st_nlink was exactly 2 for all directories, and the workaround was to set it to 1. Search for subdirs_unreliable in https://git.savannah.gnu.org/cgit/findutils.git/commit/find?id=5768a03ddfb5e18b1682e339d6cdd24ff721c510 )

Wasm64 support

Hi! Thanks for this great library!

Just a heads up that I've run into an issue around BigInts when using 64-bit wasm. I know this is to be expected but figured I'd flag it all the same just to get it on your radar.

TypeError: Cannot mix BigInt and other types, use explicit conversions
    at Ciovec.read_bytes_array (file:///Users/stuff/node_modules/@bjorn3/browser_wasi_shim/dist/wasi_defs.js:1:4249)
    at fd_write (file:///Users/stuff/node_modules/@bjorn3/browser_wasi_shim/dist/wasi.js:1:8534)
    at wasm://wasm/00091766:wasm-function[206]:0x1ccc0
    at wasm://wasm/00091766:wasm-function[198]:0x1c83c
    at wasm://wasm/00091766:wasm-function[150]:0x14cf4
    at wasm://wasm/00091766:wasm-function[53]:0x878a
    at wasm://wasm/00091766:wasm-function[191]:0x196d9

Got error when I tried to open non-exists file

rust 1.78.0, target: wasm32-wasip1-threads
using std::fs::File::open, I tried open '/cache/system/font/Ko/NotoSansKR-Bold.woff2' which is not exists actually,
and I got error,

[WASI stderr] called `Result::unwrap()` on an `Err` value: Custom { kind: Uncategorized, error: "failed to find a pre-opened file descriptor through which \"/cache/__system__/font/Ko/NotoSansKR-Bold.woff2\" could be opened" }

maybe wasi-sdk problem...?

Support Wasm Component Model

@bjorn3 as I mentioned here bytecodealliance/jco#42 (comment) I think the way to go about supporting the component model is:

  1. Generate the files, imports and exports using the wasm-compiled js-component-bindgen-component
import { generate } from './js-component-bindgen-component.js`
let { files, imports, exports } = generate(component, opts);
  1. Write a Rollup plugin that takes the 3 generated bytes above and bundles them into an output.
  2. Consumers can then take the bundled output do things like inject it into <head><script>... so it can be used by the window.

Usage example doesn't work

Uncaught SyntaxError: The requested module '@bjorn3/browser_wasi_shim' does not provide an export named 'ConsoleStdout'

The usage example tells you to install from NPM and use code which imports ConsoleStdout. However, the NPM package doesn't have any code for ConsoleStdout because the changes from #67 were not published to NPM.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.