-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
A concrete type parameter cannot be used as impl Trait
if ?
is used previously
#93924
Comments
Doctests that return use core::fmt::Debug;
#[derive(Debug)]
pub struct Target;
#[derive(Debug)]
pub struct Source;
impl From<Source> for Target {
fn from(_: Source) -> Self {
Self
}
}
/// # Examples
///
/// ```
/// use impl_type_coercion::{Target, maybe_source};
/// maybe_source()?;
/// Ok::<_, Target>(())
/// ```
pub fn maybe_source() -> Result<(), Source> {
todo!()
} Output of
|
searched nightlies: from nightly-2022-02-01 to nightly-2022-02-11 bisected with cargo-bisect-rustc v0.6.1Host triple: x86_64-unknown-linux-gnu cargo bisect-rustc --start=2022-02-01 --end=2022-02-11 |
This got reverted in #93893 |
Thank you! |
Code
I tried this code:
I expected to see this happen: Compiles successfully, with
Result<(), impl Debug>
instantiated asResult<(), Target>
.Instead, this happened: Compilation error.
Without
maybe_source()?;
line, the errors don't happen.Version it worked on
It most recently worked on:
Version with regression
rustc +nightly --version --verbose
:@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
The text was updated successfully, but these errors were encountered: