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

ices/112623.rs: fixed with errors #1647

Merged
merged 1 commit into from
Oct 15, 2023
Merged

ices/112623.rs: fixed with errors #1647

merged 1 commit into from
Oct 15, 2023

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 9, 2023

Issue: rust-lang/rust#112623

#![feature(const_trait_impl)]

#[const_trait]
trait Func<T> {
    type Output;

    fn call_once(self, arg: T) -> Self::Output;
}

struct Closure;

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

    fn call_once(&'static self, arg: &usize) -> Self::Output {
        *arg
    }
}

enum Bug<T = [(); Closure.call_once(&0)]> {
    V(T),
}
=== stdout ===
=== stderr ===
error[E0601]: `main` function not found in crate `112623`
  --> /home/runner/work/glacier/glacier/ices/112623.rs:22:2
   |
22 | }
   |  ^ consider adding a `main` function to `/home/runner/work/glacier/glacier/ices/112623.rs`

error[E0015]: cannot call non-const fn `<Closure as Func<&usize>>::call_once` in constants
  --> /home/runner/work/glacier/glacier/ices/112623.rs:20:27
   |
20 | enum Bug<T = [(); Closure.call_once(&0)]> {
   |                           ^^^^^^^^^^^^^
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants

error: aborting due to 2 previous errors

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

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

error[E0015]: cannot call non-const fn `<Closure as Func<&usize>>::call_once` in constants
  --> /home/runner/work/glacier/glacier/ices/112623.rs:20:27
   |
20 | enum Bug<T = [(); Closure.call_once(&0)]> {
   |                           ^^^^^^^^^^^^^
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0015, E0601.
For more information about an error, try `rustc --explain E0015`.
==============
@JohnTitor JohnTitor merged commit 5e5e527 into master Oct 15, 2023
@JohnTitor JohnTitor deleted the autofix/ices/112623.rs branch October 15, 2023 03:05
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