Skip to content
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

failure with non-UTF8 formatting leads to hard-to-debug error #16877

Closed
huonw opened this issue Aug 30, 2014 · 0 comments
Closed

failure with non-UTF8 formatting leads to hard-to-debug error #16877

huonw opened this issue Aug 30, 2014 · 0 comments

Comments

@huonw
Copy link
Member

@huonw huonw commented Aug 30, 2014

struct Foo;
impl std::fmt::Show for Foo {
    fn fmt(&self, fmtr:&mut std::fmt::Formatter) -> std::fmt::Result { 
        fmtr.write(&[0xFF])
    }
}
fn main() {
    fail!("{}", Foo)
}
task '<main>' failed at 'called `Result::unwrap()` on an `Err` value: [255]', /build/rust-git/src/rust/src/libcore/result.rs:548
playpen: application terminated with error code 101

At the very least it could mention the failure was caused by bad formatting while trying to unwind, or could use from_utf8_lossy.

bors added a commit that referenced this issue Sep 3, 2014
@bors bors closed this in #16940 Sep 3, 2014
nrc added a commit to nrc/rust that referenced this issue Sep 5, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant