Skip to content

std::timer::recv_timeout never receives #6089

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

Closed
mzabaluev opened this issue Apr 27, 2013 · 2 comments
Closed

std::timer::recv_timeout never receives #6089

mzabaluev opened this issue Apr 27, 2013 · 2 comments

Comments

@mzabaluev
Copy link
Contributor

The test:

extern mod std;

use std::timer::recv_timeout;
use std::uv_global_loop;
use core::comm::stream;

static TEST_TIMEOUT: uint = 500u;

fn main() {
    let mut (port, _) = stream::<task::TaskResult>();
    task::task()
        .future_result(|p| {
            port = p;
        })
        .spawn(|| {
            debug!("the task has run");
        });
    let res = recv_timeout(&uv_global_loop::get(), TEST_TIMEOUT, &port);
    assert!(res == Some(task::Success));
}

Fails the assertion, and then the program hangs up with:

rust: task failed at 'assertion failed: res == Some(task::Success)', recv-timeout.rs:17
rust: domain main @0x864edc0 root task failed
rust: task failed at 'killed', /home/mzabaluev/src/rust/src/libcore/pipes.rs:314
rust: task failed at 'killed', /home/mzabaluev/src/rust/src/libcore/pipes.rs:314

As a matter of fact, recv_timeout has not been able to wake up on any type of input I have tried.

mzabaluev added a commit to gi-rust/grust that referenced this issue Apr 28, 2013
Doc-commented rust-lang/rust#6089 as the reason why we can't timeout
on test tasks.
@bblum
Copy link
Contributor

bblum commented Jun 10, 2013

libextra::timer and libextra::net_tcp are deprecated pending #6435.

@emberian
Copy link
Member

emberian commented Aug 5, 2013

timer and net have been removed from extra, closing.

@emberian emberian closed this as completed Aug 5, 2013
flip1995 pushed a commit to flip1995/rust that referenced this issue Oct 9, 2020
…hearth

needless arbitrary self: handle macros

This fixes two cases related to macros:

* If the parameter comes from expansion, do not lint as the user has no possibility of changing it. This is not directly related to the fixed issue, but we should probably do that.
* If *only* the lifetime name comes from expansion, lint, but allow the user decide the name of the lifetime. In the related issue, the lifetime was unnamed and then renamed by `async_trait`, so just removing the name in the suggestion would work, but in the general case a macro can rename a lifetime that was named differently, and we can't reliably know that name anymore.

As a hint for the reviewer, the expanded code for the test can be checked with this command (from the root dir of the repo):
```sh
rustc -L target/debug/test_build_base/needless_arbitrary_self_type_unfixable.stage-id.aux -Zunpretty=expanded tests/ui/needless_arbitrary_self_type_unfixable.rs
```

changelog: [`needless_arbitrary_self_type`]: handle macros

Fixes rust-lang#6089
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants