Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust: [stable, 1.61.0, 1.34.0]
rust: [stable, 1.75.0]
timeout-minutes: 45
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ documentation = "https://docs.rs/typeid"
edition = "2018"
license = "MIT OR Apache-2.0"
repository = "https://github.com/dtolnay/typeid"
rust-version = "1.34"
rust-version = "1.75"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
Expand Down
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::manual_let_else)]

use std::env;
use std::process::Command;
use std::str;
Expand Down
10 changes: 7 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@

#![no_std]
#![doc(html_root_url = "https://docs.rs/typeid/1.0.1")]
#![allow(clippy::doc_markdown, clippy::inline_always)]
#![allow(
clippy::doc_markdown,
clippy::inline_always,
clippy::unnecessary_cast, // https://github.com/rust-lang/rust-clippy/issues/12860
)]

extern crate self as typeid;

Expand All @@ -119,7 +123,7 @@ use core::fmt::{self, Debug};
#[cfg(not(no_const_type_id))]
use core::hash::{Hash, Hasher};
use core::marker::PhantomData;
use core::mem;
use core::ptr;

#[cfg(not(no_const_type_id))]
#[derive(Copy, Clone)]
Expand Down Expand Up @@ -217,6 +221,6 @@ where

let phantom_data = PhantomData::<T>;
NonStaticAny::get_type_id(unsafe {
mem::transmute::<&dyn NonStaticAny, &(dyn NonStaticAny + 'static)>(&phantom_data)
&*(ptr::addr_of!(phantom_data) as *const (dyn NonStaticAny + 'static))
})
}