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: indexes do not lie on character boundaries with byte literal and \r\n #16278

Closed
alexcrichton opened this issue Aug 5, 2014 · 0 comments · Fixed by #16282
Closed

ICE: indexes do not lie on character boundaries with byte literal and \r\n #16278

alexcrichton opened this issue Aug 5, 2014 · 0 comments · Fixed by #16282
Labels
A-parser Area: The parsing of Rust source code to an AST I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@alexcrichton
Copy link
Member

$ xxd foo.rs
0000000: 666e 2061 2829 207b 6222 5c0d 0a22 7d0a  fn a() {b"\.."}.
0000010: 0a                                       .
$ RUST_BACKTRACE=1 rustc foo.rs
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'index 2 and/or 4 in `\
` do not lie on character boundary', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libcore/str.rs:1768

stack backtrace:
   1:     0x7febd0162ef0 - rt::backtrace::imp::write::h738a1ec329d2ab70gcq
   2:     0x7febd0165f90 - failure::on_fail::he9f78b437e48797etxq
   3:     0x7febd0944860 - unwind::begin_unwind_inner::he4cbc144b846e4e2D8d
   4:     0x7febd0944550 - unwind::begin_unwind_fmt::h74ea8b12177cb5dd85d
   5:     0x7febd0944510 - rust_begin_unwind
   6:     0x7febd098a010 - failure::begin_unwind::h1acee634f6abe01ec0j
   7:     0x7febcc611080 - str::_&'a str.StrSlice<'a>::slice::hd2359a4b1465e5ce2Bi
   8:     0x7febcc643db0 - parse::byte_lit::h565f1502238b1235TDS
   9:     0x7febcc647360 - parse::binary_lit::h7a2ff40febd7d0d1SHS
  10:     0x7febcc6438b0 - parse::parser::Parser<'a>::lit_from_token::h2619d982bc809899VQJ
  11:     0x7febcc6479a0 - parse::parser::Parser<'a>::parse_lit::hb5dcfc17d4946d3bYSJ
  12:     0x7febcc649480 - parse::parser::Parser<'a>::parse_bottom_expr::hd048ad4072bbb63dR8J
  13:     0x7febcc6512b0 - parse::parser::Parser<'a>::parse_dot_or_call_expr::hf20fe37ea296ddd5hrK
  14:     0x7febcc6540a0 - parse::parser::Parser<'a>::parse_prefix_expr::hf0b790766645ef4c0IK
  15:     0x7febcc655360 - parse::parser::Parser<'a>::parse_binops::hdf675d76b72fe5a5uPK
  16:     0x7febcc655c00 - parse::parser::Parser<'a>::parse_assign_expr::h2ac986e1e60571a2VSK
  17:     0x7febcc657810 - parse::parser::Parser<'a>::parse_stmt::h36b2a72856d89d44tvL
  18:     0x7febcc662c00 - parse::parser::Parser<'a>::parse_block_tail_::h951e9bedaabb2323DGL
  19:     0x7febcc63bb00 - parse::parser::Parser<'a>::parse_inner_attrs_and_block::h5b6c6b27c4431517YEL
  20:     0x7febcc667b20 - parse::parser::Parser<'a>::parse_item_fn::ha36980a5a6b45c0d8jM
  21:     0x7febcc659e60 - parse::parser::Parser<'a>::parse_item_or_view_item::hfd0e5b474e14f140LhN
  22:     0x7febcc664080 - parse::parser::Parser<'a>::parse_items_and_view_items::hcce67098758a89eaGIN
  23:     0x7febcc66a710 - parse::parser::Parser<'a>::parse_mod_items::ha7d070970331324eLEM
  24:     0x7febcc6768b0 - parse::parser::Parser<'a>::parse_crate_mod::ha89f3d3a9b8794d2QNN
  25:     0x7febcc67bab0 - parse::parse_crate_from_file::h1a6e7e81a219b791B4R
  26:     0x7febd1597de0 - driver::driver::phase_1_parse_input::closure.129302
  27:     0x7febd13c1050 - driver::driver::phase_1_parse_input::hf54fd8b219bba0d1P0v
  28:     0x7febd158dcb0 - driver::driver::compile_input::h4d83a8e70f2d899ddWv
  29:     0x7febd162f310 - driver::run_compiler::h94472815a3840836V0y
  30:     0x7febd162f220 - driver::main_args::closure.134819
  31:     0x7febd1641220 - task::TaskBuilder<S>::try_future::closure.135966
  32:     0x7febd1641020 - task::TaskBuilder<S>::spawn_internal::closure.135943
  33:     0x7febd205fdd0 - task::spawn_opts::closure.8306
  34:     0x7febd099bb40 - rust_try
  35:     0x7febd0941ed0 - unwind::try::hb4e1dd4afa7176d00Wd
  36:     0x7febd0941c70 - task::Task::run::h2bae4479a1d71315C4c
  37:     0x7febd205fb90 - task::spawn_opts::closure.8249
  38:     0x7febd0943ab0 - thread::thread_start::h3fdd510979cf01c4Msd
  39:     0x7febcfbf90c0 - start_thread
  40:     0x7febd060d2d9 - __clone
  41:                0x0 - <unknown>

This is one reason rust-openssl cannot compile on windows.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Aug 6, 2014
This ended up passing through the lexer but dying later on in parsing when it
wasn't handled. The strategy taken was to copy the `str_lit` funciton, but adapt
it for bytes.

Closes rust-lang#16278
pnkfelix added a commit to pnkfelix/rust that referenced this issue Sep 11, 2018
kennytm added a commit to kennytm/rust that referenced this issue Sep 12, 2018
…278, r=wesleywiser

Recover proper regression test for issue rust-lang#16278.

Spawned from my note rust-lang#19955 (comment)
bors added a commit that referenced this issue Sep 12, 2018
Rollup of 15 pull requests

Successful merges:

 - #52514 (Fix a few AMDGPU related issues)
 - #53703 (Document .0 to unpack integer from Wrapping)
 - #53777 (Implemented map_or_else for Result<T, E>)
 - #54031 (A few cleanups and minor improvements to rustc_passes)
 - #54046 (Update documentation for fill_buf in std::io::BufRead)
 - #54064 (`&CStr`, not `CStr`, is the counterpart of `&str`)
 - #54072 (Stabilization change for mod.rs)
 - #54073 (docs: Use dollar sign for all bash prompts)
 - #54074 (simplify ordering for Kind)
 - #54085 (Remove documentation about proc_macro being bare-bones)
 - #54087 (rustdoc: Remove generated blanket impls from trait pages)
 - #54106 (Reexport CheckLintNameResult)
 - #54107 (Fix typos in libstd hash map)
 - #54136 (Update LLVM to fix GlobalISel dbg.declare)
 - #54142 (Recover proper regression test for issue #16278.)

Failed merges:

r? @ghost
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Mar 10, 2024
fix: panic when using float numbers without dots in chain calls

Fix rust-lang#16278.

This PR fixes the panic caused by using floating-point numbers without a dot (such as `1e2`) in chain calls.

-------------

Although this syntax is very odd 🤣, r-a should not panic.
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 I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant