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

ices/99641.sh: fixed with errors #1361

Merged
merged 1 commit into from
Jul 28, 2022
Merged

ices/99641.sh: fixed with errors #1361

merged 1 commit into from
Jul 28, 2022

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#99641

#!/bin/bash

rustc -Cdebuginfo=1 - <<'EOF'

#![feature(adt_const_params)]

fn main() {
    pub struct Color<const WHITE: (fn(),)>;

    impl<const WHITE: (fn(),)> Color<WHITE> {
        /// Construct a new color
        pub fn new() -> Self {
            Color::<WHITE>
        }
    }

    pub const D65: (fn(),) = (|| {},);

    Color::<D65>::new();
}

EOF

=== stdout ===
=== stderr ===
warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <anon>:2:12
  |
2 | #![feature(adt_const_params)]
  |            ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #95174 <https://github.com/rust-lang/rust/issues/95174> for more information

error[E0741]: using function pointers as const generic parameters is forbidden
 --> <anon>:5:35
  |
5 |     pub struct Color<const WHITE: (fn(),)>;
  |                                   ^^^^^^^

error[E0741]: using function pointers as const generic parameters is forbidden
 --> <anon>:7:23
  |
7 |     impl<const WHITE: (fn(),)> Color<WHITE> {
  |                       ^^^^^^^

error: aborting due to 2 previous errors; 1 warning emitted

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

=== stdout ===
=== stderr ===
warning: the feature `adt_const_params` is incomplete and may not be safe to use and/or cause compiler crashes
 --> <anon>:2:12
  |
2 | #![feature(adt_const_params)]
  |            ^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #95174 <rust-lang/rust#95174> for more information

error[E0741]: using function pointers as const generic parameters is forbidden
 --> <anon>:5:35
  |
5 |     pub struct Color<const WHITE: (fn(),)>;
  |                                   ^^^^^^^

error[E0741]: using function pointers as const generic parameters is forbidden
 --> <anon>:7:23
  |
7 |     impl<const WHITE: (fn(),)> Color<WHITE> {
  |                       ^^^^^^^

error: aborting due to 2 previous errors; 1 warning emitted

For more information about this error, try `rustc --explain E0741`.
==============
@Alexendoo Alexendoo merged commit 59c8820 into master Jul 28, 2022
@Alexendoo Alexendoo deleted the autofix/ices/99641.sh branch July 28, 2022 11:17
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