about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-01-07 13:46:04 +0900
committerGitHub <noreply@github.com>2020-01-07 13:46:04 +0900
commit6d9913d51b0e5b898f5d42a21bdcd9510658ec9c (patch)
treedc51291c3c8e079edef587d71735829179a82944 /src/rustllvm/PassWrapper.cpp
parent74ca7c7dd3546260cb199240196a0adf0ee5ad39 (diff)
parent12545c75ff9c9ad72ad50bbbb3cc1f5c04c8037a (diff)
downloadrust-6d9913d51b0e5b898f5d42a21bdcd9510658ec9c.tar.gz
rust-6d9913d51b0e5b898f5d42a21bdcd9510658ec9c.zip
Rollup merge of #67880 - lbonn:fix/multi-substs, r=petrochenkov
Handle multiple error fix suggestions carefuly

The existing code seems to assume that substitutions spans are disjoint,
which is not always the case.

In the example:

    pub trait AAAA {}
    pub trait B {}
    pub trait C {}
    pub type T<P: AAAA + B + C> = P;

, we get three substituions starting from ':' and ending respectively at
the end of each trait token.

With the former offset calculation, this would cause `underline_start` to
eventually become negative before being converted to `usize`...

The new version may report erroneous results for non perfectly overlapping
substitutions but I don't know if such examples exist. Alternatively, we
could detect these cases and trim out overlapping substitutions.

Fixes #67690
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions