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

ices/85455.rs: fixed with errors #936

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#85455

#![feature(unboxed_closures)]

trait SomeTrait<'a> {
    type Associated;
}

fn give_me_ice<T>() {
    callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
}

fn callee<T: Fn<(&'static (),)>>() {
    println!(
        "{}",
        std::any::type_name::<<T as FnOnce<(&'static (),)>>::Output>()
    );
}

fn main() {
    give_me_ice::<()>();
}
=== stdout ===
=== stderr ===
error[E0277]: the trait bound `T: SomeTrait<'_>` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/85455.rs:8:5
  |
8 |     callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SomeTrait<'_>` is not implemented for `T`
  |
help: consider restricting type parameter `T`
  |
7 | fn give_me_ice<T: SomeTrait<'_>>() {
  |                 +++++++++++++++

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error[E0277]: the trait bound `T: SomeTrait<'_>` is not satisfied
 --> /home/runner/work/glacier/glacier/ices/85455.rs:8:5
  |
8 |     callee::<fn(&()) -> <T as SomeTrait<'_>>::Associated>();
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SomeTrait<'_>` is not implemented for `T`
  |
help: consider restricting type parameter `T`
  |
7 | fn give_me_ice<T: SomeTrait<'_>>() {
  |                 +++++++++++++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
==============
@Alexendoo Alexendoo closed this Aug 29, 2021
@Alexendoo Alexendoo deleted the autofix/ices/85455.rs branch August 29, 2021 12: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