rust/tests
bors 30642113b2 Auto merge of #12406 - MarcusGrass:fix-duplicate-std-instead-of-core, r=Alexendoo
Dedup std_instead_of_core by using first segment span for uniqueness

Relates to #12379.

Instead of checking that the paths have an identical span, it checks that the relevant `std` part of the path segment's span is identical. Added a multiline test, because my first implementation was worse and failed that, then I realized that you could grab the span off the first_segment `Ident`.

I did find another bug that isn't addressed by this, and that exists on master as well.

The path:
```Rust
use std::{io::Write, fmt::Display};
```

Will get fixed into:
```Rust
use core::{io::Write, fmt::Display};
```

Which doesn't compile since `io::Write` isn't in `core`, if any of those paths are present in `core` it'll do the replace and cause a miscompilation. Do you think I should file a separate bug for that? Since `rustfmt` default splits those up it isn't that big of a deal.

Rustfmt:
```Rust
// Pre
use std::{io::Write, fmt::Display};
// Post
use std::fmt::Display;
use std::io::Write;
```
---

changelog: [`std_instead_of_core`]: Fix duplicated output on multiple imports
2024-03-03 18:22:40 +00:00
..
test_utils
ui Auto merge of #12406 - MarcusGrass:fix-duplicate-std-instead-of-core, r=Alexendoo 2024-03-03 18:22:40 +00:00
ui-cargo Remove $DIR replacement in test output 2024-02-17 12:34:54 +00:00
ui-internal Show duplicate diagnostics in UI tests by default 2024-02-28 13:24:14 +00:00
ui-toml Merge remote-tracking branch 'upstream/master' into rustup 2024-02-22 15:59:29 +01:00
workspace_test
check-fmt.rs
clippy.toml
compile-test.rs Show duplicate diagnostics in UI tests by default 2024-02-28 13:24:14 +00:00
dogfood.rs
headers.rs
integration.rs
lint_message_convention.rs
missing-test-files.rs
versioncheck.rs
workspace.rs