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

ices/99820.rs: fixed with errors #1454

Merged
merged 1 commit into from
Nov 9, 2022
Merged

ices/99820.rs: fixed with errors #1454

merged 1 commit into from
Nov 9, 2022

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Nov 7, 2022

Issue: rust-lang/rust#99820

#![feature(const_trait_impl)]
#![feature(fn_traits)]
#![feature(unboxed_closures)]

struct Closure;

impl const FnOnce<&usize> for Closure {
    type Output = usize;

    extern "rust-call" fn call_once(self, arg: &usize) -> Self::Output {
        *arg
    }
}

enum Bug<T = [(); Closure.call_once(&0) ]> {
    V(T),
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0059]: type parameter to bare `FnOnce` trait must be a tuple
 --> /home/runner/work/glacier/glacier/ices/99820.rs:7:12
  |
7 | impl const FnOnce<&usize> for Closure {
  |            ^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `&usize`
  |
note: required by a bound in `FnOnce`

error[E0277]: `&usize` is not a tuple
  --> /home/runner/work/glacier/glacier/ices/99820.rs:15:37
   |
15 | enum Bug<T = [(); Closure.call_once(&0) ]> {
   |                           --------- ^^ the trait `Tuple` is not implemented for `&usize`
   |                           |
   |                           required by a bound introduced by this call
   |
note: required by a bound in `call_once`

error[E0277]: functions with the "rust-call" ABI must take a single non-self tuple argument
  --> /home/runner/work/glacier/glacier/ices/99820.rs:10:5
   |
10 |     extern "rust-call" fn call_once(self, arg: &usize) -> Self::Output {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `&usize`

error: aborting due to 3 previous errors

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

=== stdout ===
=== stderr ===
error[E0059]: type parameter to bare `FnOnce` trait must be a tuple
 --> /home/runner/work/glacier/glacier/ices/99820.rs:7:12
  |
7 | impl const FnOnce<&usize> for Closure {
  |            ^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `&usize`
  |
note: required by a bound in `FnOnce`

error[E0277]: `&usize` is not a tuple
  --> /home/runner/work/glacier/glacier/ices/99820.rs:15:37
   |
15 | enum Bug<T = [(); Closure.call_once(&0) ]> {
   |                           --------- ^^ the trait `Tuple` is not implemented for `&usize`
   |                           |
   |                           required by a bound introduced by this call
   |
note: required by a bound in `call_once`

error[E0277]: functions with the "rust-call" ABI must take a single non-self tuple argument
  --> /home/runner/work/glacier/glacier/ices/99820.rs:10:5
   |
10 |     extern "rust-call" fn call_once(self, arg: &usize) -> Self::Output {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Tuple` is not implemented for `&usize`

error: aborting due to 3 previous errors

Some errors have detailed explanations: E0059, E0277.
For more information about an error, try `rustc --explain E0059`.
==============
@Alexendoo Alexendoo merged commit fbb244f into master Nov 9, 2022
@Alexendoo Alexendoo deleted the autofix/ices/99820.rs branch November 9, 2022 12:53
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.

None yet

2 participants