And remove the `unsafe` blocks, they're not necessary.
Also rewrite `InternedString::{with,with2}` to use the new functions.
Finally, add some comments about the speed of the
`as_str()`/`as_interned_str()` functions.
The remote-test-client outputs a message of the form "uploaded
"<build_dir>/<executable_path>", waiting for result" onto stdout when
executing a test, which is then captured in the process result. This needs to be removed when
comparing the results of the run-pass test execution.
Rollup of 5 pull requests
Successful merges:
- #64049 (Emit a single error on if expr with expectation and no else clause)
- #64056 (Account for arbitrary self types in E0599)
- #64058 (librustc_errors: Extract sugg/subst handling into method)
- #64071 (use just one name when parameters and fields are the same)
- #64104 (Emit error on intrinsic to fn ptr casts)
Failed merges:
r? @ghost
Emit error on intrinsic to fn ptr casts
I'm not sure if a type error is the best way of doing this but it seemed like a relatively correct place to do it, and I expect this is a pretty rare case to hit anyway.
Fixes#15694
librustc_errors: Extract sugg/subst handling into method
An initial refactoring before working on #61809.
This moves the whole block into a method so that it can be reused in the
annotate-snippet emitter. The method is already used in the new emitter, but
there's no UI tests with suggestions included in this PR.
A first look at some UI tests with suggestions showed that there's some
more work to do in [annotate-snippet-rs][annotate-snippet-rs] before the new output is closer to the
current one, so I opted to do that in a second step.
r? @estebank
[annotate-snippet-rs]: https://github.com/rust-lang/annotate-snippets-rs
Value was renamed to Operand in ad2de8b4ee
ScalarPair to Slice in fe50b4eb1d
Not familiar enough with rustc's source to know if the comment is even still applicable.
Fix build failure in case file doesn't exist
It fixes the following issue:
```bash
$ ./x.py test src/tools/linkchecker ./build/x86_64-apple-darwin/doc/ --stage 1
Updating only changed submodules
Submodules updated in 0.05 seconds
Finished dev [unoptimized] target(s) in 0.15s
thread 'main' panicked at 'source "/Users/imperio/rust/rust/build/x86_64-apple-darwin/doc/version_info.html" failed to get metadata: No such file or directory (os error 2)', src/build_helper/lib.rs:179:19
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
failed to run: /Users/imperio/rust/rust/build/bootstrap/debug/bootstrap test src/tools/linkchecker ./build/x86_64-apple-darwin/doc/ --stage 1
Build completed unsuccessfully in 0:00:01
```
If the file doesn't exist, it makes sense anyway to just run the command in order to generate it.
r? @Mark-Simulacrum