about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorLaurent Bonnans <bonnans.l@gmail.com>2020-01-05 00:58:41 +0100
committerLaurent Bonnans <bonnans.l@gmail.com>2020-01-05 12:51:57 +0100
commit12545c75ff9c9ad72ad50bbbb3cc1f5c04c8037a (patch)
treea19b45122e7fe4d399d14e0ae90584d069c0805d /src/rustllvm/PassWrapper.cpp
parent760ce94c69ca510d44087291c311296f6d9ccdf5 (diff)
downloadrust-12545c75ff9c9ad72ad50bbbb3cc1f5c04c8037a.tar.gz
rust-12545c75ff9c9ad72ad50bbbb3cc1f5c04c8037a.zip
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.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions