mirror of
https://github.com/Noratrieb/accursed-unutterable-type-id.git
synced 2026-01-14 16:45:00 +01:00
Merge pull request #1 from wackbyte/sussy
fix release builds and sussy generation of inline type bounds
This commit is contained in:
commit
7182357992
2 changed files with 16 additions and 6 deletions
|
|
@ -49,11 +49,9 @@ pub fn my_macro(input: TokenStream) -> TokenStream {
|
|||
let name = input.ident;
|
||||
let generics1 = input.generics.params.iter().map(|p| match p {
|
||||
GenericParam::Type(ty) => {
|
||||
if ty.bounds.is_empty() {
|
||||
quote!(#ty: 'static)
|
||||
} else {
|
||||
quote!(#ty + 'static)
|
||||
}
|
||||
let name = &ty.ident;
|
||||
let bounds = ty.bounds.iter();
|
||||
quote!(#name: #(#bounds +)* 'static)
|
||||
}
|
||||
other => other.to_token_stream(),
|
||||
});
|
||||
|
|
|
|||
14
src/lib.rs
14
src/lib.rs
|
|
@ -85,7 +85,7 @@ impl InternalAccursedUnutterableTypeId {
|
|||
|
||||
#[cfg(not(debug_assertions))]
|
||||
impl InternalAccursedUnutterableTypeId {
|
||||
pub fn new(n: u64) -> Self {
|
||||
pub fn __internal_new(n: u64) -> Self {
|
||||
Self(n)
|
||||
}
|
||||
fn inner(self) -> u64 {
|
||||
|
|
@ -136,6 +136,18 @@ mod __doctest {
|
|||
/// ```
|
||||
mod complex {}
|
||||
|
||||
/// ```
|
||||
/// use accursed_unutterable_type_id::AccursedUnutterablyTypeIdentified;
|
||||
///
|
||||
/// trait Sussy {}
|
||||
///
|
||||
/// #[derive(AccursedUnutterablyTypeIdentified)]
|
||||
/// struct Uwu<T: Sussy, const N: usize> {
|
||||
/// _x: [T; N],
|
||||
/// }
|
||||
/// ```
|
||||
mod type_bounds {}
|
||||
|
||||
/// ```
|
||||
/// use accursed_unutterable_type_id::AccursedUnutterablyTypeIdentified;
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue