rust/tests
Matthias Krüger 91f222f931
Rollup merge of #111659 - y21:suggest-as-deref, r=cjgillot
suggest `Option::as_deref(_mut)` on type mismatch in option combinator if it passes typeck

Fixes #106342.
This adds a suggestion to call `.as_deref()` (or `.as_deref_mut()` resp.) if typeck fails due to a type mismatch in the function passed to an `Option` combinator such as `.map()` or `.and_then()`.
For example:
```rs
fn foo(_: &str) {}
Some(String::new()).map(foo);
```
The `.map()` method requires its argument to satisfy `F: FnOnce(String)`, but it received `fn(&str)`, which won't pass. However, placing a `.as_deref()` before the `.map()` call fixes this since `&str == &<String as Deref>::Target`
2023-06-03 20:38:10 +02:00
..
assembly Fix linkage for large binaries on mips64 platforms ... 2023-05-29 10:57:03 -06:00
auxiliary
codegen Rollup merge of #112182 - rcvalle:rust-cfi-fix-111185, r=compiler-errors 2023-06-02 18:12:45 +02:00
codegen-units
debuginfo Add multiple borrow test. 2023-05-13 10:32:32 +00:00
incremental Implement custom diagnostic for ConstParamTy 2023-06-01 18:21:42 +00:00
mir-opt Rollup merge of #112168 - scottmcm:lower-div-rem-unchecked-to-mir, r=oli-obk 2023-06-02 16:02:06 -07:00
pretty
run-make Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix 2023-05-25 16:59:57 +00:00
run-make-fulldeps Move BodyWithBorrowckFacts to consumers 2023-05-23 14:36:36 +02:00
run-pass-valgrind
rustdoc Add rustdoc test for double-hyphen to dash doc comment conversion 2023-06-02 13:51:01 +02:00
rustdoc-gui Rollup merge of #112133 - GuillaumeGomez:migrate-gui-test-color-10, r=notriddle 2023-06-01 22:47:31 +02:00
rustdoc-js Rollup merge of #110780 - notriddle:notriddle/slice-index, r=GuillaumeGomez 2023-05-06 09:09:31 +09:00
rustdoc-js-std
rustdoc-json Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard 2023-05-22 18:22:08 +01:00
rustdoc-ui rustdoc: get unnormalized link destination for suggestions 2023-05-26 18:38:46 -07:00
ui Rollup merge of #111659 - y21:suggest-as-deref, r=cjgillot 2023-06-03 20:38:10 +02:00
ui-fulldeps Use translatable diagnostics in rustc_const_eval 2023-06-01 14:45:18 +00:00
COMPILER_TESTS.md