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
mod_dir_implicit_aux
mod_dir_simple
module-polymorphism3-files
issue-1920-1.rs
issue-1920-1.stderr
issue-1920-2.rs
issue-1920-2.stderr
issue-1920-3.rs
issue-1920-3.stderr
issue-13872.rs
issue-56411-aux.rs
issue-56411.rs
issue-56411.stderr
issue-107649.rs
issue-107649.stderr
mod-inside-fn.rs
mod-view-items.rs
mod_dir_implicit.rs
mod_dir_path.rs
mod_dir_path2.rs
mod_dir_path3.rs
mod_dir_path_multi.rs
mod_dir_recursive.rs
mod_dir_simple.rs
mod_file.rs
mod_file_aux.rs
mod_file_with_path_attr.rs
path-invalid-form.rs
path-invalid-form.stderr
path-macro.rs
path-macro.stderr
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