Skip to content

Commit

Permalink
update to Rust 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
Be-ing committed Dec 10, 2022
1 parent 35e783a commit 6747f1c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ version = "0.2.0-alpha.4"
authors = ["John-John Tedro <[email protected]>"]
# Generic associated types were stabilized in 1.65.
rust-version = "1.65"
edition = "2018"
edition = "2021"
documentation = "https://docs.rs/audio"
homepage = "https://github.com/udoprog/audio"
repository = "https://github.com/udoprog/audio"
Expand Down
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "examples"
version = "0.0.0"
authors = ["John-John Tedro <[email protected]>"]
edition = "2018"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion generate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "generate"
version = "0.0.0"
authors = ["John-John Tedro <[email protected]>"]
edition = "2018"
edition.workspace = true
publish = false

[dependencies]
Expand Down
2 changes: 2 additions & 0 deletions ste/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ impl Thread {
move |tag| {
if let Some(task) = task.take() {
let _ = panic::catch_unwind(panic::AssertUnwindSafe(|| {
let _ = &storage;
let output = with_tag(tag, task);

// Safety: we're the only one with access to this pointer,
Expand Down Expand Up @@ -632,6 +633,7 @@ impl Builder {
let handle = thread::Builder::new()
.name(String::from("ste-thread"))
.spawn(move || {
let _ = &shared2;
let RawSend(shared) = shared2;

#[cfg(feature = "tokio")]
Expand Down
2 changes: 2 additions & 0 deletions ste/src/wait_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ where
use std::panic;

move |tag| {
let _ = (&waker, &future, &complete);
unsafe {
// Safety: At this point, we know the waker has been
// replaced by the polling task and can safely deref it into
Expand All @@ -82,6 +83,7 @@ where
let future = Pin::new_unchecked(future.0.as_mut());

let result = panic::catch_unwind(panic::AssertUnwindSafe(|| {
let _ = &output;
if let Poll::Ready(ready) = with_tag(tag, || future.poll(&mut cx)) {
*output.0.as_mut() = Some(ready);
}
Expand Down

0 comments on commit 6747f1c

Please sign in to comment.