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

ices/80077.rs: fixed with errors #599

Merged
merged 1 commit into from
Dec 28, 2020
Merged

ices/80077.rs: fixed with errors #599

merged 1 commit into from
Dec 28, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#80077

#![feature(
    const_assume,
    const_evaluatable_checked,
    const_generics,
    use std::intrinsics::assume;
)]
#![allow(incomplete_features)]

const fn foo(n: usize) -> usize { n }

pub struct Bar<const N: usize>(usize);

impl<const N: usize> Bar<N> where [(); foo(N)]: {
    fn spam(i: usize) { }
}

fn main() {}
=== stdout ===
=== stderr ===
error: expected identifier, found keyword `use`
 --> /home/runner/work/glacier/glacier/ices/80077.rs:5:5
  |
5 |     use std::intrinsics::assume;
  |     ^^^ expected identifier, found keyword

error: expected one of `(`, `,`, `::`, or `=`, found `std`
 --> /home/runner/work/glacier/glacier/ices/80077.rs:5:9
  |
5 |     use std::intrinsics::assume;
  |         ^^^ expected one of `(`, `,`, `::`, or `=`

error: generic parameters may not be used in const operations
  --> /home/runner/work/glacier/glacier/ices/80077.rs:13:44
   |
13 | impl<const N: usize> Bar<N> where [(); foo(N)]: {
   |                                            ^ 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

error: aborting due to 3 previous errors

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

=== stdout ===
=== stderr ===
error: expected identifier, found keyword `use`
 --> /home/runner/work/glacier/glacier/ices/80077.rs:5:5
  |
5 |     use std::intrinsics::assume;
  |     ^^^ expected identifier, found keyword

error: expected one of `(`, `,`, `::`, or `=`, found `std`
 --> /home/runner/work/glacier/glacier/ices/80077.rs:5:9
  |
5 |     use std::intrinsics::assume;
  |         ^^^ expected one of `(`, `,`, `::`, or `=`

error: generic parameters may not be used in const operations
  --> /home/runner/work/glacier/glacier/ices/80077.rs:13:44
   |
13 | impl<const N: usize> Bar<N> where [(); foo(N)]: {
   |                                            ^ 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

error: aborting due to 3 previous errors

==============
@Alexendoo Alexendoo merged commit 7389dd2 into master Dec 28, 2020
@Alexendoo Alexendoo deleted the autofix/ices/80077.rs branch December 28, 2020 13:40
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