-
-
Notifications
You must be signed in to change notification settings - Fork 87
Unexpected "one type is more general than the other" compiler error #144
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
Comments
getting a similar error for this code
[email protected] seems to work for me, all newer versions (including 0.1.48) fail to build. |
I am seeing the same error when trying to upgrade
|
…13445) Upgrade `tonic` to v0.6.1 and `prost` to v0.9.0. Note: `async-trait` has been pinned to the existing v0.1.42 in the Cargo.lock due to error referenced here: #12486 (comment). See dtolnay/async-trait#144 for upstream discussion in `async-trait` repo.
The above issue still reproduces in |
Upgrade the `async-trait` crate to latest version. Refactor `PathStatGetter` to use a boxed future to work around upstream bug in the `async-trait` crate: dtolnay/async-trait#144
Upgrade the `async-trait` crate to latest version. Refactor `PathStatGetter` to use a boxed future to work around upstream bug in the `async-trait` crate: dtolnay/async-trait#144
Updated output on newer rustc: error: higher-ranked lifetime error
--> src/main.rs:50:39
|
50 | async fn create_trait(&self) -> V {
| _______________________________________^
51 | | // This compiles
52 | | // self.create_impl_join_all().await
53 | | // This compiles
... |
56 | | self.create_impl_map_join_all().await
57 | | }
| |_____^
|
= note: could not prove `Pin<Box<[async block@src/main.rs:50:39: 57:6]>>: CoerceUnsized<Pin<Box<(dyn futures::Future<Output = V<Box<(dyn std::fmt::Display + std::marker::Send + 'e)>>> + std::marker::Send + 'f)>>>` This is a rustc bug that is already reported in rust-lang/rust#82921. |
I have some async code with a collection of futures that I have called
join_all
on. It seems to work fine, but when I try to call that code call from an implementation from an#[async_trait]
, I am getting an error I don't quite understand;The below code compiles if either of the
map
orjoin_all
are called, but fails with the above error if bothmap
andjoin_all
are used.In addition
T = Box<dyn Display + Send>
intoT = Box<usize>
makes it compileV
becomespub struct V<T: ?Sized = dyn Display + Send + ?Sized> { _v: Box<T> }
fails with the same message as aboveV
becomespub struct V { _v: Box<dyn Display + Send> }
makes it compilePotentially related to #34 ?
The text was updated successfully, but these errors were encountered: