Skip to content

Commit

Permalink
Merge pull request #226 from Imberflur/metatable-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Imberflur authored Sep 16, 2023
2 parents e898794 + de124d9 commit 00a9b64
Show file tree
Hide file tree
Showing 10 changed files with 362 additions and 155 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- nightly
- beta
- stable
- 1.59.0 # MSRV
- 1.65.0 # MSRV

timeout-minutes: 10

Expand Down Expand Up @@ -62,7 +62,6 @@ jobs:
miri:
name: "Miri"
runs-on: ubuntu-latest
continue-on-error: true # Needed until all Miri errors are fixed
steps:
- uses: actions/checkout@v3
- name: Install Miri
Expand All @@ -71,4 +70,7 @@ jobs:
rustup override set nightly
cargo miri setup
- name: Test with Miri
run: cargo miri test
# Miri currently reports leaks in some tests so we disable that check
# here (might be due to ptr-int-ptr in crossbeam-epoch so might be
# resolved in future versions of that crate).
run: MIRIFLAGS="-Zmiri-ignore-leaks" cargo miri test
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ categories = ["concurrency"]
license = "MIT OR Apache-2.0"
exclude = ["bors.toml", ".travis.yml"]
edition = "2021"
rust-version = "1.59.0"
rust-version = "1.65.0"

[dependencies]
ahash = "0.7.6"
Expand All @@ -35,6 +35,7 @@ shred-derive = { path = "shred-derive", version = "0.6.3" }
[features]
default = ["parallel", "shred-derive"]
parallel = ["rayon"]
nightly = []

[[example]]
name = "async"
Expand Down
4 changes: 0 additions & 4 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#![feature(test)]

extern crate cgmath;
extern crate shred;
#[macro_use]
extern crate shred_derive;
extern crate test;

use std::ops::{Index, IndexMut};
Expand Down
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
msrv = "1.56.1"
msrv = "1.65.0"
disallowed-types = ["std::collections::HashMap"]
2 changes: 1 addition & 1 deletion examples/basic_dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'a> System<'a> for PrintSystem {
println!("{:?}", &*b);

*b = ResB; // We can mutate ResB here
// because it's `Write`.
// because it's `Write`.
}
}

Expand Down
10 changes: 3 additions & 7 deletions examples/dyn_sys_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,7 @@ unsafe impl<T> CastFrom<T> for dyn Reflection
where
T: Reflection + 'static,
{
fn cast(t: &T) -> &Self {
t
}

fn cast_mut(t: &mut T) -> &mut Self {
fn cast(t: *mut T) -> *mut Self {
t
}
}
Expand Down Expand Up @@ -253,8 +249,8 @@ fn main() {
{
let mut table = res.entry().or_insert_with(ReflectionTable::new);

table.register(&Foo);
table.register(&Bar);
table.register::<Foo>();
table.register::<Bar>();
}

{
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg_attr(feature = "nightly", feature(ptr_metadata, strict_provenance))]
//! **Sh**ared **re**source **d**ispatcher
//!
//! This library allows to dispatch
Expand Down Expand Up @@ -82,6 +83,7 @@
//! virtual function calls.

#![deny(unused_must_use, clippy::disallowed_types)]
#![deny(unsafe_op_in_unsafe_fn)]
#![warn(missing_docs)]

/// Re-exports from [`atomic_refcell`]
Expand Down
Loading

0 comments on commit 00a9b64

Please sign in to comment.