NLL is missing struct field suggestion
Part of #52663.
This commit adds suggestions to change the definitions of fields in
struct definitions from immutable references to mutable references.
r? @nikomatsakis
cc @pnkfelix
We originally didn't have threads, and now we're starting to add them!
Make sure we properly synchronize access to dlmalloc when the `atomics`
feature is enabled for `wasm32-unknown-unknown`.
This uses a copied version of `check_unused_parens_expr` that is
specific to `ast::Pat`. `check_unused_parens_` could possibly be made
more generic to work with any `ast::*` that has `node` and `span`
fields.
This also only checks for the case of parens around the wildcard
pattern. It covers the case highlighted in the issue, but could check
for a lot more.
Run debuginfo tests against rust-enabled lldb, when possible
If the rust-enabled lldb was built, then use it when running the
debuginfo tests. Updating the lldb submodule was necessary as this
needed a way to differentiate the rust-enabled lldb, so I added a line
to the --version output.
This adds compiletest commands to differentiate between the
rust-enabled and non-rust-enabled lldb, as is already done for gdb. A
new "rust-lldb" header directive is also added, but not used in this
patch; I plan to use it in #54004.
This updates all the tests.
- Detect one element array of `Range` type, which is potentially a typo:
`for _ in [0..10] {}` where iterating between `0` and `10` was intended.
(#23141)
- Suggest `.bytes()` and `.chars()` for `String`.
- Suggest borrowing or `.iter()` on arrays (#36391)
- Suggest using range literal when iterating on integers (#34353)
- Do not suggest `.iter()` by default (#50773, #46806)
Fix range literals borrowing suggestions
Fixes#54505. The compiler issued incorrect range borrowing suggestions (missing `()` around borrows of range literals). This was not correct syntax (see the issue for an example).
With changes in this PR, this is fixed for all types of `Range` literals.
Thanks again to @varkor and @estebank for their invaluable help and guidance.
r? @varkor
Prepare miri engine for enforcing validity invariant during execution
In particular, make recursive checking of references optional, and add a `const_mode` parameter that says whether `usize` is allowed to contain a pointer. Also refactor validation a bit to be type-driven at the "leafs" (primitive types), and separately validate scalar layout to catch `NonNull` violations (which it did not properly validate before).
Fixes https://github.com/rust-lang/rust/issues/53826
Also fixes https://github.com/rust-lang/rust/issues/54751
r? @oli-obk