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

ices/73260.sh: fixed with errors #469

Merged
merged 1 commit into from
Sep 23, 2020
Merged

ices/73260.sh: fixed with errors #469

merged 1 commit into from
Sep 23, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#73260

#!/bin/bash

rustc -Z save-analysis - << EOF
#![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 {};
}
EOF
=== stdout ===
=== stderr ===
error: constant expression depends on a generic parameter
 --> <anon>:4:47
  |
4 | where Assert::<{N < usize::max_value() / 2}>: IsTrue,
  |                                               ^^^^^^
  |
  = note: this may fail depending on what value the parameter takes

error[E0308]: mismatched types
  --> <anon>:15:12
   |
15 |     let x: Arr<{usize::max_value()}> = Arr {};
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `false`, found `true`
   |
   = note: expected type `false`
              found type `true`

error[E0308]: mismatched types
  --> <anon>:15:40
   |
15 |     let x: Arr<{usize::max_value()}> = Arr {};
   |                                        ^^^ expected `false`, found `true`
   |
   = note: expected type `false`
              found type `true`

error: aborting due to 3 previous errors

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

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

error[E0308]: mismatched types
  --> <anon>:15:12
   |
15 |     let x: Arr<{usize::max_value()}> = Arr {};
   |            ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `false`, found `true`
   |
   = note: expected type `false`
              found type `true`

error[E0308]: mismatched types
  --> <anon>:15:40
   |
15 |     let x: Arr<{usize::max_value()}> = Arr {};
   |                                        ^^^ expected `false`, found `true`
   |
   = note: expected type `false`
              found type `true`

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0308`.
==============
@JohnTitor JohnTitor merged commit e9bb9d8 into master Sep 23, 2020
@JohnTitor JohnTitor deleted the autofix/ices/73260.sh branch September 23, 2020 16:16
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