Skip to content

Commit

Permalink
Merge pull request #79 from dtolnay/miritypecheck
Browse files Browse the repository at this point in the history
Fully re-enable type checking under Miri
  • Loading branch information
dtolnay authored Aug 26, 2023
2 parents a1b66a1 + e0c5488 commit 290ef44
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl Any {

// This is unsafe -- caller is responsible that T is the correct type.
pub(crate) unsafe fn view<T>(&mut self) -> &mut T {
if cfg!(not(miri)) && self.type_id != non_static_type_id::<T>() {
if self.type_id != non_static_type_id::<T>() {
self.invalid_cast_to::<T>();
}

Expand All @@ -86,7 +86,7 @@ impl Any {

// This is unsafe -- caller is responsible that T is the correct type.
pub(crate) unsafe fn take<T>(mut self) -> T {
if cfg!(not(miri)) && self.type_id != non_static_type_id::<T>() {
if self.type_id != non_static_type_id::<T>() {
self.invalid_cast_to::<T>();
}

Expand Down

0 comments on commit 290ef44

Please sign in to comment.