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

ices/102140.rs: fixed with errors #1434

Merged
merged 1 commit into from
Oct 2, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

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

Issue: rust-lang/rust#102140

#![feature(return_position_impl_trait_in_trait)]

trait Marker {}
impl Marker for u32 {}

trait MyTrait {
    fn foo(&self) -> impl Marker
        where Self: Sized;
}

struct Outer;

impl MyTrait for Outer {
    fn foo(&self) -> impl Marker {
        42
    }
}

impl dyn MyTrait {
    fn other(&self) -> impl Marker {
        MyTrait::foo(&self)
    }
}
=== stdout ===
=== stderr ===
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/102140.rs:1:12
  |
1 | #![feature(return_position_impl_trait_in_trait)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #91611 <https://github.com/rust-lang/rust/issues/91611> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0601]: `main` function not found in crate `102140`
  --> /home/runner/work/glacier/glacier/ices/102140.rs:23:2
   |
23 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/102140.rs`

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/102140.rs:21:22
   |
21 |         MyTrait::foo(&self)
   |         ------------ -^^^^
   |         |            |
   |         |            the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |         |            help: consider removing the leading `&`-reference
   |         required by a bound introduced by this call

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/102140.rs:21:9
   |
21 |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/102140.rs:21:9
   |
21 |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error: aborting due to 4 previous errors; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: the feature `return_position_impl_trait_in_trait` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/102140.rs:1:12
  |
1 | #![feature(return_position_impl_trait_in_trait)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #91611 <rust-lang/rust#91611> for more information
  = note: `#[warn(incomplete_features)]` on by default

error[E0601]: `main` function not found in crate `102140`
  --> /home/runner/work/glacier/glacier/ices/102140.rs:23:2
   |
23 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/102140.rs`

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/102140.rs:21:22
   |
21 |         MyTrait::foo(&self)
   |         ------------ -^^^^
   |         |            |
   |         |            the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |         |            help: consider removing the leading `&`-reference
   |         required by a bound introduced by this call

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/102140.rs:21:9
   |
21 |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied
  --> /home/runner/work/glacier/glacier/ices/102140.rs:21:9
   |
21 |         MyTrait::foo(&self)
   |         ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait`
   |
   = help: the trait `MyTrait` is implemented for `Outer`

error: aborting due to 4 previous errors; 1 warning emitted

Some errors have detailed explanations: E0277, E0601.
For more information about an error, try `rustc --explain E0277`.
==============
@JohnTitor JohnTitor merged commit 78b6609 into master Oct 2, 2022
@JohnTitor JohnTitor deleted the autofix/ices/102140.rs branch October 2, 2022 22:49
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