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

toml::de::Error::message returning empty string (regression from 0.5) #519

Open
ahl opened this issue Feb 18, 2023 · 1 comment
Open

toml::de::Error::message returning empty string (regression from 0.5) #519

ahl opened this issue Feb 18, 2023 · 1 comment
Labels
A-error Area: Error reporting C-bug Category: Things not working as expected

Comments

@ahl
Copy link

ahl commented Feb 18, 2023

#[test]
fn has_message() {
    #[derive(Deserialize)]
    struct Config {
        thing: String,
    }

    let contents = "foo =";
    let config_parsed = toml::from_str::<Config>(contents);
    let Err(e) = config_parsed else { panic!("ok") };
    assert!(!e.message().is_empty());
}

In 0.5 there was no message() function, but Display for toml::de::Error used to report this "unexpected eof encountered at line 1 column 6"

@ahl ahl changed the title toml::de::Error::message returning empty string (regression from 0.5) toml::de::Error::message returning empty string (regression from 0.5) Feb 18, 2023
@epage
Copy link
Member

epage commented Feb 18, 2023

Related: #450

@epage epage added C-bug Category: Things not working as expected A-error Area: Error reporting labels Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-error Area: Error reporting C-bug Category: Things not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants