about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-08-22 00:02:50 +0000
committerbors <bors@rust-lang.org>2023-08-22 00:02:50 +0000
commit795ade084ac18e2198faeb63a783d2b8e2108c42 (patch)
tree269a079212900202aba7f33c0cc947eb30835dd9 /compiler/rustc_lint/src
parentef85656a10657ba5e4f7fe2931a4ca6293138d51 (diff)
parent07b57f9a7a7c532497215e7973ae54d479f68cf9 (diff)
downloadrust-795ade084ac18e2198faeb63a783d2b8e2108c42.tar.gz
rust-795ade084ac18e2198faeb63a783d2b8e2108c42.zip
Auto merge of #113365 - dima74:diralik/add-deprecated-suggestions, r=workingjubilee
Add `suggestion` for some `#[deprecated]` items

Consider code:
```rust
fn main() {
    let _ = ["a", "b"].connect(" ");
}
```

Currently it shows deprecated warning:
```rust
warning: use of deprecated method `std::slice::<impl [T]>::connect`: renamed to join
 --> src/main.rs:2:24
  |
2 |     let _ = ["a", "b"].connect(" ");
  |                        ^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default
```

This PR adds `suggestion` for `connect` and some other deprecated items, so the warning will be changed to this:
```rust
warning: use of deprecated method `std::slice::<impl [T]>::connect`: renamed to join
 --> src/main.rs:2:24
  |
2 |     let _ = ["a", "b"].connect(" ");
  |                        ^^^^^^^
  |
  = note: `#[warn(deprecated)]` on by default
help: replace the use of the deprecated method
  |
2 |     let _ = ["a", "b"].join(" ");
  |                        ^^^^
```
Diffstat (limited to 'compiler/rustc_lint/src')
0 files changed, 0 insertions, 0 deletions