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

ices/71169.rs: fixed with errors #439

Merged
merged 1 commit into from
Jul 17, 2020
Merged

ices/71169.rs: fixed with errors #439

merged 1 commit into from
Jul 17, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#71169

#![feature(const_generics)]
#![allow(incomplete_features)]

fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}

fn main() {
    const DATA: [u8; 4] = *b"ABCD";
    foo::<4, DATA>();
}
=== stdout ===
=== stderr ===
error[E0770]: the type of const parameters must not depend on other generic parameters
 --> /home/runner/work/glacier/glacier/ices/71169.rs:4:43
  |
4 | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
  |                                           ^^^ the type must not depend on the parameter `LEN`

error: constant expression depends on a generic parameter
 --> /home/runner/work/glacier/glacier/ices/71169.rs:8:14
  |
8 |     foo::<4, DATA>();
  |              ^^^^
  |
  = note: this may fail depending on what value the parameter takes

error: aborting due to 2 previous errors

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

=== stdout ===
=== stderr ===
error[E0770]: the type of const parameters must not depend on other generic parameters
 --> /home/runner/work/glacier/glacier/ices/71169.rs:4:43
  |
4 | fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
  |                                           ^^^ the type must not depend on the parameter `LEN`

error: constant expression depends on a generic parameter
 --> /home/runner/work/glacier/glacier/ices/71169.rs:8:14
  |
8 |     foo::<4, DATA>();
  |              ^^^^
  |
  = note: this may fail depending on what value the parameter takes

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0770`.
==============
@Alexendoo Alexendoo merged commit 5a2e8c8 into master Jul 17, 2020
@JohnTitor JohnTitor deleted the autofix/ices/71169.rs branch July 19, 2020 14:34
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