Skip to content

Commit

Permalink
Upgrade lock_api to 0.4.7
Browse files Browse the repository at this point in the history
This makes `Spinlock::new` a `const` function without needing nightly rust.
  • Loading branch information
jannic committed Feb 24, 2023
1 parent 3063ec5 commit 3235259
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ repository = "https://github.com/rust-osdev/spinning_top"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
nightly = ["lock_api/nightly"]
# Deprecated - has no effect
nightly = []
owning_ref = ["lock_api/owning_ref"]

[dependencies]
lock_api = "0.4.0"
lock_api = "0.4.7"

[package.metadata.release]
no-dev-version = true
Expand Down
2 changes: 2 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- Upgrade `lock_api` to 0.4.7. This makes `Spinlock::new` a `const` function without needing nightly rust.

# 0.2.4 – 2021-05-13

- Define `MappedSpinlockGuard` alias [#12](https://github.com/rust-osdev/spinning_top/pull/12)
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ fn make_uppercase(spinlock: &Spinlock<String>) {
}
```

## The `nightly` Feature

On Rust nightly, the `nightly` feature of this crate can be enabled to
make the `Spinlock::new` function a `const` function. This makes the `Spinlock` type
`Spinlock::new` is a `const` function. This makes the `Spinlock` type
usable in statics:

```rust
Expand Down
5 changes: 2 additions & 3 deletions src/spinlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,9 @@ unsafe impl RawMutex for RawSpinlock {
/// }
/// ```
///
/// ## Nightly Example
/// ## Usage in statics
///
/// On Rust nightly, the `nightly` feature of this crate can be enabled to
/// make the `new` function a `const` function. This makes the `Spinlock` type
/// `Spinlock::new` is a `const` function. This makes the `Spinlock` type
/// usable in statics:
///
/// ```rust,ignore
Expand Down

0 comments on commit 3235259

Please sign in to comment.