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

ices/83938.rs: fixed with errors #728

Closed
wants to merge 1 commit into from

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#83938

#![crate_type = "lib"]
#![feature(const_generics_defaults)]

type NpOne<T, const N: usize, const NP: usize = {N+1usize}> = [T; NP];

pub fn push<T, const N: usize>(_: [T; N], _: T)
    -> NpOne<T, N>
{
    todo!()
}
=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/83938.rs:4:50
  |
4 | type NpOne<T, const N: usize, const NP: usize = {N+1usize}> = [T; NP];
  |                                                  ^ cannot perform const operation using `N`
  |
  = help: const parameters may only be used as standalone arguments, i.e. `N`
  = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions

warning: the feature `const_generics_defaults` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/83938.rs:2:12
  |
2 | #![feature(const_generics_defaults)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information

error: aborting due to previous error; 1 warning emitted

==============

=== stdout ===
=== stderr ===
error: generic parameters may not be used in const operations
 --> /home/runner/work/glacier/glacier/ices/83938.rs:4:50
  |
4 | type NpOne<T, const N: usize, const NP: usize = {N+1usize}> = [T; NP];
  |                                                  ^ cannot perform const operation using `N`
  |
  = help: const parameters may only be used as standalone arguments, i.e. `N`
  = help: use `#![feature(const_generics)]` and `#![feature(const_evaluatable_checked)]` to allow generic const expressions

warning: the feature `const_generics_defaults` is incomplete and may not be safe to use and/or cause compiler crashes
 --> /home/runner/work/glacier/glacier/ices/83938.rs:2:12
  |
2 | #![feature(const_generics_defaults)]
  |            ^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(incomplete_features)]` on by default
  = note: see issue #44580 <rust-lang/rust#44580> for more information

error: aborting due to previous error; 1 warning emitted

==============
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Require some additional feature flags.

@JohnTitor JohnTitor deleted the autofix/ices/83938.rs branch April 27, 2021 13:29
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