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

ices/77919.rs: fixed with errors #519

Merged
merged 1 commit into from
Oct 26, 2020
Merged

ices/77919.rs: fixed with errors #519

merged 1 commit into from
Oct 26, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#77919

trait TypeVal<T> {
    const VAL: T;
}
struct Five;
struct Multiply<N, M> {
    _n: PhantomData,
}
impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}

fn main() {
    [1; <Multiply<Five, Five>>::VAL];
}
=== stdout ===
=== stderr ===
error[E0412]: cannot find type `PhantomData` in this scope
 --> /home/runner/work/glacier/glacier/ices/77919.rs:6:9
  |
6 |     _n: PhantomData,
  |         ^^^^^^^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
1 | use core::marker::PhantomData;
  |
1 | use std::marker::PhantomData;
  |

error[E0412]: cannot find type `VAL` in this scope
 --> /home/runner/work/glacier/glacier/ices/77919.rs:8:63
  |
8 | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
  |          -                                                    ^^^ not found in this scope
  |          |
  |          help: you might be missing a type parameter: `, VAL`

error[E0046]: not all trait items implemented, missing: `VAL`
 --> /home/runner/work/glacier/glacier/ices/77919.rs:8:1
  |
2 |     const VAL: T;
  |     ------------- `VAL` from trait
...
8 | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation

error: any use of this value will cause an error
 --> /home/runner/work/glacier/glacier/ices/77919.rs:2:5
  |
2 |     const VAL: T;
  |     ^^^^^^^^^^^^^ no MIR body is available for DefId(0:5 ~ 77919[317d]::TypeVal::VAL)
  |
  = note: `#[deny(const_err)]` on by default

error[E0080]: evaluation of constant value failed
  --> /home/runner/work/glacier/glacier/ices/77919.rs:11:9
   |
11 |     [1; <Multiply<Five, Five>>::VAL];
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0046, E0080, E0412.
For more information about an error, try `rustc --explain E0046`.
==============

=== stdout ===
=== stderr ===
error[E0412]: cannot find type `PhantomData` in this scope
 --> /home/runner/work/glacier/glacier/ices/77919.rs:6:9
  |
6 |     _n: PhantomData,
  |         ^^^^^^^^^^^ not found in this scope
  |
help: consider importing one of these items
  |
1 | use core::marker::PhantomData;
  |
1 | use std::marker::PhantomData;
  |

error[E0412]: cannot find type `VAL` in this scope
 --> /home/runner/work/glacier/glacier/ices/77919.rs:8:63
  |
8 | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
  |          -                                                    ^^^ not found in this scope
  |          |
  |          help: you might be missing a type parameter: `, VAL`

error[E0046]: not all trait items implemented, missing: `VAL`
 --> /home/runner/work/glacier/glacier/ices/77919.rs:8:1
  |
2 |     const VAL: T;
  |     ------------- `VAL` from trait
...
8 | impl<N, M> TypeVal<usize> for Multiply<N, M> where N: TypeVal<VAL> {}
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `VAL` in implementation

error: any use of this value will cause an error
 --> /home/runner/work/glacier/glacier/ices/77919.rs:2:5
  |
2 |     const VAL: T;
  |     ^^^^^^^^^^^^^ no MIR body is available for DefId(0:5 ~ 77919[317d]::TypeVal::VAL)
  |
  = note: `#[deny(const_err)]` on by default

error[E0080]: evaluation of constant value failed
  --> /home/runner/work/glacier/glacier/ices/77919.rs:11:9
   |
11 |     [1; <Multiply<Five, Five>>::VAL];
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^ referenced constant has errors

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0046, E0080, E0412.
For more information about an error, try `rustc --explain E0046`.
==============
@Alexendoo Alexendoo merged commit 9c90e60 into master Oct 26, 2020
@Alexendoo Alexendoo deleted the autofix/ices/77919.rs branch October 26, 2020 12:54
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