about summary refs log tree commit diff
path: root/tests/ui/imports
AgeCommit message (Collapse)AuthorLines
2023-12-04Structured `use` suggestion on privacy errorEsteban Küber-3/+48
When encoutering a privacy error on an item through a re-export that is accessible in an alternative path, provide a structured suggestion with that path. ``` error[E0603]: module import `mem` is private --> $DIR/private-std-reexport-suggest-public.rs:4:14 | LL | use foo::mem; | ^^^ private module import | note: the module import `mem` is defined here... --> $DIR/private-std-reexport-suggest-public.rs:8:9 | LL | use std::mem; | ^^^^^^^^ note: ...and refers to the module `mem` which is defined here --> $SRC_DIR/std/src/lib.rs:LL:COL | = note: you could import this help: import `mem` through the re-export | LL | use std::mem; | ~~~~~~~~ ``` Fix #42909.
2023-12-01vis note for no pub reexports glob importbohan-2/+44
2023-11-24Show number in error message even for one errorNilstrieb-58/+58
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-26Tweak suggestion spans for invalid crate-level inner attributeEsteban Küber-2/+3
CC #89566.
2023-10-25Rollup merge of #117009 - fmease:diag-disambig-sugg-crate, r=b-naberMatthias Krüger-6/+6
On unresolved imports, suggest a disambiguated path if necessary to avoid collision with local items Fixes #116970.
2023-10-22use visibility to check unused imports and delete some stmtsbohan-12/+72
2023-10-21on unresolved import disambiguate suggested path if it would collideLeón Orell Valerian Liehr-6/+6
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+3
2023-09-13resolve: determined binding after parent module macro expandbohan-69/+136
2023-08-31fix(resolve): update def if binding is warning ambiguitybohan-1/+1
2023-08-02Rollup merge of #114166 - Enselic:libc-unavailable, r=NilstriebNilstrieb-0/+22
Add regression test for resolving `--extern libc=test.rlib` Closes #26043 I could not find a test for this particular use case. The closest I got was [`tests/ui/imports/issue-37887.rs`](https://github.com/rust-lang/rust/blob/master/tests/ui/imports/issue-37887.rs), but that is a regression test for a different use case (see https://github.com/rust-lang/rust/issues/37887).
2023-07-31Rollup merge of #113920 - bvanjoi:fix-81413, r=petrochenkovMatthias Krüger-0/+34
fix(resolve): report unresolved imports firstly Fixes #81413 An easy fix, r? ```@petrochenkov```
2023-07-29Add regression test for resolving `--extern libc=test.rlib`Martin Nordholts-0/+22
I could not find a test for this particular use case. The closest I got was `tests/ui/imports/issue-37887.rs`, but that is a regression test for a different use case.
2023-07-29fix(resolve): update the ambiguity glob binding as warning recursivelybohan-7/+1257
2023-07-29fix(resolve): report unresolved imports firstlybohan-0/+34
2023-07-25fix(resolve): skip panic when resolution is dummybohan-0/+15
2023-07-01fix(resolve): skip assertion judgment when `NonModule` is dummybohan-0/+27
2023-06-29resolve: Remove artificial import ambiguity errorsVadim Petrochenkov-8/+12
2023-05-27Add warn-by-default lint for local binding shadowing exported glob re-export ↵许杰友 Jieyou Xu (Joe)-3/+4
item
2023-05-23fix(resolve): not defined `extern crate shadow_name`bohan-0/+28
2023-05-18fix(resolve): replace bindings to dummy for unresolved importsbohan-0/+21
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber-6/+0
2023-04-12Tweak output for 'add line' suggestionEsteban Küber-6/+12
2023-04-03remove invalid ignore-prettyPietro Albini-1/+0
2023-03-23Rollup merge of #109487 - GuillaumeGomez:move-useless-reexport-check, ↵Matthias Krüger-4/+4
r=petrochenkov Move useless_anynous_reexport lint into unused_imports As mentioned in https://github.com/rust-lang/rust/pull/109003, this check should have been merged with `unused_imports` in the start. r? `@petrochenkov`
2023-03-23Rollup merge of #107880 - jieyouxu:issue-107563, r=petrochenkovMatthias Krüger-7/+10
Lint ambiguous glob re-exports Attempts to fix #107563. We currently already emit errors for ambiguous re-exports when two names are re-exported *specifically*, i.e. not from glob exports. This PR attempts to emit deny-by-default lints for ambiguous glob re-exports.
2023-03-22Move useless_anynous_reexport lint into unused_importsGuillaume Gomez-4/+4
2023-03-20Lint ambiguous glob re-exports许杰友 Jieyou Xu (Joe)-7/+10
2023-03-12Update failing ui testsGuillaume Gomez-4/+4
2023-01-28Auto merge of #106916 - lukas-code:overlapping-substs, r=estebankbors-1/+1
Remove overlapping parts of multipart suggestions This PR adds a debug assertion that the parts of a single substitution cannot overlap, fixes a overlapping substitution from the testsuite, and fixes https://github.com/rust-lang/rust/issues/106870. Note that a single suggestion can still have multiple overlapping substitutions / possible edits, we just don't suggest overlapping replacements in a single edit anymore. I've also included a fix for an unrelated bug where rustfix for `explicit_outlives_requirements` would produce multiple trailing commas for a where clause.
2023-01-20diagnostics: add `};` only if `{` was added tooMichael Howell-0/+55
2023-01-20diagnostics: suggest changing `s@self::{macro}@::macro` for exportedMichael Howell-0/+49
Fixes #99695
2023-01-20preserve delim spans during `macro_rules!` expansion if ableLukas Markeffsky-1/+1
2023-01-17note -> helpMichael Goulet-3/+3
2023-01-17Fix use suggestion spanMichael Goulet-7/+7
2023-01-11Move /src/test to /testsAlbert Larsan-0/+5608