diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94a1d63..b89816e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Cargo.toml b/Cargo.toml index d9bd018..2b940c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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"] diff --git a/build.rs b/build.rs index 969cf4e..d79437e 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,5 @@ +#![allow(clippy::manual_let_else)] + use std::env; use std::process::Command; use std::str; diff --git a/src/lib.rs b/src/lib.rs index 5f1a729..2518bfb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; @@ -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)] @@ -217,6 +221,6 @@ where let phantom_data = PhantomData::; NonStaticAny::get_type_id(unsafe { - mem::transmute::<&dyn NonStaticAny, &(dyn NonStaticAny + 'static)>(&phantom_data) + &*(ptr::addr_of!(phantom_data) as *const (dyn NonStaticAny + 'static)) }) }