rust/compiler/rustc_errors/src
DianQK 1652e3a560
Rollup merge of #134366 - harrisonkaiser:no-break-space, r=davidtwco
Fix logical error with what text is considered whitespace.

There appears to be a logical issue around what counts as leading white-space. There is code which does a subtraction assuming that no errors will be reported inside the leading whitespace. However we compute the length of that whitespace with std::char::is_whitespace and not rustc_lexer::is_whitespace. The former will include a no-break space while later will excluded it. We can only safely make the assumption that no errors will be reported  in whitespace if it is all "Rust Standard" whitespace. Indeed an error does occur in unicode whitespace if it contains a no-break space. In that case the subtraction will cause a ICE (for a compiler in debug mode) as described in https://github.com/rust-lang/rust/issues/132918.
2024-12-20 21:46:59 +08:00
..
json Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
markdown chore: fix some typos 2024-12-18 23:23:44 +08:00
annotate_snippet_emitter_writer.rs Store a single copy of the error registry in DiagCtxt 2024-12-06 18:42:31 +00:00
codes.rs Stop using String for error codes. 2024-01-29 07:41:41 +11:00
diagnostic.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
diagnostic_impls.rs Re-export more rustc_span::symbol things from rustc_span. 2024-12-18 13:38:53 +11:00
emitter.rs Rollup merge of #134366 - harrisonkaiser:no-break-space, r=davidtwco 2024-12-20 21:46:59 +08:00
error.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
json.rs Store a single copy of the error registry in DiagCtxt 2024-12-06 18:42:31 +00:00
lib.rs update uses of extract_if in the compiler 2024-12-16 22:06:52 +01:00
lock.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
registry.rs Reformat use declarations. 2024-07-29 08:26:52 +10:00
snippet.rs Add warn(unreachable_pub) to rustc_errors. 2024-08-27 12:03:37 +10:00
styled_buffer.rs Add warn(unreachable_pub) to rustc_errors. 2024-08-27 12:03:37 +10:00
tests.rs Delete the cfg(not(parallel)) serial compiler 2024-11-12 13:38:58 +00:00
translation.rs Convert Option<&Lrc<T>> return types to Option<&T>. 2024-10-07 13:56:29 +11:00