Skip to content
Open
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
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rustflags: ""
- name: Build
run: cargo build --verbose
- name: Run tests
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ categories = [
keywords = ["hashconsing", "hash", "consing", "sharing", "caching"]
license = "MIT/Apache-2.0"
edition = "2021"
rust-version = "1.60"

[package.metadata.docs.rs]
features = ["unstable_docrs"]
Expand Down
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.90.0"
components = [ "rustfmt", "rustc", "rust-analyzer", "clippy" ]
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,6 @@
//! [lazy static]: https://crates.io/crates/lazy_static
//! (lazy_static library on crates.io)

#![deny(warnings)]

use std::{
cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd},
collections::{hash_map::RandomState, HashMap},
Expand Down
73 changes: 37 additions & 36 deletions tests/try_build/issue_1.stderr
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
error[E0277]: `Cell<RefOrInt<'_>>` cannot be shared between threads safely
--> tests/try_build/issue_1.rs:37:17
|
37 | s.spawn(move |_| {
| ___________-----_^
| | |
| | required by a bound introduced by this call
38 | | let smuggled_cell = &hcons_cell_ref.get().cell;
39 | |
40 | | loop {
... |
44 | | }
45 | | });
| |_________^ `Cell<RefOrInt<'_>>` cannot be shared between threads safely
|
= help: within `&HashableCell<RefOrInt<'_>>`, the trait `Sync` is not implemented for `Cell<RefOrInt<'_>>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock`
--> tests/try_build/issue_1.rs:37:17
|
37 | s.spawn(move |_| {
| ___________-----_^
| | |
| | required by a bound introduced by this call
38 | | let smuggled_cell = &hcons_cell_ref.get().cell;
39 | |
40 | | loop {
... |
45 | | });
| |_________^ `Cell<RefOrInt<'_>>` cannot be shared between threads safely
|
= help: within `&HashableCell<RefOrInt<'_>>`, the trait `Sync` is not implemented for `Cell<RefOrInt<'_>>`
= note: if you want to do aliasing and mutation between multiple threads, use `std::sync::RwLock`
note: required because it appears within the type `HashableCell<RefOrInt<'_>>`
--> tests/try_build/issue_1.rs:18:8
|
18 | struct HashableCell<T: Eq + PartialEq + Copy> {
| ^^^^^^^^^^^^
= note: required because it appears within the type `&HashableCell<RefOrInt<'_>>`
= note: required for `Arc<&HashableCell<RefOrInt<'_>>>` to implement `Send`
--> tests/try_build/issue_1.rs:18:8
|
18 | struct HashableCell<T: Eq + PartialEq + Copy> {
| ^^^^^^^^^^^^
= note: required because it appears within the type `&HashableCell<RefOrInt<'_>>`
= note: required for `Arc<&HashableCell<RefOrInt<'_>>>` to implement `Send`
note: required because it appears within the type `HConsed<&HashableCell<RefOrInt<'_>>>`
--> src/lib.rs
|
| pub struct HConsed<T> {
| ^^^^^^^
--> src/lib.rs
|
| pub struct HConsed<T> {
| ^^^^^^^
note: required because it's used within this closure
--> tests/try_build/issue_1.rs:37:17
|
37 | s.spawn(move |_| {
| ^^^^^^^^
--> tests/try_build/issue_1.rs:37:17
|
37 | s.spawn(move |_| {
| ^^^^^^^^
note: required by a bound in `crossbeam_utils::thread::Scope::<'env>::spawn`
--> $CARGO/crossbeam-utils-0.8.16/src/thread.rs
|
| pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T>
| ----- required by a bound in this associated function
--> $CARGO/crossbeam-utils-0.8.16/src/thread.rs
|
| pub fn spawn<'scope, F, T>(&'scope self, f: F) -> ScopedJoinHandle<'scope, T>
| ----- required by a bound in this associated function
...
| F: Send + 'env,
| ^^^^ required by this bound in `Scope::<'env>::spawn`
| F: Send + 'env,
| ^^^^ required by this bound in `Scope::<'env>::spawn`
= note: the full name for the type has been written to '$DIR/target/tests/trybuild/x86_64-unknown-linux-gnu/debug/deps/$CRATE-76e50dc660537114.long-type-11250377124028636655.txt'
= note: consider using `--verbose` to print the full type name to the console
Loading