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

ices/112822.rs: fixed with errors #1630

Merged
merged 1 commit into from
Oct 15, 2023
Merged

ices/112822.rs: fixed with errors #1630

merged 1 commit into from
Oct 15, 2023

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#112822

#![feature(const_trait_impl)]

const fn test() -> impl ~const Fn() {
    const move || {
        let sl: &[u8] = b"foo";

        match sl {
            [first, _remainder @ ..] => {
                assert_eq!(first, &b'f');
            }
            [] => panic!(),
        }
    }
}

fn main() {}
=== stdout ===
=== stderr ===
error[E0658]: const closures are experimental
 --> /home/runner/work/glacier/glacier/ices/112822.rs:4:5
  |
4 |     const move || {
  |     ^^^^^
  |
  = note: see issue #106003 <https://github.com/rust-lang/rust/issues/106003> for more information
  = help: add `#![feature(const_closures)]` to the crate attributes to enable

error[E0015]: cannot call non-const operator in constant functions
 --> /home/runner/work/glacier/glacier/ices/112822.rs:9:17
  |
9 |                 assert_eq!(first, &b'f');
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
  = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const fn `core::panicking::assert_failed::<&u8, &u8>` in constant functions
 --> /home/runner/work/glacier/glacier/ices/112822.rs:9:17
  |
9 |                 assert_eq!(first, &b'f');
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
  = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

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

=== stdout ===
=== stderr ===
error[E0658]: const closures are experimental
 --> /home/runner/work/glacier/glacier/ices/112822.rs:4:5
  |
4 |     const move || {
  |     ^^^^^
  |
  = note: see issue #106003 <rust-lang/rust#106003> for more information
  = help: add `#![feature(const_closures)]` to the crate attributes to enable

error[E0015]: cannot call non-const operator in constant functions
 --> /home/runner/work/glacier/glacier/ices/112822.rs:9:17
  |
9 |                 assert_eq!(first, &b'f');
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
  = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0015]: cannot call non-const fn `core::panicking::assert_failed::<&u8, &u8>` in constant functions
 --> /home/runner/work/glacier/glacier/ices/112822.rs:9:17
  |
9 |                 assert_eq!(first, &b'f');
  |                 ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
  = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 3 previous errors

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