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

ices/86642.rs: fixed with errors #884

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#86642

#![feature(impl_trait_in_bindings)]
#![allow(incomplete_features)]

macro_rules! seq {
    ($( $x:expr ),*) => {
        move |source| {
            $(
                let source = $x(source)?;
            )*
            Ok(source)
        }
    };
}

macro_rules! alt {
    ($first:expr, $( $rest:expr ),*) => {
        move |source| {
            let res = $first(source);
            $(
                let res = res.or($rest(source));
            )*
            res
        }
    };
}

static x: impl Fn(&str) -> Result<&str, ()> = alt!(seq!(), seq!());
=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> /home/runner/work/glacier/glacier/ices/86642.rs:1:12
  |
1 | #![feature(impl_trait_in_bindings)]
  |            ^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
  |
  = note: the implementation was not maintainable, the feature may get reintroduced once the current refactorings are done

error[E0562]: `impl Trait` not allowed outside of function and method return types
  --> /home/runner/work/glacier/glacier/ices/86642.rs:27:11
   |
27 | static x: impl Fn(&str) -> Result<&str, ()> = alt!(seq!(), seq!());
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0601]: `main` function not found in crate `86642`
  --> /home/runner/work/glacier/glacier/ices/86642.rs:1:1
   |
1  | / #![feature(impl_trait_in_bindings)]
2  | | #![allow(incomplete_features)]
3  | |
4  | | macro_rules! seq {
...  |
26 | |
27 | | static x: impl Fn(&str) -> Result<&str, ()> = alt!(seq!(), seq!());
   | |___________________________________________________________________^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/86642.rs`

error: aborting due to 3 previous errors

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

=== stdout ===
=== stderr ===
error[E0557]: feature has been removed
 --> /home/runner/work/glacier/glacier/ices/86642.rs:1:12
  |
1 | #![feature(impl_trait_in_bindings)]
  |            ^^^^^^^^^^^^^^^^^^^^^^ feature has been removed
  |
  = note: the implementation was not maintainable, the feature may get reintroduced once the current refactorings are done

error[E0562]: `impl Trait` not allowed outside of function and method return types
  --> /home/runner/work/glacier/glacier/ices/86642.rs:27:11
   |
27 | static x: impl Fn(&str) -> Result<&str, ()> = alt!(seq!(), seq!());
   |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0601]: `main` function not found in crate `86642`
  --> /home/runner/work/glacier/glacier/ices/86642.rs:1:1
   |
1  | / #![feature(impl_trait_in_bindings)]
2  | | #![allow(incomplete_features)]
3  | |
4  | | macro_rules! seq {
...  |
26 | |
27 | | static x: impl Fn(&str) -> Result<&str, ()> = alt!(seq!(), seq!());
   | |___________________________________________________________________^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/86642.rs`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0557, E0562, E0601.
For more information about an error, try `rustc --explain E0557`.
==============
@Alexendoo
Copy link
Member

(I'm working through these)

@Alexendoo Alexendoo closed this Jul 23, 2021
@Alexendoo Alexendoo deleted the autofix/ices/86642.rs branch July 23, 2021 18: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