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

"é" in the code caused "bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32" #80134

Closed
sylvestre opened this issue Dec 17, 2020 · 6 comments · Fixed by #80185
Closed

"é" in the code caused "bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32" #80134

sylvestre opened this issue Dec 17, 2020 · 6 comments · Fixed by #80185
Assignees
Labels
A-parser Area: The parsing of Rust source code to an AST A-Unicode Area: Unicode C-bug Category: This is a bug. D-Unicode-unaware Diagnostics: Diagnostics that are unaware of Unicode and trigger codepoint boundary assertions glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@sylvestre
Copy link
Contributor

Was reported here : #68730
but still occurring.

Code

fn main() {
    let matches = App::new()
        .arg(
            Arg::with_name(OPT_MODE)é
        );
    
}

Meta

rustc --version --verbose:

rustc 1.50.0-nightly (b32e6e6ac 2020-12-16)
binary: rustc
commit-hash: b32e6e6ac8921035177256ab6806e6ab0d4b9b94
commit-date: 2020-12-16
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Error output

  Compiling bug v0.1.0 (/tmp/bug)
     Running `rustc --crate-name bug --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=51917d1ea2d63dad -C extra-filename=-51917d1ea2d63dad --out-dir /tmp/bug/target/debug/deps -C incremental=/tmp/bug/target/debug/incremental -L dependency=/tmp/bug/target/debug/deps`
thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1489:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.50.0-nightly (b32e6e6ac 2020-12-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `bug`

Caused by:
  process didn't exit successfully: `rustc --crate-name bug --edition=2018 src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=51917d1ea2d63dad -C extra-filename=-51917d1ea2d63dad --out-dir /tmp/bug/target/debug/deps -C incremental=/tmp/bug/target/debug/incremental -L dependency=/tmp/bug/target/debug/deps` (exit code: 101)
Backtrace

thread 'rustc' panicked at 'assertion failed: bpos.to_u32() >= mbc.pos.to_u32() + mbc.bytes as u32', compiler/rustc_span/src/lib.rs:1489:17
stack backtrace:
   0: rust_begin_unwind
             at /rustc/b32e6e6ac8921035177256ab6806e6ab0d4b9b94/library/std/src/panicking.rs:493:5
   1: core::panicking::panic_fmt
             at /rustc/b32e6e6ac8921035177256ab6806e6ab0d4b9b94/library/core/src/panicking.rs:92:14
   2: core::panicking::panic
             at /rustc/b32e6e6ac8921035177256ab6806e6ab0d4b9b94/library/core/src/panicking.rs:50:5
   3: rustc_span::SourceFile::lookup_file_pos
   4: rustc_span::SourceFile::lookup_file_pos_with_col_display
   5: rustc_span::source_map::SourceMap::is_multiline
   6: rustc_parse::parser::Parser::parse_seq_to_before_tokens
   7: rustc_parse::parser::Parser::parse_delim_comma_seq
   8: rustc_parse::parser::expr::<impl rustc_parse::parser::Parser>::parse_dot_or_call_expr_with_
   9: rustc_parse::parser::expr::<impl rustc_parse::parser::Parser>::parse_dot_or_call_expr_with
  10: rustc_parse::parser::expr::<impl rustc_parse::parser::Parser>::parse_prefix_expr::{{closure}}
  11: rustc_parse::parser::expr::<impl rustc_parse::parser::Parser>::parse_prefix_expr
  12: rustc_parse::parser::expr::<impl rustc_parse::parser::Parser>::parse_assoc_expr_with
  13: rustc_parse::parser::stmt::<impl rustc_parse::parser::Parser>::parse_local
  14: rustc_parse::parser::stmt::<impl rustc_parse::parser::Parser>::parse_stmt_without_recovery::{{closure}}
  15: rustc_parse::parser::stmt::<impl rustc_parse::parser::Parser>::parse_stmt_without_recovery
  16: rustc_parse::parser::stmt::<impl rustc_parse::parser::Parser>::parse_full_stmt
  17: rustc_parse::parser::stmt::<impl rustc_parse::parser::Parser>::parse_block_tail
  18: rustc_parse::parser::stmt::<impl rustc_parse::parser::Parser>::parse_block_common
  19: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item_kind
  20: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item_common_
  21: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item_common
  22: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_item
  23: rustc_parse::parser::item::<impl rustc_parse::parser::Parser>::parse_mod
  24: rustc_parse::parse_crate_from_file
  25: rustc_session::utils::<impl rustc_session::session::Session>::time
  26: rustc_interface::passes::parse
  27: rustc_interface::queries::Queries::parse
  28: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  29: rustc_span::with_source_map
  30: rustc_interface::interface::create_compiler_and_run
  31: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.50.0-nightly (b32e6e6ac 2020-12-16) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

@sylvestre sylvestre added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 17, 2020
@camelid camelid added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Dec 17, 2020
@jyn514 jyn514 added A-Unicode Area: Unicode A-parser Area: The parsing of Rust source code to an AST labels Dec 18, 2020
@fanninpm
Copy link

fanninpm added a commit to fanninpm/glacier that referenced this issue Dec 18, 2020
@mbartlett21
Copy link
Contributor

Simpler repro:

fn main() {
    (()é)
}

(playground)

@rylev
Copy link
Member

rylev commented Dec 18, 2020

I assume this repros for any non-ascii character, right? I tried with ü, ß, and 名, and I was able to repro.

@sylvestre
Copy link
Contributor Author

Correct :) é was just the character my big fingers typed when I found that bug!

@camelid camelid added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Dec 18, 2020
@camelid
Copy link
Member

camelid commented Dec 18, 2020

Assigning P-medium and removing I-prioritize as discussed in the prioritization working group.

@JohnTitor JohnTitor self-assigned this Dec 19, 2020
fanninpm added a commit to fanninpm/glacier that referenced this issue Dec 19, 2020
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Dec 20, 2020
@matthiaskrgr
Copy link
Member

This is a regression since 1.46
@rustbot modify labels: +regression-from-stable-to-stable

@rustbot rustbot added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Dec 20, 2020
@bors bors closed this as completed in 1caa5b0 Dec 30, 2020
@jieyouxu jieyouxu added the D-Unicode-unaware Diagnostics: Diagnostics that are unaware of Unicode and trigger codepoint boundary assertions label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST A-Unicode Area: Unicode C-bug Category: This is a bug. D-Unicode-unaware Diagnostics: Diagnostics that are unaware of Unicode and trigger codepoint boundary assertions glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.