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

ices/98598.rs: fixed with errors #1331

Merged
merged 1 commit into from
Jul 2, 2022
Merged

ices/98598.rs: fixed with errors #1331

merged 1 commit into from
Jul 2, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jul 2, 2022

Issue: rust-lang/rust#98598

pub trait Foo {
    type Output: Foo;
    
    fn baz() -> Self::Output;
}

pub struct Bar;

impl Foo for &Bar {
    type Output = Bar;

    fn baz() -> Self::Output {
        Foo::baz();

        Self::Output {}
    }
}

pub fn main() {}
=== stdout ===
=== stderr ===
error[E0277]: the trait bound `Bar: Foo` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/98598.rs:10:19
   |
10 |     type Output = Bar;
   |                   ^^^ the trait `Foo` is not implemented for `Bar`
   |
   = help: the trait `Foo` is implemented for `&Bar`
note: required by a bound in `Foo::Output`
  --> /home/runner/work/glacier/glacier/ices/98598.rs:2:18
   |
2  |     type Output: Foo;
   |                  ^^^ required by this bound in `Foo::Output`

error[E0283]: type annotations needed
  --> /home/runner/work/glacier/glacier/ices/98598.rs:13:9
   |
13 |         Foo::baz();
   |         ^^^^^^^^ cannot infer type
   |
   = note: cannot satisfy `_: Foo`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0283.
For more information about an error, try `rustc --explain E0277`.
==============

=== stdout ===
=== stderr ===
error[E0277]: the trait bound `Bar: Foo` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/98598.rs:10:19
   |
10 |     type Output = Bar;
   |                   ^^^ the trait `Foo` is not implemented for `Bar`
   |
   = help: the trait `Foo` is implemented for `&Bar`
note: required by a bound in `Foo::Output`
  --> /home/runner/work/glacier/glacier/ices/98598.rs:2:18
   |
2  |     type Output: Foo;
   |                  ^^^ required by this bound in `Foo::Output`

error[E0283]: type annotations needed
  --> /home/runner/work/glacier/glacier/ices/98598.rs:13:9
   |
13 |         Foo::baz();
   |         ^^^^^^^^ cannot infer type
   |
   = note: cannot satisfy `_: Foo`

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0283.
For more information about an error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit f1f0cc3 into master Jul 2, 2022
@JohnTitor JohnTitor deleted the autofix/ices/98598.rs branch July 2, 2022 05:57
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