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

ICE in libsyntax/codemap.rs #11136

Closed
lambda-fairy opened this issue Dec 25, 2013 · 0 comments
Closed

ICE in libsyntax/codemap.rs #11136

lambda-fairy opened this issue Dec 25, 2013 · 0 comments

Comments

@lambda-fairy
Copy link
Contributor

Here's a Christmas present for you all:

$ rustc --version
rustc 0.9-pre (b8c87fd 2013-12-24 01:56:30 -0800)
host: x86_64-unknown-linux-gnu

$ rustc main.rs
task 'rustc' failed at 'assertion failed: bpos == mbc.pos || bpos.to_uint() >= mbc.pos.to_uint() + mbc.bytes', /home/chris/.local/rust/src/libsyntax/codemap.rs:479
error: internal compiler error: unexpected failure
...
task '<main>' failed at 'explicit failure', /home/chris/.local/rust/src/librustc/lib.rs:443

The code that causes it is here. I couldn't reduce it further, so I hope it's clear enough.

huonw added a commit to huonw/rust that referenced this issue Feb 23, 2014
file.

Previously multibyte UTF-8 chars were being recorded as byte offsets
from the start of the file, and then later compared against global byte
positions, resulting in the compiler possibly thinking it had a byte
position pointing inside a multibyte character, if there were multibyte
characters in any non-crate files. (Although, sometimes the byte offsets
line up just right to not ICE, but that was a coincidence.)

Fixes rust-lang#11136.
Fixes rust-lang#11178.
@huonw huonw closed this as completed in ff79a44 Feb 25, 2014
larsbergstrom pushed a commit to larsbergstrom/rust that referenced this issue Apr 1, 2014
file.

Previously multibyte UTF-8 chars were being recorded as byte offsets
from the start of the file, and then later compared against global byte
positions, resulting in the compiler possibly thinking it had a byte
position pointing inside a multibyte character, if there were multibyte
characters in any non-crate files. (Although, sometimes the byte offsets
line up just right to not ICE, but that was a coincidence.)

Fixes rust-lang#11136.
Fixes rust-lang#11178.
flip1995 pushed a commit to flip1995/rust that referenced this issue Feb 27, 2024
…=dswij

[`read_line_without_trim`]: detect string literal comparison and `.ends_with()` calls

This lint now also realizes that a comparison like `s == "foo"` and calls such as `s.ends_with("foo")` will fail if `s` was initialized by a call to `Stdin::read_line` (because of the trailing newline).

changelog: [`read_line_without_trim`]: detect string literal comparison and `.ends_with()` calls

r? `@giraffate` assigning you because you reviewed rust-lang#10970 that added this lint, so this is kinda a followup PR ^^
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

1 participant