]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/dont-suggest-pin-array-dot-set.rs
Rollup merge of #106470 - ehuss:tidy-no-wasm, r=Mark-Simulacrum
[rust.git] / tests / ui / suggestions / dont-suggest-pin-array-dot-set.rs
1 // https://github.com/rust-lang/rust/issues/96834
2 //
3 // This test case verifies that rustc does not make an unhelpful suggestion:
4 //
5 //     help: consider wrapping the receiver expression with the appropriate type
6 //         |
7 //     14  |     Pin::new(&mut a).set(0, 3);
8 //         |     +++++++++++++  +
9 //
10 // We can tell that it isn't helpful, because `Pin::set` takes two parameters (including
11 // the receiver), but the function call on line 14 supplies three.
12 fn main() {
13     let mut a = [0u8; 1];
14     a.set(0, 3); //~ERROR
15 }