rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
96.6k stars 12.48k forks source link

Type inference results in `overflow evaluating the requirement` #127411

Open sgdxbc opened 2 months ago

sgdxbc commented 2 months ago

The full reproducible case is here. Before committing further efforts on reducing it I would like to learn about maintainer's opinion on such issues. Whether it should be considered as bug? If so, will it be fixed straight way or need to go through some formalization first?

The skeleton is like this

f() {
    let (sender, mut receiver) = unbounded_channel();
    let (crypto_sender, mut crypto_receiver) = unbounded_channel();

    let crypto_task = run_worker(..., sender, crypto_receiver);

    let mut context = Context::<Of<_>, _> { ..., crypto_sender, ... };
    let client_task = run_with_schedule(..., context, receiver, ...);
    // let crypto_task = run_worker(..., sender, crypto_receiver);
}

If compiled like this it will fail with

error[E0275]: overflow evaluating the requirement `_: Sized`

(By the way, a minor issue here is that the trace does not properly fold the repeating steps. It also results in outputting hundreds of "long type" files (and even more if increasing recursion limit).)

If switch to define crypto_task at the commented location, it just compiles. The crypto_task and client_task are independent definitions so it is semantically same to define in either order (in my original case they are futures so even nothing executed effectively by this two definitions).

Giving annotation to the first unbounded_channel() call with at least ::<ErasedEvent<State<()>, _> makes it compile in the original order.

It has always been the case where type inference does not work in some definition order, but most of the time a "type annotation required" error is reported. Should we fix this case to the extent that at least a less confusing error is reported? On the other hand I am actually curious about the internal mechanism here:

Thanks for any clarification!

Meta

rustc --version --verbose:

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-unknown-linux-gnu
release: 1.79.0
LLVM version: 18.1.7

Also reproduced on nightly

rustc 1.81.0-nightly (524d806c6 2024-07-05)
binary: rustc
commit-hash: 524d806c62a82ecc0cf8634b94997ae506f4d6f9
commit-date: 2024-07-05
host: x86_64-unknown-linux-gnu
release: 1.81.0-nightly
LLVM version: 18.1.7
Backtrace

``` ```

GrigorenkoPV commented 2 months ago

@rustbot label fixed-by-next-solver

rustbot commented 2 months ago

Error: Label fixed-by-next-solver can only be set by Rust team members

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

theemathas commented 2 months ago

Somewhat minimized:

Code ```rust fn conjure() -> T { unimplemented!() } fn conjure_two() -> (T, T) { unimplemented!() } fn f() { let (crypto_sender, crypto_receiver) = conjure_two(); run_worker(crypto_receiver); let mut context = Context::> { schedule: conjure::>>(), crypto_worker: crypto_sender, }; } fn run_worker(_: ErasedEvent<(), Erase>) {} struct State(A); struct Context { schedule: O::Schedule, crypto_worker: O::CryptoWorker, } trait On { type Schedule; type CryptoWorker; } impl On for State { type Schedule = Erase, Context>, ScheduleState, Context>>>>; type CryptoWorker = ErasedEvent< (), Erase, Context>, ErasedEvent, Context>>>, >; } struct ScheduleState(M); type ErasedEvent = Box; struct Erase(S, C, E); ```
sgdxbc commented 2 months ago

Thanks a lot for the further minimization @theemathas! You really saved me a day :)

theemathas commented 1 month ago

Minimized:

use std::marker::PhantomData;

struct Wrap<U>(U);

trait Trait {
    type InContext;
}

impl<U> Trait for Wrap<U> {
    type InContext = Context<Wrap<U>>;
}

struct Context<T: Trait> {
    // this is PhantomData<Self>
    phantom: PhantomData<T::InContext>,
}

fn require_send<T: Send>() {}

fn f() {
    require_send::<Context::<Wrap<_>>>();
}

Annotating the type as Context::<Wrap<i32>> causes the error to go away.

The correct error should be "type annotation required".

Error output ``` Compiling playground v0.0.1 (/playground) error[E0275]: overflow evaluating the requirement `Wrap<_>: Trait` --> src/lib.rs:21:5 | 21 | require_send::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`playground`) note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required because it appears within the type `PhantomData>>` --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/marker.rs:740:12 | 740 | pub struct PhantomData; | ^^^^^^^^^^^ note: required because it appears within the type `Context>` --> src/lib.rs:13:8 | 13 | struct Context { | ^^^^^^^ note: required by a bound in `require_send` --> src/lib.rs:18:20 | 18 | fn require_send() {} | ^^^^ required by this bound in `require_send` For more information about this error, try `rustc --explain E0275`. error: could not compile `playground` (lib) due to 1 previous error ```