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

ices/109054.rs: fixed with errors #1605

Merged
merged 1 commit into from
Jun 24, 2023
Merged

ices/109054.rs: fixed with errors #1605

merged 1 commit into from
Jun 24, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#109054

#![feature(type_alias_impl_trait)]

struct call_me;

type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
type FnType = impl Fn(&u32) -> ReturnType;

impl std::ops::Deref for call_me {
    type Target = FnType;

    fn deref(&self) -> &Self::Target {
        fn inner(val: &u32) -> ReturnType {
            async move {
                *val * 2
            }
        }

        &inner
    }
}


fn main() {}
=== stdout ===
=== stderr ===
warning: type `call_me` should have an upper camel case name
 --> /home/runner/work/glacier/glacier/ices/109054.rs:3:8
  |
3 | struct call_me;
  |        ^^^^^^^ help: convert the identifier to upper camel case: `CallMe`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0792]: expected generic lifetime parameter, found `'_`
  --> /home/runner/work/glacier/glacier/ices/109054.rs:18:9
   |
5  | type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
   |                 -- this generic parameter must be used with a generic lifetime parameter
...
18 |         &inner
   |         ^^^^^^

error: aborting due to previous error; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: type `call_me` should have an upper camel case name
 --> /home/runner/work/glacier/glacier/ices/109054.rs:3:8
  |
3 | struct call_me;
  |        ^^^^^^^ help: convert the identifier to upper camel case: `CallMe`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

error[E0792]: expected generic lifetime parameter, found `'_`
  --> /home/runner/work/glacier/glacier/ices/109054.rs:18:9
   |
5  | type ReturnType<'a> = impl std::future::Future<Output = u32> + 'a;
   |                 -- this generic parameter must be used with a generic lifetime parameter
...
18 |         &inner
   |         ^^^^^^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0792`.
==============
@JohnTitor JohnTitor merged commit ac6d26c into master Jun 24, 2023
@JohnTitor JohnTitor deleted the autofix/ices/109054.rs branch June 24, 2023 05:30
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