forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add regression test for rust-lang#114217
- Loading branch information
1 parent
e6a1069
commit 9195cf1
Showing
2 changed files
with
28 additions
and
0 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,17 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/114217>. | ||
// It ensures that enabling the lazy_type_alias` feature doesn't prevent | ||
// const generics to work with type aliases. | ||
|
||
// compile-flags: --crate-type lib | ||
// check-pass | ||
|
||
#![feature(lazy_type_alias)] | ||
//~^ WARN the feature `lazy_type_alias` is incomplete and may not be safe to use | ||
|
||
pub type Word = usize; | ||
|
||
pub struct IBig(usize); | ||
|
||
pub const fn base_as_ibig<const B: Word>() -> IBig { | ||
IBig(B) | ||
} |
11 changes: 11 additions & 0 deletions
11
tests/ui/lazy-type-alias/issue-114217-const-generic.stderr
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,11 @@ | ||
warning: the feature `lazy_type_alias` is incomplete and may not be safe to use and/or cause compiler crashes | ||
--> $DIR/issue-114217-const-generic.rs:8:12 | ||
| | ||
LL | #![feature(lazy_type_alias)] | ||
| ^^^^^^^^^^^^^^^ | ||
| | ||
= note: see issue #112792 <https://github.com/rust-lang/rust/issues/112792> for more information | ||
= note: `#[warn(incomplete_features)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|