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

Panic in char index #136

Closed
GuillaumeGomez opened this issue Jul 10, 2024 · 2 comments
Closed

Panic in char index #136

GuillaumeGomez opened this issue Jul 10, 2024 · 2 comments

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Jul 10, 2024

While working on rust-lang/rust-clippy#11421, I encountered this error:

thread 'main' panicked at /home/imperio/.cargo/registry/src/index.crates.io-6f17d22bba15001f/annotate-snippets-0.11.4/src/renderer/display_list.rs:1103:29:
byte index 18 is not a char boundary; it is inside '脑' (bytes 16..19) of `    let _ = "电脑\0".as_ptr();`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

with this code:

fn main() {
    let _ = "电脑\0".as_ptr();
    //~^ clippy::manual_c_str_literals
}

I would have loved to send a fix but I couldn't figure out how to add a test. ^^'

@oli-obk
Copy link
Contributor

oli-obk commented Jul 11, 2024

I had seen some ui test issues like that but I thought I fixed them once and for all. Maybe the fix isn't published and used in clippy yet

@oli-obk
Copy link
Contributor

oli-obk commented Jul 11, 2024

definitely not annotate-snippets' fault, so closing

@oli-obk oli-obk closed this as completed Jul 11, 2024
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