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

emitter: current substitution can be multi-line #89912

Merged

Conversation

davidtwco
Copy link
Member

Fixes #89280.

In splice_lines, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 15, 2021
@rust-log-analyzer

This comment has been minimized.

@davidtwco davidtwco force-pushed the issue-89280-split-lines-multiple-lines branch from 53f7ddd to 778d7cf Compare October 15, 2021 15:17
@rust-log-analyzer

This comment has been minimized.

In `splice_lines`, there is some arithmetic to compute the required
alignment such that future substitutions in a suggestion are aligned
correctly. However, this assumed that the current substitution's span
was only on a single line. In circumstances where this was not true, it
could result in a arithmetic overflow when the substitution's end
column was less than the substitution's start column.

Signed-off-by: David Wood <david.wood@huawei.com>
@davidtwco davidtwco force-pushed the issue-89280-split-lines-multiple-lines branch from 778d7cf to d2dc0f3 Compare October 15, 2021 15:31
@oli-obk
Copy link
Contributor

oli-obk commented Oct 15, 2021

Thanks for doing this ❤️!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 15, 2021

📌 Commit d2dc0f3 has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 15, 2021
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 15, 2021
…ultiple-lines, r=oli-obk

emitter: current substitution can be multi-line

Fixes rust-lang#89280.

In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column.

r? `@oli-obk`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Oct 15, 2021
…ultiple-lines, r=oli-obk

emitter: current substitution can be multi-line

Fixes rust-lang#89280.

In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column.

r? ``@oli-obk``
jackh726 added a commit to jackh726/rust that referenced this pull request Oct 16, 2021
…ultiple-lines, r=oli-obk

emitter: current substitution can be multi-line

Fixes rust-lang#89280.

In `splice_lines`, there is some arithmetic to compute the required alignment such that future substitutions in a suggestion are aligned correctly. However, this assumed that the current substitution's span was only on a single line. In circumstances where this was not true, it could result in a arithmetic overflow when the substitution's end column was less than the substitution's start column.

r? ```@oli-obk```
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 16, 2021
…askrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#89509 (Stabilize `unreachable_unchecked` as `const fn`)
 - rust-lang#89898 (Remove alloc::prelude)
 - rust-lang#89902 (Restrict the aarch64 outline atomics test to Linux)
 - rust-lang#89906 (Moved format-version constant to rustdoc-json-types)
 - rust-lang#89912 (emitter: current substitution can be multi-line)
 - rust-lang#89914 (Emit impl difference error for GenericBoundFailure too)
 - rust-lang#89915 (Some outlives cleanup)
 - rust-lang#89918 (Add some GATs related regression tests)
 - rust-lang#89921 ([fuchsia] Update process info struct)
 - rust-lang#89925 (updating docs to mention usage of AtomicBool)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 27a7ced into rust-lang:master Oct 16, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 16, 2021
@davidtwco davidtwco deleted the issue-89280-split-lines-multiple-lines branch October 16, 2021 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: attempt to subtract with overflow, compiler/rustc_errors/src/lib.rs:348:47
6 participants