never type

This commit is contained in:
Intege-rs
2024-12-31 14:28:57 -05:00
parent d2aa7ca9fe
commit f4c294023e
4 changed files with 14 additions and 41 deletions

View File

@@ -1,4 +1,6 @@
#![no_std] #![feature(decl_macro)] #![allow(unused)]
#![no_std] #![feature(decl_macro)]
#![feature(inherent_associated_types)]
#![allow(unused, incomplete_features)]
//
@@ -22,6 +24,7 @@ pub mod fnv1;
pub mod pstruct;
pub mod align;
pub mod never;
//
// Export Preludes:
//
@@ -53,6 +56,7 @@ pub mod prelude {
pub use crate::pstruct::struct_offset;
pub use crate::pod::{Pod,Mut};
pub use crate::align::Align;
pub use crate::never::Never;
}
pub mod public {

9
sub/core/src/never.rs Normal file
View File

@@ -0,0 +1,9 @@
pub type Never = <fn()->! as Ret>::Ret;
trait Ret { type Ret; }
impl<R> Ret for fn() -> R {
type Ret=R;
}