| Age | Commit message (Collapse) | Author | Lines |
|
|
|
etaoins:fix-find-width-of-character-at-span-bounds-check, r=estebank
Fix find_width_of_character_at_span bounds check
Commit 0bd96671f0 added bounds checking of our current target byte position to prevent infinite loops. Unfortunately it was comparing the file-relative `target` versus the global `file_start_pos` and `file_end_pos`.
The result is failing to detect multibyte characters unless their file-relative offset fit within their global offset. This causes other parts of the compiler to generate spans pointing to the middle of a
multibyte character which will ultimately panic in `bytepos_to_file_charpos`.
Fix by comparing the `target` to the total file size when moving forward and doing checked subtraction when moving backwards. This should preserve the intent of the bounds check while removing the offset confusion.
cc @davidtwco
Fixes #48508
|
|
Commit 0bd96671f0 added bounds checking of our current target byte
position to prevent infinite loops. Unfortunately it was comparing the
file-relative `target` versus the global relative `file_start_pos` and
`file_end_pos`.
The result is failing to detect multibyte characters unless their
file-relative offset fit within their global offset. This causes other
parts of the compiler to generate spans pointing to the middle of a
multibyte character which will ultimately panic in
`bytepos_to_file_charpos`.
Fix by comparing the `target` to the total file size when moving forward
and doing checked subtraction when moving backwards. This should
preserve the intent of the bounds check while removing the offset
confusion.
Fixes #48508
|
|
Remove experimental -Zremap-path-prefix-from/to, and replace it with
the stabilized --remap-path-prefix=from=to variant.
This is an implementation for issue of #41555.
|
|
|
|
|
|
Include space in suggestion `mut` in bindings
Fix #46614.
|
|
|
|
|
|
|
|
|
|
performant variant.
|
|
|
|
|
|
|
|
|
|
|
|
Use span label instead of span note for single line spans in
"incompatible arm" diagnostic.
|
|
|
|
|
|
|
|
|
|
Point to next token when it is in the expected line
r? @nikomatsakis
|
|
The previous method ran into problems because ICH would treat Spans
as (file,line,col) but the cache contained byte offsets and its
possible for the latter to change while the former stayed stable.
|
|
|
|
|
|
|
|
We also edit the lint description to clarify that this is different from
the struct field init shorthand.
|
|
|
|
|
|
|
|
Like #43008 (f668999), but _much more aggressive_.
|
|
|
|
We already had a cache for file contents, but we read the source-file
before testing the cache, causing obvious slowness, so this just avoids
loading the source-file when the cache already has the contents.
|
|
* In other places where the `src` member of a file map is accessed, we
now load and possibly work with external source as well.
|
|
* The lazy loading mechanism has been moved to a more appropriate place.
* Return values from the functions invoked there are properly used.
* Documentation has gotten some minor improvements.
* Possibly some larger restructuring will need to take place still.
|
|
|
|
|
|
|
|
They are now handled in their own member to prevent mutating access to
the `src` member. This way, we can safely load external sources, while
keeping the mutation of local source strings off-limits.
|
|
The rationale is that BOM stripping is needed for lazy source loading
for external crates, and duplication can be avoided by moving the
corresponding functionality to libsyntax_pos.
|
|
We can use these to perform lazy loading of source files belonging to
external crates. That way we will be able to show the source code of
external spans that have been translated.
|
|
When suggesting an appropriate mutability for a macro call, use the call
span instead of the expanded macro's span.
|
|
|
|
This is mostly removing stray ampersands, needless returns and lifetimes.
|
|
|
|
reproducible builds.
|
|
```rust
error[E0072]: recursive type `X` has infinite size
--> file.rs:10:1
|
10 | struct X {
| ^^^^^^^^ recursive type has infinite size
|
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable
```
vs
```rust
error[E0072]: recursive type `X` has infinite size
--> file.rs:10:1
|
10 | struct X {
| _^ starting here...
11 | | x: X,
12 | | }
| |_^ ...ending here: recursive type has infinite size
|
= help: insert indirection (e.g., a `Box`, `Rc`, or `&`) at some point to make `X` representable
```
|
|
|
|
|