Skip to content

println! sometimes panics in drop methods - 2 #49143

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
DustinByfuglien opened this issue Mar 18, 2018 · 1 comment
Closed

println! sometimes panics in drop methods - 2 #49143

DustinByfuglien opened this issue Mar 18, 2018 · 1 comment

Comments

@DustinByfuglien
Copy link

There was issue #29488

I don't know is it possible to reopen it. And create a new that continues that discussion.

There is another case when applications panic while using drop/TLS/println:

struct Foo {}

impl Drop for Foo {
    fn drop(&mut self) {
        println!("drop begin");
    }
}


thread_local! {
    static FOO: Foo = Foo{};
}


fn main() {
    println!("main begin");
    FOO.with(|_| {});
}

This code output is:

main begin
thread '<unnamed>' panicked at 'cannot access stdout during shutdown', libcore\option.rs:916:5

My point of view is it also must be fixed in Rust language.

rustc 1.26.0-nightly (adf2135 2018-03-17)

@pietroalbini
Copy link
Member

Closing this issue as a duplicate, but I have reopened the other one. Thank you!

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

2 participants