rust/tests
Matthias Krüger 43096cc932
Rollup merge of #144376 - estebank:issue-143795, r=lcnr
Suggest unwrapping when private method name is available in inner type

Given

```rust
fn main() {
    let maybe_vec = Some(vec![1,2,3]);
    assert_eq!(maybe_vec.len(), 3);
}
```

suggest unwraping `maybe_vec` to call `.len()` on the `Vec<_>`.

```
error[E0624]: method `len` is private
  --> $DIR/enum-method-probe.rs:61:9
   |
LL |     res.len();
   |         ^^^ private method
  --> $SRC_DIR/core/src/option.rs:LL:COL
   |
   = note: private method defined here
   |
note: the method `len` exists on the type `Vec<{integer}>`
  --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
help: consider using `Option::expect` to unwrap the `Vec<{integer}>` value, panicking if the value is an `Option::None`
   |
LL |     res.expect("REASON").len();
   |        +++++++++++++++++
```

When a method isn't available, we emit E0599, but when it is private we emit E0624. We now just invoke the same suggestion logic from the later that we already did in the former.

Fix rust-lang/rust#143795.
2025-07-26 15:27:59 +02:00
..
assembly-llvm Fix tests/assembly-llvm/dwarf-mixed-versions-lto.rs test failure on riscv64 2025-07-23 11:14:07 +00:00
auxiliary So many test updates x_x 2025-07-20 10:15:14 -07:00
codegen-llvm Rollup merge of #144341 - CaiWeiran:const-vector_test, r=wesleywiser 2025-07-26 01:15:07 -05:00
codegen-units Auto merge of #142893 - Mark-Simulacrum:no-const-collect, r=oli-obk 2025-06-27 12:57:05 +00:00
coverage coverage: Enlarge empty spans during MIR instrumentation, not codegen 2025-07-22 19:49:54 +10:00
coverage-run-rustdoc
crashes Auto merge of #144389 - scottmcm:no-more-mir-cast-assume, r=davidtwco 2025-07-24 20:38:53 +00:00
debuginfo Rephrase comment to include some tracking issues 2025-07-21 21:57:08 +02:00
incremental Bless incremental tests. 2025-07-13 13:50:01 +00:00
mir-opt Rollup merge of #144331 - jplatte:matches-allow-non_exhaustive_omitted_patterns, r=Nadrieril 2025-07-26 15:27:58 +02:00
pretty Update uitest stderrs 2025-07-23 13:33:23 +02:00
run-make Rollup merge of #144218 - Noratrieb:target-spec-json-de-jank, r=fee1-dead 2025-07-24 15:08:22 +02:00
rustdoc Regression test 2025-07-17 08:03:17 +02:00
rustdoc-gui Update rustdoc GUI tests 2025-07-01 15:49:45 +02:00
rustdoc-js Add test for aliases partial match 2025-07-16 14:27:22 +02:00
rustdoc-js-std Add test for aliases partial match 2025-07-16 14:27:22 +02:00
rustdoc-json rustdoc-json: Structured attributes 2025-07-15 16:52:41 +00:00
rustdoc-ui Specify of_trait in Target::Impl. 2025-07-17 22:21:21 +00:00
ui Rollup merge of #144376 - estebank:issue-143795, r=lcnr 2025-07-26 15:27:59 +02:00
ui-fulldeps use RustcPublic instead of StableMir 2025-07-18 18:49:32 +00:00
COMPILER_TESTS.md