Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

ices/109869.rs: fixed with errors #1599

Merged
merged 1 commit into from
Jun 4, 2023
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 4, 2023

Issue: rust-lang/rust#109869

type Spanned<T> = (T, ());

trait Span<T> {}

impl<T> Span<T> for (T, ()) {}

impl<F, T: From<F>> From<Spanned<F>> for dyn Span<T>
where
    Self: Sized
{
    fn from((from, ()): Spanned<F>) -> Self {
        (T::from(from), ())
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/109869.rs:12:9
   |
11 |     fn from((from, ()): Spanned<F>) -> Self {
   |                                        ---- expected `(dyn Span<T> + 'static)` because of return type
12 |         (T::from(from), ())
   |         ^^^^^^^^^^^^^^^^^^^ expected `dyn Span`, found `(T, ())`
   |
   = note: expected trait object `(dyn Span<T> + 'static)`
                     found tuple `(T, ())`
help: call `Into::into` on this expression to convert `(T, ())` into `(dyn Span<T> + 'static)`
   |
12 |         (T::from(from), ()).into()
   |                            +++++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
==============

=== stdout ===
=== stderr ===
error[E0308]: mismatched types
  --> /home/runner/work/glacier/glacier/ices/109869.rs:12:9
   |
11 |     fn from((from, ()): Spanned<F>) -> Self {
   |                                        ---- expected `(dyn Span<T> + 'static)` because of return type
12 |         (T::from(from), ())
   |         ^^^^^^^^^^^^^^^^^^^ expected `dyn Span`, found `(T, ())`
   |
   = note: expected trait object `(dyn Span<T> + 'static)`
                     found tuple `(T, ())`
help: call `Into::into` on this expression to convert `(T, ())` into `(dyn Span<T> + 'static)`
   |
12 |         (T::from(from), ()).into()
   |                            +++++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
==============
@JohnTitor JohnTitor merged commit c43e9c4 into master Jun 4, 2023
@JohnTitor JohnTitor deleted the autofix/ices/109869.rs branch June 4, 2023 08:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants