-
Notifications
You must be signed in to change notification settings - Fork 13.8k
typeck: always expose repeat count AnonConst
s' parent in generics_of
.
#70452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2bbc33a
38d3834
5ebd300
ad1617b
8989029
8bb7b7b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
error[E0277]: the trait bound `A: Foo` is not satisfied | ||
error: constant expression depends on a generic parameter | ||
--> $DIR/associated-const-type-parameter-arrays-2.rs:16:22 | ||
| | ||
LL | const Y: usize; | ||
| --------------- required by `Foo::Y` | ||
... | ||
LL | let _array = [4; <A as Foo>::Y]; | ||
| ^^^^^^^^^^^^^ the trait `Foo` is not implemented for `A` | ||
| ^^^^^^^^^^^^^ | ||
| | ||
help: consider further restricting this bound | ||
| | ||
LL | pub fn test<A: Foo + Foo, B: Foo>() { | ||
| ^^^^^ | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
// build-pass | ||
|
||
fn foo<const N: usize>() { | ||
let _ = [0u64; N + 1]; | ||
//~^ ERROR constant expression depends on a generic parameter | ||
} | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,13 @@ LL | #![feature(const_generics)] | |
| | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
error: constant expression depends on a generic parameter | ||
--> $DIR/issue-62456.rs:5:20 | ||
| | ||
LL | let _ = [0u64; N + 1]; | ||
| ^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
// check-pass | ||
|
||
#![allow(incomplete_features, dead_code, unconditional_recursion)] | ||
#![feature(const_generics)] | ||
|
||
fn fact<const N: usize>() { | ||
fact::<{ N - 1 }>(); | ||
//~^ ERROR constant expression depends on a generic parameter | ||
} | ||
|
||
fn main() {} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: constant expression depends on a generic parameter | ||
--> $DIR/issue-66205.rs:5:12 | ||
| | ||
LL | fact::<{ N - 1 }>(); | ||
| ^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: aborting due to previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
error: constant expression depends on a generic parameter | ||
--> $DIR/issue-67739.rs:12:15 | ||
| | ||
LL | [0u8; mem::size_of::<Self::Associated>()]; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
|
||
error: aborting due to previous error | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
fn main() { | ||
[(); { &loop { break } as *const _ as usize } ]; | ||
//~^ ERROR `loop` is not allowed in a `const` | ||
//~| ERROR casting pointers to integers in constants is unstable | ||
//~| ERROR evaluation of constant value failed | ||
} |
Uh oh!
There was an error while loading. Please reload this page.