Skip to content

Commit

Permalink
Add regression test for rust-lang#114217
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 11, 2023
1 parent e6a1069 commit 9195cf1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/ui/lazy-type-alias/issue-114217-const-generic.rs
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 tests/ui/lazy-type-alias/issue-114217-const-generic.stderr
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

0 comments on commit 9195cf1

Please sign in to comment.