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

ices/74199.rs: fixed with errors #454

Merged
merged 1 commit into from
Aug 2, 2020
Merged

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Aug 2, 2020

Issue: rust-lang/rust#74199

#![feature(const_generics)]

struct Foo<
    const N: [u8; {
        struct Foo<const N: usize>;

        impl<const N: usize> Foo<N> {
            fn value() -> usize {
                N
            }
        }

        Foo::<17>::value()
    }],
>;

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

error[E0391]: cycle detected when computing type of `Foo`
  --> /home/runner/work/glacier/glacier/ices/74199.rs:3:1
   |
3  | / struct Foo<
4  | |     const N: [u8; {
5  | |         struct Foo<const N: usize>;
6  | |
...  |
14 | |     }],
15 | | >;
   | |__^
   |
note: ...which requires computing type of `Foo::N`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:11
   |
4  |     const N: [u8; {
   |           ^
note: ...which requires const-evaluating + checking `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires const-evaluating + checking `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires const-evaluating `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires type-checking `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires computing the variances of `Foo::{{constant}}#0::Foo`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:5:9
   |
5  |         struct Foo<const N: usize>;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: ...which requires computing the variances for items in this crate...
   = note: ...which again requires computing type of `Foo`, completing the cycle
note: cycle used when collecting item types in top-level module
  --> /home/runner/work/glacier/glacier/ices/74199.rs:1:1
   |
1  | / #![feature(const_generics)]
2  | |
3  | | struct Foo<
4  | |     const N: [u8; {
...  |
16 | |
17 | | fn main() {}
   | |____________^

error: aborting due to previous error; 1 warning emitted

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

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

error[E0391]: cycle detected when computing type of `Foo`
  --> /home/runner/work/glacier/glacier/ices/74199.rs:3:1
   |
3  | / struct Foo<
4  | |     const N: [u8; {
5  | |         struct Foo<const N: usize>;
6  | |
...  |
14 | |     }],
15 | | >;
   | |__^
   |
note: ...which requires computing type of `Foo::N`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:11
   |
4  |     const N: [u8; {
   |           ^
note: ...which requires const-evaluating + checking `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires const-evaluating + checking `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires const-evaluating `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires type-checking `Foo::{{constant}}#0`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:4:19
   |
4  |       const N: [u8; {
   |  ___________________^
5  | |         struct Foo<const N: usize>;
6  | |
7  | |         impl<const N: usize> Foo<N> {
...  |
13 | |         Foo::<17>::value()
14 | |     }],
   | |_____^
note: ...which requires computing the variances of `Foo::{{constant}}#0::Foo`...
  --> /home/runner/work/glacier/glacier/ices/74199.rs:5:9
   |
5  |         struct Foo<const N: usize>;
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: ...which requires computing the variances for items in this crate...
   = note: ...which again requires computing type of `Foo`, completing the cycle
note: cycle used when collecting item types in top-level module
  --> /home/runner/work/glacier/glacier/ices/74199.rs:1:1
   |
1  | / #![feature(const_generics)]
2  | |
3  | | struct Foo<
4  | |     const N: [u8; {
...  |
16 | |
17 | | fn main() {}
   | |____________^

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0391`.
==============
@Alexendoo Alexendoo merged commit 02ba5d3 into master Aug 2, 2020
@Alexendoo Alexendoo deleted the autofix/ices/74199.rs branch August 2, 2020 12:19
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