about summary refs log tree commit diff
path: root/tests/ui/imports
AgeCommit message (Collapse)AuthorLines
2025-10-01Add the check-pass and check-fail tests.LorrensP-2158466-0/+86
2025-09-13Rollup merge of #145896 - Oneirical:uncountable-integer-10, r=jieyouxuJacob Pratt-0/+73
Rehome 30 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` [#3 of Batch #2] Part of rust-lang/rust#133895 Methodology: 1. Refer to the previously written `tests/ui/SUMMARY.md` 2. Find an appropriate category for the test, using the original issue thread and the test contents. 3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers) 4. Rename the tests to make their purpose clearer Inspired by the methodology that `@Kivooeo` was using. r? `@jieyouxu`
2025-09-12Add test batch 3Oneirical-0/+73
2025-08-29resolve: Avoid a regression from splitting prelude into two scopesVadim Petrochenkov-0/+13
2025-08-26fix: Add col separator before secondary messages with no sourceScott Schafer-0/+4
2025-08-26fix: Don't add an end column separator after a file with no sourceScott Schafer-1/+0
2025-08-19bless tests with new lint messagesKarol Zwolak-30/+30
2025-08-13resolve: Improve diagnostics for ambiguities in extern preludeVadim Petrochenkov-5/+1
2025-08-13resolve: Split extern prelude into two scopesVadim Petrochenkov-2/+45
One for `--extern` options and another for `extern crate` items.
2025-08-10Rollup merge of #144553 - Oneirical:uncountable-integer-4, r=jieyouxuJacob Pratt-0/+34
Rehome 32 `tests/ui/issues/` tests to other subdirectories under `tests/ui/` rust-lang/rust#143902 divided into smaller, easier to review chunks. Part of rust-lang/rust#133895 Methodology: 1. Refer to the previously written `tests/ui/SUMMARY.md` 2. Find an appropriate category for the test, using the original issue thread and the test contents. 3. Add the issue URL at the bottom (not at the top, as that would mess up stderr line numbers) 4. Rename the tests to make their purpose clearer Inspired by the methodology that `@Kivooeo` was using. r? `@jieyouxu`
2025-08-10Rehome tests/ui/issues/ tests [4/?]Oneirical-0/+34
2025-08-10Rollup merge of #144403 - Kivooeo:issue4, r=jieyouxuStuart Cook-0/+27
`tests/ui/issues/`: The Issues Strike Back [4/N] Some `tests/ui/issues/` housekeeping, to trim down number of tests directly under `tests/ui/issues/`. Part of https://github.com/rust-lang/rust/issues/133895. r? ````````@jieyouxu````````
2025-08-09commentsKivooeo-0/+2
2025-08-05Mark all deprecation lints in name resolution as deny-by-default and ↵Vadim Petrochenkov-0/+44
report-in-deps
2025-07-25commentsKivooeo-0/+2
2025-07-25move 28 testsKivooeo-0/+38
2025-07-25moved 34 tests to organized locationsKivooeo-0/+25
2025-07-10chore: Improve how the other suggestions message gets renderedScott Schafer-1/+1
2025-07-10Rollup merge of #143011 - LorrensP-2158466:warn-ambiguity-into-error, ↵Trevor Gross-115/+508
r=petrochenkov Make lint `ambiguous_glob_imports` deny-by-default and report-in-deps This pr aims to finish the second part of rust-lang/rust#114095. It converts the `ambiguous_glob_imports` lint from a warning to an error. Currently, only the lint definition and the related tests are changed, a crater run should provide us with information on whether we should go for this.
2025-07-09fix aux-build failuresLorrensP-2158466-30/+50
2025-06-29Rollup merge of #142214 - Kivooeo:tf9, r=jieyouxuGuillaume Gomez-0/+28
`tests/ui`: A New Order [9/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
2025-06-28cleaned up some testsKivooeo-0/+28
2025-06-25Add edition checks for some tests that had divergent outputEsteban Küber-1/+17
In order to expose edition dependent divergences in some tests in the test suite, add explicit `edition` annotations. Some of these tests might require additional work to *avoid* the divergences, as they might have been unintentional. These are not exhaustive changes, purely opportunistic while looking at something else.
2025-06-25update ui/import testsLorrensP-2158466-124/+497
2025-06-24Rollup merge of #142805 - estebank:underscore-import, r=compiler-errorsMatthias Krüger-2/+12
Emit a single error when importing a path with `_` When encountering `use _;`, `use _::*'` or similar, do not emit two errors for that single mistake. This also side-steps the issue of resolve errors suggesting adding a crate named `_` to `Cargo.toml`. Fix rust-lang/rust#142662.
2025-06-24Emit a single error when importing a path with `_`Esteban Küber-9/+2
When encountering `use _;`, `use _::*'` or similar, do not emit two errors for that single mistake. This also side-steps the issue of resolve errors suggesting adding a crate named `_` to `Cargo.toml`.
2025-06-23compiletest: Improve diagnostics for line annotation mismatchesVadim Petrochenkov-1/+1
2025-06-20Make some `use _` tests multi-editionEsteban Küber-3/+20
2025-06-08cleaned up some testsKivooeo-0/+10
2025-06-04Rollup merge of #141888 - ferrocene:lw/decouple-tests-from-2015, ↵Matthias Krüger-124/+125
r=compiler-errors Use non-2015 edition paths in tests that do not test for their resolution This allows for testing these tests on editions other than 2015
2025-06-03Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-124/+125
This allows for testing these tests on editions other than 2015
2025-06-02Add missing 2015 edition directivesLukas Wirth-0/+1
These tests specifically test 2015 edition behavior, so ensure that they can only be run with this edition
2025-05-29Use `cfg_attr` AST placeholder AST `cfg_attr_trace` for diagnosticsEsteban Küber-1/+6
PR 138515, we insert a placeholder attribute so that checks for attributes can still know about the placement of `cfg` attributes. When we suggest removing items with `cfg_attr`s (fix Issue 56328) and make them verbose. We tweak the wording of the existing "unused `extern crate`" lint. ``` warning: unused extern crate --> $DIR/removing-extern-crate.rs:9:1 | LL | extern crate removing_extern_crate as foo; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | note: the lint level is defined here --> $DIR/removing-extern-crate.rs:6:9 | LL | #![warn(rust_2018_idioms)] | ^^^^^^^^^^^^^^^^ = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]` help: remove the unused `extern crate` | LL - #[cfg_attr(test, macro_use)] LL - extern crate removing_extern_crate as foo; LL + | ```
2025-05-17Use `crate::` prefix for root macro suggestionsbohan-5/+50
2025-05-07Rollup merge of #140614 - yuk1ty:fix-invalid-module-name-visibility, r=davidtwcoGuillaume Gomez-1/+1
Correct warning message in restricted visibility Fixes #131220
2025-05-03Correct warning message in restricted visibilityyuk1ty-1/+1
2025-05-02resolve: Support imports of associated types and glob imports from traitsVadim Petrochenkov-10/+1
2025-04-30compiletest: Make diagnostic kind mandatory on line annotationsVadim Petrochenkov-26/+34
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-7/+9
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-8/+8
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-16/+8
2025-03-22Note potential but private items in show_candidatesxizheyin-0/+54
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
2025-02-28Remove `NtPath`.Nicholas Nethercote-3/+3
2025-02-21Trim suggestion part before generating highlightsMichael Goulet-6/+6
2025-02-21More sophisticated span trimmingMichael Goulet-33/+20
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-4/+4
2025-02-14Consider add-prefix replacements tooMichael Goulet-6/+4
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-6/+4
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-53/+83
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-01-25Auto merge of #133154 - estebank:issue-133137, r=wesleywiserbors-55/+55
Reword resolve errors caused by likely missing crate in dep tree Reword label and add `help`: ``` error[E0432]: unresolved import `some_novel_crate` --> f704.rs:1:5 | 1 | use some_novel_crate::Type; | ^^^^^^^^^^^^^^^^ use of unresolved module or unlinked crate `some_novel_crate` | = help: if you wanted to use a crate named `some_novel_crate`, use `cargo add some_novel_crate` to add it to your `Cargo.toml` ``` Fix #133137.