fune/third_party/rust/oneshot/examples/recv_with_dropped_sender.rs
Ben Dean-Kawamura a889812ec8 Bug 1867639 - Vendor in new application-services / Glean / UniFFI. r=markh,janerik,supply-chain-reviewers,mach-reviewers,ahal
Updated uniffi-bindgen-gecko-js to work with UniFFI 0.25.2:
- Use `config.toml` to list UniFFI sources.  This makes it easier to
  associate data with them, for example the `crate_name` field that's
  now required to generate the sources.
- Enable the `extern-rustbuffer` feature on `uniffi_core`
- Updated the external types fixture to work around
  https://github.com/mozilla/uniffi-rs/issues/1872

Ran mach vendor and mach cargo vet to update the Rust crates.

Differential Revision: https://phabricator.services.mozilla.com/D195163
2023-12-05 19:55:30 +00:00

11 lines
275 B
Rust

#[cfg(feature = "std")]
fn main() {
let (sender, receiver) = oneshot::channel::<u128>();
std::mem::drop(sender);
receiver.recv().unwrap_err();
}
#[cfg(not(feature = "std"))]
fn main() {
panic!("This example is only for when the \"sync\" feature is used");
}