about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/attributes.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-15 13:49:24 +0000
committerbors <bors@rust-lang.org>2023-08-15 13:49:24 +0000
commit4f4dae055b470c889968b02964a28477f9daff62 (patch)
treede40140336f8655255eab3ccecedfbf222455693 /compiler/rustc_codegen_llvm/src/attributes.rs
parentc1699a79a603faa8b522a4b51553b6781913a50e (diff)
parent2f75dd4e193fc0626dab44b6d76bc2b377fd1f3d (diff)
downloadrust-4f4dae055b470c889968b02964a28477f9daff62.tar.gz
rust-4f4dae055b470c889968b02964a28477f9daff62.zip
Auto merge of #112387 - clarfonthey:non-panicking-ceil-char-boundary, r=m-ou-se
Don't panic in ceil_char_boundary

Implementing the alternative mentioned in this comment: https://github.com/rust-lang/rust/issues/93743#issuecomment-1579935853

Since `floor_char_boundary` will always work (rounding down to the length of the string is possible), it feels best for `ceil_char_boundary` to not panic either. However, the semantics of "rounding up" past the length of the string aren't very great, which is why the method originally panicked in these cases.

Taking into account how people are using this method, it feels best to simply return the end of the string in these cases, so that the result is still a valid char boundary.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
0 files changed, 0 insertions, 0 deletions