Use fixed source code for parser context (#7717)

## Summary

The parser now uses the raw source code as global context and slices
into it to parse debug text. It turns out we were always passing in the
_old_ source code, so when code was fixed, we were making invalid
accesses. This PR modifies the call to use the _fixed_ source code,
which will always be consistent with the tokens.

Closes https://github.com/astral-sh/ruff/issues/7711.

## Test Plan

`cargo test`
This commit is contained in:
Charlie Marsh 2023-09-29 14:10:32 -04:00 committed by GitHub
parent b42a8972bf
commit b5280061f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 37 additions and 2 deletions

View file

@ -197,7 +197,7 @@ pub(crate) fn test_contents<'a>(
&directives,
settings,
flags::Noqa::Enabled,
source_kind,
&transformed,
source_type,
);