internal: Avoid newlines in fetch errors
Most logs lines don't have newlines, ensure fetch errors follow this pattern. This makes it easier to see which log line is associated with the error.
Before:
2024-08-28T21:11:58.431856Z ERROR FetchWorkspaceError:
rust-analyzer failed to discover workspace
After:
2024-08-28T21:11:58.431856Z ERROR FetchWorkspaceError: rust-analyzer failed to discover workspace
I.e. don't generate `let var_name = &foo()`.
Anything that creates a new value don't need a reference. That excludes mostly field accesses and indexing.
I had a thought that we can also not generate a reference for fields and indexing as long as the type is `Copy`, but sometimes people impl `Copy` even when they don't want to copy the values (e.g. a large type), so I didn't do that.
When formatting generated code the xtask crate attempts to run `rustup run stable rustfmt`,
which fails if `rustup` is not installed. This results in test failures when another source manages
the compiler toolchain, for example when using Nix (or any other distro-specific packaging solution):
* xtask::codegen::grammar::test
* xtask::codegen::assists_doc_tests::test
With this commit xtask will first attempt to run `rustup run stable rustfmt`, and if that fails just
plain `rustfmt`. It still validates a stable version is being used.
This allows `cargo test` to pass on systems that do not use `rustup`.
Expand proc-macros in workspace root, not package root
Should fix https://github.com/rust-lang/rust-analyzer/issues/17748. The approach is generally not perfect though as rust-project.json projects don't benefit from this (still, nothing changes in that regard)
fix: Fix "Unwrap block" assist with block modifiers
The assist just assumes the `{` will be the first character, which led to strange outputs such as `nsafe {`.
Fixes#17964.
Always show error lifetime arguments as `'_`
Fixes#17947
Changed error lifetime argument presentation in non-test environment to `'_` and now showing them even if all of args are error lifetimes.
This also influenced some of the other tests like `extract_function.rs`, `predicate.rs` and `type_pos.rs`. Not sure whether I need to refrain from adding lifetimes args there. Happy to fix if needed
fix: add extra_test_bin_args to test explorer test runner
`@HKalbasi` I thought I included this in #17470 but it appears not so I have created a new issue #17959 for this fix.