Skip to content

Commit 00a9b64

Browse files
authored
Merge pull request #226 from Imberflur/metatable-fix
2 parents e898794 + de124d9 commit 00a9b64

File tree

10 files changed

+362
-155
lines changed

10 files changed

+362
-155
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- nightly
2121
- beta
2222
- stable
23-
- 1.59.0 # MSRV
23+
- 1.65.0 # MSRV
2424

2525
timeout-minutes: 10
2626

@@ -62,7 +62,6 @@ jobs:
6262
miri:
6363
name: "Miri"
6464
runs-on: ubuntu-latest
65-
continue-on-error: true # Needed until all Miri errors are fixed
6665
steps:
6766
- uses: actions/checkout@v3
6867
- name: Install Miri
@@ -71,4 +70,7 @@ jobs:
7170
rustup override set nightly
7271
cargo miri setup
7372
- name: Test with Miri
74-
run: cargo miri test
73+
# Miri currently reports leaks in some tests so we disable that check
74+
# here (might be due to ptr-int-ptr in crossbeam-epoch so might be
75+
# resolved in future versions of that crate).
76+
run: MIRIFLAGS="-Zmiri-ignore-leaks" cargo miri test

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ categories = ["concurrency"]
1414
license = "MIT OR Apache-2.0"
1515
exclude = ["bors.toml", ".travis.yml"]
1616
edition = "2021"
17-
rust-version = "1.59.0"
17+
rust-version = "1.65.0"
1818

1919
[dependencies]
2020
ahash = "0.7.6"
@@ -35,6 +35,7 @@ shred-derive = { path = "shred-derive", version = "0.6.3" }
3535
[features]
3636
default = ["parallel", "shred-derive"]
3737
parallel = ["rayon"]
38+
nightly = []
3839

3940
[[example]]
4041
name = "async"

benches/bench.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
#![feature(test)]
22

3-
extern crate cgmath;
4-
extern crate shred;
5-
#[macro_use]
6-
extern crate shred_derive;
73
extern crate test;
84

95
use std::ops::{Index, IndexMut};

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
msrv = "1.56.1"
1+
msrv = "1.65.0"
22
disallowed-types = ["std::collections::HashMap"]

examples/basic_dispatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ impl<'a> System<'a> for PrintSystem {
2222
println!("{:?}", &*b);
2323

2424
*b = ResB; // We can mutate ResB here
25-
// because it's `Write`.
25+
// because it's `Write`.
2626
}
2727
}
2828

examples/dyn_sys_data.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ unsafe impl<T> CastFrom<T> for dyn Reflection
9999
where
100100
T: Reflection + 'static,
101101
{
102-
fn cast(t: &T) -> &Self {
103-
t
104-
}
105-
106-
fn cast_mut(t: &mut T) -> &mut Self {
102+
fn cast(t: *mut T) -> *mut Self {
107103
t
108104
}
109105
}
@@ -253,8 +249,8 @@ fn main() {
253249
{
254250
let mut table = res.entry().or_insert_with(ReflectionTable::new);
255251

256-
table.register(&Foo);
257-
table.register(&Bar);
252+
table.register::<Foo>();
253+
table.register::<Bar>();
258254
}
259255

260256
{

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg_attr(feature = "nightly", feature(ptr_metadata, strict_provenance))]
12
//! **Sh**ared **re**source **d**ispatcher
23
//!
34
//! This library allows to dispatch
@@ -82,6 +83,7 @@
8283
//! virtual function calls.
8384
8485
#![deny(unused_must_use, clippy::disallowed_types)]
86+
#![deny(unsafe_op_in_unsafe_fn)]
8587
#![warn(missing_docs)]
8688

8789
/// Re-exports from [`atomic_refcell`]

0 commit comments

Comments
 (0)