-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not ICE on
ty::Bound
in Layout::compute
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#![feature(const_generics, const_evaluatable_checked)] | ||
#![allow(incomplete_features)] | ||
|
||
struct Bool<const B: bool>; | ||
|
||
trait True {} | ||
|
||
impl True for Bool<true> {} | ||
|
||
fn test<T, const P: usize>() where Bool<{core::mem::size_of::<T>() > 4}>: True { | ||
todo!() | ||
} | ||
|
||
fn main() { | ||
test::<2>(); | ||
//~^ ERROR wrong number of type | ||
//~| ERROR constant expression depends | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0107]: wrong number of type arguments: expected 1, found 0 | ||
--> $DIR/issue-76595.rs:15:5 | ||
| | ||
LL | test::<2>(); | ||
| ^^^^^^^^^ expected 1 type argument | ||
|
||
error: constant expression depends on a generic parameter | ||
--> $DIR/issue-76595.rs:15:5 | ||
| | ||
LL | fn test<T, const P: usize>() where Bool<{core::mem::size_of::<T>() > 4}>: True { | ||
| ---- required by a bound in this | ||
... | ||
LL | test::<2>(); | ||
| ^^^^^^^^^ | ||
| | ||
= note: this may fail depending on what value the parameter takes | ||
= note: required by this bound in `test` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0107`. |