-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chan::async() conflicts with Rust 2018 Edition #31
Comments
I don't think we need to rename anything? This crate should continue to work via Rust 2015. |
@troiganto Also, I expect to end-of-life |
I see, sorry for the noise then. I mainly stumbled over In any case, thanks for the speedy and helpful response! |
@troiganto Yeah, I really need to just update the READMEs for this project. crossbeam-channel is definitely the path forward at this point. I do expect to end-of-life |
@troiganto Doing a brief investigation, @vorner's You can basically re-create chan-signal with something like this, while swapping out whatever channel implementation you want: fn signal_notify(signals: &[c_int]) -> Result<chan::Receiver<c_int>> {
let (s, r) = chan::sync(100);
let signals = signal_hook::iterator::Signals::new(signals)?;
thread::spawn(move || {
for signal in signals.forever() {
s.send(signal);
}
});
Ok(r)
} |
For anyone trying to use Of course, this crate has been deprecated for https://github.com/crossbeam-rs/crossbeam-channel, so the long-term fix is likely moving over there. |
In Rust 2018,
async
will become a keyword and conflict with theasync()
function thatchan
currently defines. I only noticed this because cargo fix is currently unable to handle this case. The workaround right now is to add this line to the top of the crate:#![feature(raw_identifiers)]
and replace
chan::async()
withchan::r#async()
. However, in the long term, it might be a good idea to pick a different name. Thechan::sync()
function would likely have to be renamed as well, in order to stay symmetric.Despite this small issue, thank you for your work on this crate! I've used it several times now and it has always been a pleasure to work with. 🙂
The text was updated successfully, but these errors were encountered: