forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
10 changes: 8 additions & 2 deletions
10
src/test/ui/const-generics/const-param-type-depends-on-type-param.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
#![feature(const_generics)] | ||
//~^ WARN the feature `const_generics` is incomplete and may cause the compiler to crash | ||
|
||
pub struct Dependent<T, const X: T>([(); X]); //~ ERROR const parameters | ||
//~^ ERROR parameter `T` is never used | ||
// Currently, const parameters cannot depend on type parameters, because there is no way to | ||
// enforce the `structural_match` property on an arbitrary type parameter. This restriction | ||
// may be relaxed in the future. See https://github.com/rust-lang/rfcs/pull/2000 for more | ||
// details. | ||
|
||
pub struct Dependent<T, const X: T>([(); X]); | ||
//~^ ERROR const parameters cannot depend on type parameters | ||
//~^^ ERROR parameter `T` is never used | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters