-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HIR Typecheck - Properly pass type params to const evaluation (re #322)
- Loading branch information
1 parent
994ddf8
commit 5e01a76
Showing
3 changed files
with
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// ignore-test - Rustc doesn't allow this, plus it doesn't specify the type for the `Vec<_>` | ||
#![crate_type = "lib"] | ||
struct Assert<const COND: bool>; | ||
trait IsTrue {} | ||
impl IsTrue for Assert<true> {} | ||
trait IsNotZst {} | ||
impl<T> IsNotZst for T | ||
where | ||
Assert<{ std::mem::size_of::<T>() > 0 }>: IsTrue, | ||
{} | ||
fn assert_not_zero_sized<T: IsNotZst>(_: T) {} | ||
fn main() { | ||
assert_not_zero_sized(vec![]); | ||
} |
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