Skip to content

[Experiment] Use stackful generator for typeck to workaround WithOptConstParam #96843

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

nbdd0121
Copy link
Contributor

@nbdd0121 nbdd0121 commented May 8, 2022

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 8, 2022
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)

######################################################################## 100.0%
extracting /checkout/obj/build/cache/2022-04-05/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz
Building rustbuild
    Updating git repository `https://github.com/nbdd0121/stacker.git`
    Updating crates.io index
    Updating git repository `https://github.com/nbdd0121/stackful.git`
---
    Checking ena v0.14.0
    Checking polonius-engine v0.13.0
    Checking tracing-log v0.1.2
    Checking rustc_lexer v0.1.0 (/checkout/compiler/rustc_lexer)
   Compiling psm v0.1.18 (https://github.com/nbdd0121/stacker.git#eae7e163)
   Compiling stacker v0.1.14 (https://github.com/nbdd0121/stacker.git#eae7e163)
   Compiling stackful v0.1.3 (https://github.com/nbdd0121/stackful.git?branch=dev#5fedf72a)
    Checking quote v1.0.18
    Checking aho-corasick v0.7.18
    Checking rustc_parse_format v0.0.0 (/checkout/compiler/rustc_parse_format)
    Checking unicode-security v0.0.5
---
    Checking rustc_ast_lowering v0.0.0 (/checkout/compiler/rustc_ast_lowering)
    Checking rustc_ast_passes v0.0.0 (/checkout/compiler/rustc_ast_passes)
    Checking rustc_expand v0.0.0 (/checkout/compiler/rustc_expand)
    Checking rustc_builtin_macros v0.0.0 (/checkout/compiler/rustc_builtin_macros)
error[E0277]: `(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)` cannot be sent between threads safely
    --> compiler/rustc_middle/src/hir/map/mod.rs:531:61
     |
531  |                 par_iter(owner_info.nodes.bodies.range(..)).for_each(|(local_id, _)| {
     |                                                             ^^^^^^^^ `(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)` cannot be sent between threads safely
     |
     = help: the trait `Send` is not implemented for `(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)`
     = note: required because of the requirements on the impl of `Send` for `Unique<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>`
     = note: required because it appears within the type `std::boxed::Box<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>`
     = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>>`
     = note: required because it appears within the type `std::mem::ManuallyDrop<std::pin::Pin<std::boxed::Box<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>>>`
note: required because it appears within the type `TypeckResultGenerator<'hir>`
    --> compiler/rustc_middle/src/ty/context.rs:380:12
     |
380  | pub struct TypeckResultGenerator<'tcx>(
     |            ^^^^^^^^^^^^^^^^^^^^^
     = note: required because it appears within the type `Option<TypeckResultGenerator<'hir>>`
     = note: required because of the requirements on the impl of `Send` for `lock_api::rwlock::RwLock<parking_lot::raw_rwlock::RawRwLock, Option<TypeckResultGenerator<'hir>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::RwLock<Option<TypeckResultGenerator<'hir>>>`
     = note: required because it appears within the type `rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>`
     = note: required because of the requirements on the impl of `Send` for `TypedArena<rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>>`
note: required because it appears within the type `Arena<'hir>`
    --> /checkout/compiler/rustc_arena/src/lib.rs:552:16
     |
550  | /  pub macro declare_arena([$($a:tt $name:ident: $ty:ty,)*]) {
552  | |      pub struct Arena<'tcx> {
     | |                 ^^^^^
     | |                 ^^^^^
553  | |          pub dropless: $crate::DroplessArena,
625  | |      }
626  | |  }
626  | |  }
     | |__- in this expansion of `rustc_arena::declare_arena!` (#2)
    ::: compiler/rustc_middle/src/arena.rs:6:1
     |
     |
6    |  / macro_rules! arena_types {
7    |  |     ($macro:path) => (
8    |  |         $macro!([
     |  |________________-
9    | ||             [] layout: rustc_target::abi::LayoutS<'tcx>,
10   | ||             [] fn_abi: rustc_target::abi::call::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
11   | ||             // AdtDef are interned and compared by address
...    ||
106  | ||             [] steal_typeck_generator: rustc_data_structures::steal::Steal<rustc_middle::ty::TypeckResultGenerator<'tcx>>,
     | ||__________- in this macro invocation (#2)
108  |  |     )
109  |  | }
109  |  | }
     |  |_- in this expansion of `arena_types!` (#1)
110  | 
111  |    arena_types!(rustc_arena::declare_arena);
     |    ---------------------------------------- in this macro invocation (#1)
     = note: required because of the requirements on the impl of `std::marker::Sync` for `WorkerLocal<Arena<'hir>>`
     = note: required because it appears within the type `&'hir WorkerLocal<Arena<'hir>>`
note: required because it appears within the type `GlobalCtxt<'hir>`
    --> compiler/rustc_middle/src/ty/context.rs:1020:12
1020 | pub struct GlobalCtxt<'tcx> {
     |            ^^^^^^^^^^
     |            ^^^^^^^^^^
     = note: required because it appears within the type `&'hir GlobalCtxt<'hir>`
note: required because it appears within the type `context::TyCtxt<'hir>`
    --> compiler/rustc_middle/src/ty/context.rs:1008:12
1008 | pub struct TyCtxt<'tcx> {
     |            ^^^^^^
     |            ^^^^^^
note: required because it appears within the type `map::Map<'hir>`
    --> compiler/rustc_middle/src/hir/map/mod.rs:74:12
     |
74   | pub struct Map<'hir> {
     |            ^^^
     = note: required because it appears within the type `&map::Map<'hir>`
     = note: required because it appears within the type `[closure@compiler/rustc_middle/src/hir/map/mod.rs:531:70: 535:18]`
note: required by a bound in `rustc_data_structures::sync::ParallelIterator::for_each`
     |
     |
360  |         OP: Fn(Self::Item) + Sync + Send,
     |                              ^^^^ required by this bound in `rustc_data_structures::sync::ParallelIterator::for_each`

error[E0277]: `(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)` cannot be shared between threads safely
    --> compiler/rustc_middle/src/hir/map/mod.rs:531:61
     |
531  |                 par_iter(owner_info.nodes.bodies.range(..)).for_each(|(local_id, _)| {
     |                                                             ^^^^^^^^ `(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)` cannot be shared between threads safely
     |
     = help: the trait `std::marker::Sync` is not implemented for `(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `Unique<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>`
     = note: required because it appears within the type `std::boxed::Box<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>`
     = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>>`
     = note: required because it appears within the type `std::mem::ManuallyDrop<std::pin::Pin<std::boxed::Box<(dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &'hir TypeckResults<'hir>> + 'hir)>>>`
note: required because it appears within the type `TypeckResultGenerator<'hir>`
    --> compiler/rustc_middle/src/ty/context.rs:380:12
     |
380  | pub struct TypeckResultGenerator<'tcx>(
     |            ^^^^^^^^^^^^^^^^^^^^^
     = note: required because it appears within the type `Option<TypeckResultGenerator<'hir>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `lock_api::rwlock::RwLock<parking_lot::raw_rwlock::RawRwLock, Option<TypeckResultGenerator<'hir>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::RwLock<Option<TypeckResultGenerator<'hir>>>`
     = note: required because it appears within the type `rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>`
     = note: required because of the requirements on the impl of `Send` for `&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>`
     = note: required because it appears within the type `(&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>)`
     = note: required because it appears within the type `((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex)`
     = note: required because it appears within the type `((rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex))`
     = note: required because of the requirements on the impl of `Send` for `hashbrown::raw::RawTable<((rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex))>`
     = note: required because it appears within the type `hashbrown::map::HashMap<(rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex), BuildHasherDefault<FxHasher>>`
     = note: required because it appears within the type `HashMap<(rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex), BuildHasherDefault<FxHasher>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, HashMap<(rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `sharded::CacheAligned<rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>>`
     = note: required because it appears within the type `[sharded::CacheAligned<rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>>; 32]`
     = note: required because it appears within the type `Sharded<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `rustc_query_system::query::caches::DefaultCache<(rustc_span::def_id::LocalDefId, u32), (&'hir rustc_data_structures::steal::Steal<TypeckResultGenerator<'hir>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &'hir TypeckResults<'hir>>)>`
note: required because it appears within the type `QueryCaches<'hir>`
    --> compiler/rustc_middle/src/ty/query.rs:212:20
175  | /  macro_rules! define_callbacks {
175  | /  macro_rules! define_callbacks {
176  | |      (<$tcx:tt>
177  | |       $($(#[$attr:meta])*
178  | |          [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
...    |
212  | |          pub struct QueryCaches<$tcx> {
...    |
320  | |      };
321  | |  }
     | |__- in this expansion of `define_callbacks!` (#2)
---
     |  | -
     |  | |
     |  |_in this expansion of `rustc_query_append!` (#1)
     |    in this macro invocation (#2)
note: required because it appears within the type `GlobalCtxt<'hir>`
    --> compiler/rustc_middle/src/ty/context.rs:1020:12
1020 | pub struct GlobalCtxt<'tcx> {
     |            ^^^^^^^^^^
     |            ^^^^^^^^^^
     = note: required because it appears within the type `&'hir GlobalCtxt<'hir>`
note: required because it appears within the type `context::TyCtxt<'hir>`
    --> compiler/rustc_middle/src/ty/context.rs:1008:12
1008 | pub struct TyCtxt<'tcx> {
     |            ^^^^^^
     |            ^^^^^^
note: required because it appears within the type `map::Map<'hir>`
    --> compiler/rustc_middle/src/hir/map/mod.rs:74:12
     |
74   | pub struct Map<'hir> {
     |            ^^^
     = note: required because it appears within the type `&map::Map<'hir>`
     = note: required because it appears within the type `[closure@compiler/rustc_middle/src/hir/map/mod.rs:531:70: 535:18]`
note: required by a bound in `rustc_data_structures::sync::ParallelIterator::for_each`
     |
     |
360  |         OP: Fn(Self::Item) + Sync + Send,
     |                              ^^^^ required by this bound in `rustc_data_structures::sync::ParallelIterator::for_each`

error[E0277]: `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be sent between threads safely
    --> compiler/rustc_middle/src/hir/map/mod.rs:693:45
     |
693  |             par_iter(&items.submodules[..]).for_each(|&sm| par_iter_submodules(tcx, sm, f));
     |                                             ^^^^^^^^ `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be sent between threads safely
     |
     = help: the trait `Send` is not implemented for `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>`
     = note: required because of the requirements on the impl of `Send` for `Unique<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>`
     = note: required because it appears within the type `std::mem::ManuallyDrop<std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>>`
note: required because it appears within the type `TypeckResultGenerator<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:380:12
     |
380  | pub struct TypeckResultGenerator<'tcx>(
     |            ^^^^^^^^^^^^^^^^^^^^^
     = note: required because it appears within the type `Option<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `Send` for `lock_api::rwlock::RwLock<parking_lot::raw_rwlock::RawRwLock, Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::RwLock<Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `Send` for `TypedArena<rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>>`
note: required because it appears within the type `Arena<'_>`
    --> /checkout/compiler/rustc_arena/src/lib.rs:552:16
     |
550  | /  pub macro declare_arena([$($a:tt $name:ident: $ty:ty,)*]) {
552  | |      pub struct Arena<'tcx> {
     | |                 ^^^^^
     | |                 ^^^^^
553  | |          pub dropless: $crate::DroplessArena,
625  | |      }
626  | |  }
626  | |  }
     | |__- in this expansion of `rustc_arena::declare_arena!` (#2)
    ::: compiler/rustc_middle/src/arena.rs:6:1
     |
     |
6    |  / macro_rules! arena_types {
7    |  |     ($macro:path) => (
8    |  |         $macro!([
     |  |________________-
9    | ||             [] layout: rustc_target::abi::LayoutS<'tcx>,
10   | ||             [] fn_abi: rustc_target::abi::call::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
11   | ||             // AdtDef are interned and compared by address
...    ||
106  | ||             [] steal_typeck_generator: rustc_data_structures::steal::Steal<rustc_middle::ty::TypeckResultGenerator<'tcx>>,
     | ||__________- in this macro invocation (#2)
108  |  |     )
109  |  | }
109  |  | }
     |  |_- in this expansion of `arena_types!` (#1)
110  | 
111  |    arena_types!(rustc_arena::declare_arena);
     |    ---------------------------------------- in this macro invocation (#1)
     = note: required because of the requirements on the impl of `std::marker::Sync` for `WorkerLocal<Arena<'_>>`
     = note: required because it appears within the type `&WorkerLocal<Arena<'_>>`
note: required because it appears within the type `GlobalCtxt<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:1020:12
1020 | pub struct GlobalCtxt<'tcx> {
     |            ^^^^^^^^^^
     |            ^^^^^^^^^^
     = note: required because it appears within the type `&GlobalCtxt<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:1008:12
     |
1008 | pub struct TyCtxt<'tcx> {
     |            ^^^^^^
     |            ^^^^^^
     = note: required because it appears within the type `&context::TyCtxt<'_>`
     = note: required because it appears within the type `[closure@compiler/rustc_middle/src/hir/map/mod.rs:693:54: 693:91]`
note: required by a bound in `rustc_data_structures::sync::ParallelIterator::for_each`
     |
     |
360  |         OP: Fn(Self::Item) + Sync + Send,
     |                              ^^^^ required by this bound in `rustc_data_structures::sync::ParallelIterator::for_each`

error[E0277]: `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be shared between threads safely
    --> compiler/rustc_middle/src/hir/map/mod.rs:693:45
     |
693  |             par_iter(&items.submodules[..]).for_each(|&sm| par_iter_submodules(tcx, sm, f));
     |                                             ^^^^^^^^ `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be shared between threads safely
     |
     = help: the trait `std::marker::Sync` is not implemented for `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `Unique<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>`
     = note: required because it appears within the type `std::mem::ManuallyDrop<std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>>`
note: required because it appears within the type `TypeckResultGenerator<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:380:12
     |
380  | pub struct TypeckResultGenerator<'tcx>(
     |            ^^^^^^^^^^^^^^^^^^^^^
     = note: required because it appears within the type `Option<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `lock_api::rwlock::RwLock<parking_lot::raw_rwlock::RawRwLock, Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::RwLock<Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `Send` for `&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>`
     = note: required because it appears within the type `(&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>)`
     = note: required because it appears within the type `((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex)`
     = note: required because it appears within the type `((rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex))`
     = note: required because of the requirements on the impl of `Send` for `hashbrown::raw::RawTable<((rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex))>`
     = note: required because it appears within the type `hashbrown::map::HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>`
     = note: required because it appears within the type `HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `sharded::CacheAligned<rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>>`
     = note: required because it appears within the type `[sharded::CacheAligned<rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>>; 32]`
     = note: required because it appears within the type `Sharded<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `rustc_query_system::query::caches::DefaultCache<(rustc_span::def_id::LocalDefId, u32), (&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>)>`
note: required because it appears within the type `QueryCaches<'_>`
    --> compiler/rustc_middle/src/ty/query.rs:212:20
175  | /  macro_rules! define_callbacks {
175  | /  macro_rules! define_callbacks {
176  | |      (<$tcx:tt>
177  | |       $($(#[$attr:meta])*
178  | |          [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
...    |
212  | |          pub struct QueryCaches<$tcx> {
...    |
320  | |      };
321  | |  }
     | |__- in this expansion of `define_callbacks!` (#2)
---
    --> compiler/rustc_middle/src/ty/context.rs:1020:12
     |
1020 | pub struct GlobalCtxt<'tcx> {
     |            ^^^^^^^^^^
     = note: required because it appears within the type `&GlobalCtxt<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:1008:12
     |
1008 | pub struct TyCtxt<'tcx> {
     |            ^^^^^^
     |            ^^^^^^
     = note: required because it appears within the type `&context::TyCtxt<'_>`
     = note: required because it appears within the type `[closure@compiler/rustc_middle/src/hir/map/mod.rs:693:54: 693:91]`
note: required by a bound in `rustc_data_structures::sync::ParallelIterator::for_each`
     |
     |
360  |         OP: Fn(Self::Item) + Sync + Send,
     |                              ^^^^ required by this bound in `rustc_data_structures::sync::ParallelIterator::for_each`

error[E0277]: `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be sent between threads safely
    --> compiler/rustc_middle/src/ty/context.rs:1853:13
     |
1853 |             sync::assert_sync::<ImplicitCtxt<'_, '_>>();
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be sent between threads safely
     |
     = help: the trait `Send` is not implemented for `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>`
     = note: required because of the requirements on the impl of `Send` for `Unique<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>`
     = note: required because it appears within the type `std::mem::ManuallyDrop<std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>>`
note: required because it appears within the type `TypeckResultGenerator<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:380:12
     |
380  | pub struct TypeckResultGenerator<'tcx>(
     |            ^^^^^^^^^^^^^^^^^^^^^
     = note: required because it appears within the type `Option<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `Send` for `lock_api::rwlock::RwLock<parking_lot::raw_rwlock::RawRwLock, Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::RwLock<Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `Send` for `TypedArena<rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>>`
note: required because it appears within the type `Arena<'_>`
    --> /checkout/compiler/rustc_arena/src/lib.rs:552:16
     |
550  | /  pub macro declare_arena([$($a:tt $name:ident: $ty:ty,)*]) {
552  | |      pub struct Arena<'tcx> {
     | |                 ^^^^^
     | |                 ^^^^^
553  | |          pub dropless: $crate::DroplessArena,
625  | |      }
626  | |  }
626  | |  }
     | |__- in this expansion of `rustc_arena::declare_arena!` (#2)
    ::: compiler/rustc_middle/src/arena.rs:6:1
     |
     |
6    |  / macro_rules! arena_types {
7    |  |     ($macro:path) => (
8    |  |         $macro!([
     |  |________________-
9    | ||             [] layout: rustc_target::abi::LayoutS<'tcx>,
10   | ||             [] fn_abi: rustc_target::abi::call::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
11   | ||             // AdtDef are interned and compared by address
...    ||
106  | ||             [] steal_typeck_generator: rustc_data_structures::steal::Steal<rustc_middle::ty::TypeckResultGenerator<'tcx>>,
     | ||__________- in this macro invocation (#2)
108  |  |     )
109  |  | }
109  |  | }
     |  |_- in this expansion of `arena_types!` (#1)
110  | 
111  |    arena_types!(rustc_arena::declare_arena);
     |    ---------------------------------------- in this macro invocation (#1)
     = note: required because of the requirements on the impl of `std::marker::Sync` for `WorkerLocal<Arena<'_>>`
     = note: required because it appears within the type `&WorkerLocal<Arena<'_>>`
note: required because it appears within the type `GlobalCtxt<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:1020:12
1020 | pub struct GlobalCtxt<'tcx> {
     |            ^^^^^^^^^^
     |            ^^^^^^^^^^
     = note: required because it appears within the type `&GlobalCtxt<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:1008:12
     |
1008 | pub struct TyCtxt<'tcx> {
     |            ^^^^^^
     |            ^^^^^^
note: required because it appears within the type `ImplicitCtxt<'_, '_>`
    --> compiler/rustc_middle/src/ty/context.rs:1757:16
     |
1757 |     pub struct ImplicitCtxt<'a, 'tcx> {
note: required by a bound in `assert_sync`
    --> /checkout/compiler/rustc_data_structures/src/sync.rs:362:32
     |
     |
362  | pub fn assert_sync<T: ?Sized + Sync>() {}
     |                                ^^^^ required by this bound in `assert_sync`

error[E0277]: `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be shared between threads safely
    --> compiler/rustc_middle/src/ty/context.rs:1853:13
     |
1853 |             sync::assert_sync::<ImplicitCtxt<'_, '_>>();
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>` cannot be shared between threads safely
     |
     = help: the trait `std::marker::Sync` is not implemented for `dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `Unique<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>`
     = note: required because it appears within the type `std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>`
     = note: required because it appears within the type `std::mem::ManuallyDrop<std::pin::Pin<std::boxed::Box<dyn std::ops::Generator<Yield = (rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), Return = &TypeckResults<'_>>>>>`
note: required because it appears within the type `TypeckResultGenerator<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:380:12
     |
380  | pub struct TypeckResultGenerator<'tcx>(
     |            ^^^^^^^^^^^^^^^^^^^^^
     = note: required because it appears within the type `Option<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `lock_api::rwlock::RwLock<parking_lot::raw_rwlock::RawRwLock, Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::RwLock<Option<TypeckResultGenerator<'_>>>`
     = note: required because it appears within the type `rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>`
     = note: required because of the requirements on the impl of `Send` for `&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>`
     = note: required because it appears within the type `(&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>)`
     = note: required because it appears within the type `((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex)`
     = note: required because it appears within the type `((rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex))`
     = note: required because of the requirements on the impl of `Send` for `hashbrown::raw::RawTable<((rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex))>`
     = note: required because it appears within the type `hashbrown::map::HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>`
     = note: required because it appears within the type `HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>`
     = note: required because of the requirements on the impl of `std::marker::Sync` for `lock_api::mutex::Mutex<parking_lot::raw_mutex::RawMutex, HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `sharded::CacheAligned<rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>>`
     = note: required because it appears within the type `[sharded::CacheAligned<rustc_data_structures::sync::Lock<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>>; 32]`
     = note: required because it appears within the type `Sharded<HashMap<(rustc_span::def_id::LocalDefId, u32), ((&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>), DepNodeIndex), BuildHasherDefault<FxHasher>>>`
     = note: required because it appears within the type `rustc_query_system::query::caches::DefaultCache<(rustc_span::def_id::LocalDefId, u32), (&rustc_data_structures::steal::Steal<TypeckResultGenerator<'_>>, std::ops::GeneratorState<(rustc_span::def_id::LocalDefId, rustc_span::def_id::DefId), &TypeckResults<'_>>)>`
note: required because it appears within the type `QueryCaches<'_>`
    --> compiler/rustc_middle/src/ty/query.rs:212:20
175  | /  macro_rules! define_callbacks {
175  | /  macro_rules! define_callbacks {
176  | |      (<$tcx:tt>
177  | |       $($(#[$attr:meta])*
178  | |          [$($modifiers:tt)*] fn $name:ident($($K:tt)*) -> $V:ty,)*) => {
...    |
212  | |          pub struct QueryCaches<$tcx> {
...    |
320  | |      };
321  | |  }
     | |__- in this expansion of `define_callbacks!` (#2)
---
    --> compiler/rustc_middle/src/ty/context.rs:1020:12
     |
1020 | pub struct GlobalCtxt<'tcx> {
     |            ^^^^^^^^^^
     = note: required because it appears within the type `&GlobalCtxt<'_>`
    --> compiler/rustc_middle/src/ty/context.rs:1008:12
     |
1008 | pub struct TyCtxt<'tcx> {
     |            ^^^^^^
     |            ^^^^^^
note: required because it appears within the type `ImplicitCtxt<'_, '_>`
    --> compiler/rustc_middle/src/ty/context.rs:1757:16
     |
1757 |     pub struct ImplicitCtxt<'a, 'tcx> {
note: required by a bound in `assert_sync`
    --> /checkout/compiler/rustc_data_structures/src/sync.rs:362:32
     |
     |
362  | pub fn assert_sync<T: ?Sized + Sync>() {}
     |                                ^^^^ required by this bound in `assert_sync`
For more information about this error, try `rustc --explain E0277`.
error: could not compile `rustc_middle` due to 6 previous errors
warning: build failed, waiting for other jobs to finish...
error: could not compile `rustc_middle` due to 6 previous errors

@lqd
Copy link
Member

lqd commented May 8, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label May 8, 2022
@bors
Copy link
Collaborator

bors commented May 8, 2022

⌛ Trying commit a23c3e3 with merge 5eb5cc22ae0bb5652a266ea0287a880c64a2ab14...

@bors
Copy link
Collaborator

bors commented May 8, 2022

☀️ Try build successful - checks-actions
Build commit: 5eb5cc22ae0bb5652a266ea0287a880c64a2ab14 (5eb5cc22ae0bb5652a266ea0287a880c64a2ab14)

@rust-timer
Copy link
Collaborator

Queued 5eb5cc22ae0bb5652a266ea0287a880c64a2ab14 with parent 83322c5, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (5eb5cc22ae0bb5652a266ea0287a880c64a2ab14): comparison url.

Summary:

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 3 7 0 2 3
mean2 0.3% 0.5% N/A -0.4% 0.3%
max 0.4% 1.8% N/A -0.4% 0.4%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf +perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@rustbot rustbot added perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 9, 2022
@@ -29,3 +29,4 @@ rustc_trait_selection = { path = "../rustc_trait_selection" }
rustc_ty_utils = { path = "../rustc_ty_utils" }
rustc_lint = { path = "../rustc_lint" }
rustc_serialize = { path = "../rustc_serialize" }
stackful = { git = "https://github.com/nbdd0121/stackful.git", branch = "dev", default-features = false, features = ["nightly"] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stack switching isn't possible on wasm. There is a proposal for it (https://github.com/WebAssembly/stack-switching), but AFAIK no implementations yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we don't support host tools on wasm anyway...

Copy link
Member

@bjorn3 bjorn3 May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a couple of tiny patches rustc compiles just fine for wasm32-wasi and with https://github.com/bjorn3/browser_wasi_shim it even works in the browser. A linker are only necessary when you want to actually compile. For a check run you don't need a linker.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this would make it significantly harder to make wasm32-wasi a tier 2 target with host tools if we ever want to do that in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we can always resort to running typeck multiple times... as long as unwinding is supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that asyncify can be used with wasm-opt: https://web.dev/asyncify.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That page doesn't give any indication on how to use asyncify without a wrapper around the asyncified wasm module which tells when to unwind and when to rewind to the exact same point from which you unwound. Said wrapper is not possible with wasi, as the wasi runtime drives execution, not your own code. I also suspect asyncify only allows a single stack.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added wasm32 support to stackful. nbdd0121/stackful@f4d3693

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the exact invocation of asyncify you need for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use wasm-opt --asyncify --pass-arg=asyncify-ignore-imports <INPUT> -o <OUTPUT>. Asyncify has a conservative default so omitting the pass-arg should be fine too.

@Mark-Simulacrum Mark-Simulacrum added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 24, 2022
@nbdd0121
Copy link
Contributor Author

nbdd0121 commented Dec 8, 2022

Closing in favour of #96840 given #104940 is merged.

@nbdd0121 nbdd0121 closed this Dec 8, 2022
@nbdd0121 nbdd0121 deleted the typeck branch December 31, 2023 17:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants