Commit graph

163 commits

Author SHA1 Message Date
Vadim Petrochenkov
a096799b4a Partially revert "resolve: Update NameBindingData::vis in place"
(cherry picked from commit 324267ccaa)
2026-02-12 09:07:10 -08:00
Vadim Petrochenkov
bcfdf1bf97 Add tests for issues 152004, 151124 and 152347
(cherry picked from commit 0cd0840243)
2026-02-12 09:07:10 -08:00
Georg Semmler
d028956f11
Add an additional help note to the ambiguity lint error
This PR adds an additional help note to the ambiguity lint error output
to ask users updating their dependencies. This hopefully helps with
cases like https://github.com/rust-lang/rust/issues/149845 where newer crate versions are fixed.
2026-01-16 13:39:01 +01:00
Vadim Petrochenkov
cd05071ec4 resolve: Downgrade ambiguous_glob_imports to warn-by-default
But still keep it report-in-deps.

To revert after ~February 27 2026, when Rust 1.95 branches out from the main branch.
2026-01-15 13:02:20 +03:00
Vadim Petrochenkov
83c5f2c194 resolve: Relax one more assert in glob overwriting and add a test
Also avoid losing some glob ambiguities when re-fetching globs
2026-01-14 19:58:40 +03:00
Vadim Petrochenkov
1c3841b372 Add a test for issue 150977 2026-01-14 19:58:40 +03:00
Vadim Petrochenkov
8b52c73b3e resolve: Relax some asserts in glob overwriting and add tests 2026-01-14 19:57:21 +03:00
Lukas Bergdoll
506762f3ff Explicitly export core and std macros
Currently all core and std macros are automatically added to the prelude
via #[macro_use]. However a situation arose where we want to add a new macro
`assert_matches` but don't want to pull it into the standard prelude for
compatibility reasons. By explicitly exporting the macros found in the core and
std crates we get to decide on a per macro basis and can later add them via
the rust_20xx preludes.
2026-01-13 08:47:48 +01:00
Vadim Petrochenkov
a251ae2615 resolve: Update NameBindingData::ambiguity in place
instead of creating fresh bindings, except in one case.
2026-01-08 10:51:11 +03:00
Vadim Petrochenkov
c2379717a2 resolve: Tweak overwriting with ambiguous globs
Do not overwrite unless necessary, and combine both globs instead of losing the first one.
2026-01-08 10:42:53 +03:00
Vadim Petrochenkov
2e123aef70 resolve: Avoid additional ambiguities from splitting modules into two scopes 2026-01-02 15:31:09 +03:00
Vadim Petrochenkov
78c61beb48 resolve: Patch up an inconsistent resolution ICE revealed by the previous commit 2026-01-02 15:26:06 +03:00
Vadim Petrochenkov
0016a71747 resolve: Migrate one more special ambiguity for glob vs non-glob bindings
in the same module to the usual ambiguity infra in `resolve_ident_in_scope_set`
2026-01-02 15:25:56 +03:00
Vadim Petrochenkov
bcfbb5619c resolve: Migrate a special ambiguity for glob vs non-glob bindings
in the same module to the usual ambiguity infra in `resolve_ident_in_scope_set`
2026-01-02 15:11:14 +03:00
Vadim Petrochenkov
75d90094e7 resolve: Split Scope::Module into two scopes for non-glob and glob bindings 2026-01-02 15:02:03 +03:00
Aditya-PS-05
678f58151e fix ICE when {{root}} appears in import suggestions 2025-12-19 19:28:35 +05:30
Esteban Küber
1bd7934d89 Point at span within local macros even when error happens in nested external macro
```
error[E0308]: mismatched types
  --> $DIR/macro-span-caller-replacement.rs:5:17
   |
LL |             s = format!("{arg}");
   |                 ^^^^^^^^^^^^^^^^ expected `&str`, found `String`
...
LL |     macro_with_format!();
   |     -------------------- in this macro invocation
   |
   = note: this error originates in the macro `format` which comes from the expansion of the macro `macro_with_format` (in Nightly builds, run with -Z macro-backtrace for more info)
```
2025-12-10 19:27:40 +00:00
Matthias Krüger
4da61b6d69
Rollup merge of #149816 - estebank:verbose-typo-suggestion, r=JonathanBrouwer,Kivooeo
Make typo in field and name suggestions verbose

Part of https://github.com/rust-lang/rust/issues/141973.
2025-12-10 07:54:21 +01:00
Esteban Küber
6cd44a472c Make typo in field and name suggestions verbose 2025-12-09 17:29:23 +00:00
Vadim Petrochenkov
51780a53f6 resolve: Preserve ambiguous glob reexports in crate metadata
So in cross-crate scenarios they can work in the same way as in crate-local scenarios.
2025-12-09 13:40:02 +03:00
reddevilmidzy
22a7457d12 Cleaned up some tests
Merged tests/ui/typeck/non-function-call-error-2 with
tests/ui/typeck/non-function-call-error

