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

ices/72819.rs: fixed with errors #394

Merged
merged 1 commit into from
Jun 6, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Jun 4, 2020

Issue: rust-lang/rust#72819

#![feature(const_generics)]
#![allow(incomplete_features)]
struct Arr<const N: usize>
where Assert::<{N < usize::max_value() / 2}>: IsTrue,
{
}

enum Assert<const CHECK: bool> {}

trait IsTrue {}

impl IsTrue for Assert<true> {}

fn main() {
    let x: Arr<{usize::max_value()}> = Arr {};
}
=== stdout ===
=== stderr ===
error: constant expression depends on a generic parameter
 --> /home/runner/work/glacier/glacier/ices/72819.rs:4:47
  |
4 | where Assert::<{N < usize::max_value() / 2}>: IsTrue,
  |                                               ^^^^^^
  |
  = note: this may fail depending on what value the parameter takes

error: aborting due to previous error

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

=== stdout ===
=== stderr ===
error: constant expression depends on a generic parameter
 --> /home/runner/work/glacier/glacier/ices/72819.rs:4:47
  |
4 | where Assert::<{N < usize::max_value() / 2}>: IsTrue,
  |                                               ^^^^^^
  |
  = note: this may fail depending on what value the parameter takes

error: aborting due to previous error

==============
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.

Left a comment on the issue as fixed.

@JohnTitor JohnTitor merged commit a602206 into master Jun 6, 2020
@JohnTitor JohnTitor deleted the autofix/ices/72819.rs branch June 6, 2020 16:56
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants