rust/tests/ui/modules
Esteban Küber 57dd42d613 Point at invalid utf-8 span on user's source code
```
error: couldn't read `$DIR/not-utf8-bin-file.rs`: stream did not contain valid UTF-8
  --> $DIR/not-utf8-2.rs:6:5
   |
LL |     include!("not-utf8-bin-file.rs");
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: `[193]` is not valid utf-8
  --> $DIR/not-utf8-bin-file.rs:2:14
   |
LL |     let _ = "�|�␂!5�cc␕␂��";
   |              ^
   = note: this error originates in the macro `include` (in Nightly builds, run with -Z macro-backtrace for more info)
```

When we attempt to load a Rust source code file, if there is a OS file failure we try reading the file as bytes. If that succeeds we try to turn it into UTF-8. If *that* fails, we provide additional context about *where* the file has the first invalid UTF-8 character.

Fix #76869.
2025-01-22 00:52:27 +00:00
..
auxiliary Move tests 2024-04-07 17:38:07 -03:00
mod_dir_implicit_aux [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_dir_simple [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
module-polymorphism3-files [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
issue-1920-1.rs Move tests 2024-04-07 17:38:07 -03:00
issue-1920-1.stderr Move tests 2024-04-07 17:38:07 -03:00
issue-1920-2.rs Move tests 2024-04-07 17:38:07 -03:00
issue-1920-2.stderr Move tests 2024-04-07 17:38:07 -03:00
issue-1920-3.rs Move tests 2024-04-07 17:38:07 -03:00
issue-1920-3.stderr Move tests 2024-04-07 17:38:07 -03:00
issue-13872.rs tests: remove `//@ pretty-expanded` usages 2024-11-26 02:50:48 +08:00
issue-56411-aux.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
issue-56411.rs
issue-56411.stderr
issue-107649.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
issue-107649.stderr Remove detail from label/note that is already available in other note 2024-10-29 16:26:57 +00:00
mod-inside-fn.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod-view-items.rs tests: remove `//@ pretty-expanded` usages 2024-11-26 02:50:48 +08:00
mod_dir_implicit.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_dir_path.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_dir_path2.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_dir_path3.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_dir_path_multi.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_dir_recursive.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_dir_simple.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_file.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_file_aux.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
mod_file_with_path_attr.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00
path-invalid-form.rs
path-invalid-form.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
path-macro.rs
path-macro.stderr Show number in error message even for one error 2023-11-24 19:15:52 +01:00
path-no-file-name.rs Point at invalid utf-8 span on user's source code 2025-01-22 00:52:27 +00:00
path-no-file-name.stderr Point at invalid utf-8 span on user's source code 2025-01-22 00:52:27 +00:00
special_module_name.rs
special_module_name.stderr
special_module_name_ignore.rs [AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives 2024-02-16 20:02:50 +00:00