Add comment to
tests/ui/traits/normalize-associated-type-in-where-clause.rs

Merged tests/ui/privacy/private-item-simple-2.rs with
tests/ui/privacy/private-item-simple.rs

Merged tests/ui/str/str-add-operator-2.rs with
tests/ui/str/str-add-operator.rs

Add comment to tests/ui/imports/duplicate-empty-imports.rs

Add comment to tests/ui/for-loop-while/nested-loop-break-unit.rs

Add comment to tests/ui/match/match-ref-option-pattern.rs

Add comment to tests/ui/closures/simple-capture-and-call.rs

Add comment to tests/ui/type/never-type-inference-fail.rs

Add comment to tests/ui/match/match-stack-overflow-72933.rs
2025-12-08 07:06:13 +09:00
reddevilmidzy
c2e43fffbc moved tests 2025-12-05 20:41:51 +09:00
xonx4l
4b000cfacd Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
Christian Poveda
b2ab7cf980
Gate 2015 UI tests 2025-11-27 11:19:00 -05:00
LorrensP-2158466
a7eed086b9 Add the check-pass and check-fail tests. 2025-10-01 18:02:16 +02:00
Jacob Pratt
82bb6d523b
Rollup merge of #145896 - Oneirical:uncountable-integer-10, r=jieyouxu
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-13 03:26:02 -04:00
Oneirical
957fa10d50 Add test batch 3 2025-09-12 14:45:12 -04:00
Vadim Petrochenkov
8930d3a750 resolve: Avoid a regression from splitting prelude into two scopes 2025-08-29 16:58:51 +03:00
Scott Schafer
93d16c5100
fix: Add col separator before secondary messages with no source 2025-08-26 15:15:17 -06:00
Scott Schafer
8835ea854e
fix: Don't add an end column separator after a file with no source 2025-08-26 15:15:17 -06:00
Karol Zwolak
d14b83e378 bless tests with new lint messages 2025-08-19 21:27:10 +02:00
Vadim Petrochenkov
d98eaad509 resolve: Improve diagnostics for ambiguities in extern prelude 2025-08-13 17:45:40 +03:00
Vadim Petrochenkov
772493d51d resolve: Split extern prelude into two scopes
One for `--extern` options and another for `extern crate` items.
2025-08-13 17:45:40 +03:00
Jacob Pratt
5bd4e832d3
Rollup merge of #144553 - Oneirical:uncountable-integer-4, r=jieyouxu
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-10 15:43:52 -04:00
Oneirical
aa543963c6 Rehome tests/ui/issues/ tests [4/?] 2025-08-10 11:54:15 -04:00
Stuart Cook
62b406d4b1
Rollup merge of #144403 - Kivooeo:issue4, r=jieyouxu
`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-10 19:45:48 +10:00
Kivooeo
16765639b3 comments 2025-08-09 16:27:20 +05:00
Vadim Petrochenkov
33cb4190a2 Mark all deprecation lints in name resolution as deny-by-default and report-in-deps 2025-08-05 15:28:49 +03:00
Kivooeo
e9959aa74e comments 2025-07-25 20:38:54 +05:00
Kivooeo
9f38ca97ea move 28 tests 2025-07-25 20:38:54 +05:00
Kivooeo
90bb5cacb5 moved 34 tests to organized locations 2025-07-25 15:34:28 +05:00
Scott Schafer
d67bf6095a
chore: Improve how the other suggestions message gets rendered 2025-07-10 08:00:20 -06:00
Trevor Gross
6bcc39c7fe
Rollup merge of #143011 - LorrensP-2158466:warn-ambiguity-into-error, 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-10 03:23:53 -04:00
LorrensP-2158466
b286bc3141 fix aux-build failures 2025-07-09 23:18:32 +02:00
Guillaume Gomez
15b227f715
Rollup merge of #142214 - Kivooeo:tf9, r=jieyouxu
`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-29 12:29:54 +02:00
Kivooeo
f4502b8f0e cleaned up some tests 2025-06-28 17:04:16 +05:00
Esteban Küber
8c3a033d7f Add edition checks for some tests that had divergent output
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-25 17:02:26 +00:00
LorrensP-2158466
3be0b6b72c update ui/import tests 2025-06-25 15:40:18 +02:00
Matthias Krüger
d7e10f083c
Rollup merge of #142805 - estebank:underscore-import, r=compiler-errors
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-24 20:46:04 +02:00
Esteban Küber
d82fb1e72d 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`.
2025-06-24 16:21:26 +00:00