about summary refs log tree commit diff
path: root/tests/ui/editions
AgeCommit message (Collapse)AuthorLines
2025-08-19bless tests with new lint messagesKarol Zwolak-6/+6
2025-08-10Rollup merge of #144553 - Oneirical:uncountable-integer-4, r=jieyouxuJacob Pratt-0/+10
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/+10
2025-08-07Use `tcx.short_string()` in more diagnosticsEsteban Küber-4/+4
`TyCtxt::short_string` ensures that user visible type paths aren't overwhelming on the terminal output, and properly saves the long name to disk as a side-channel. We already use these throughout the compiler and have been using them as needed when users find cases where the output is verbose. This is a proactive search of some cases to use `short_string`. We add support for shortening the path of "trait path only". Every manual use of `short_string` is a bright marker that that error should be using structured diagnostics instead (as they have proper handling of long types without the maintainer having to think abou tthem). When we don't actually print out a shortened type we don't need the "use `--verbose`" note. On E0599 show type identity to avoid expanding the receiver's generic parameters. Unify wording on `long_ty_path` everywhere.
2025-07-25Update ui tests with new macro early erroringGuillaume Gomez-23/+3
2025-07-16future-incompat lints: don't link to the nightly edition-guide versiondianne-10/+10
2025-06-15Rollup merge of #141937 - WaffleLapkin:never-report-in-deps, ↵León Orell Valerian Liehr-0/+105
r=oli-obk,traviscross Report never type lints in dependencies This PR marks never type lints (`never_type_fallback_flowing_into_unsafe` & `dependency_on_unit_never_type_fallback`) to be included in cargo's reports / to be emitted when they happen in dependencies. This PR is based on rust-lang/rust#141936 r? oli-obk
2025-06-12Rollup merge of #142261 - folkertdev:unstable-attr-correct-edition, ↵Matthias Krüger-0/+51
r=compiler-errors use correct edition when warning for unsafe attributes fixes https://github.com/rust-lang/rust/issues/142182 If an attribute is re-emitted by a macro, the incorrect edition was used to emit warnings for unsafe attributes. This logic was introduced in https://github.com/rust-lang/rust/pull/139718 cc `@compiler-errors` `@ehuss`
2025-06-11Add expectation for `{` when parsing lone coroutine qualifiersLukas Wirth-12/+12
2025-06-09use correct edition when warning for unsafe attributesFolkert de Vries-0/+51
If an attribute is re-emitted by a macro, the incorrect edition was used to emit warnings for unsafe attributes
2025-06-03report never type lints in depsWaffle Lapkin-0/+105
2025-06-02Add missing 2015 edition directivesLukas Wirth-4/+5
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/+5
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-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-20/+20
2025-03-25compiletest: Support matching on diagnostics without a spanVadim Petrochenkov-0/+4
2025-03-06Use closure parse codeSantiago Pastorino-12/+12
2025-02-03Add tests for nested macro_rules edition behaviorEric Huss-0/+112
This adds tests to check the behavior of how nested macro_rules definitions work across edition boundaries. This covers a change in behavior due to https://github.com/rust-lang/rust/pull/133274. See https://github.com/rust-lang/rust/issues/135669
2024-12-15Use links to edition guide for edition migrationsEric Huss-5/+5
2024-12-13Stabilize async closuresMichael Goulet-20/+16
2024-12-12Properly consider APITs for never type fallback ascription fixMichael Goulet-13/+132
2024-11-28Update more 2024 tests to remove -Zunstable-optionsEric Huss-14/+11
2024-11-22Stabilize the 2024 editionEric Huss-14/+14
2024-11-14Mention both release *and* edition breakage for never type lintsMaybe Lapkin-9/+9
2024-11-12Make sure that we suggest turbofishing the right type argMichael Goulet-9/+117
2024-11-01And also suggest for qpathsMichael Goulet-0/+4
2024-11-01And locals tooMichael Goulet-2/+2
2024-11-01Suggest adding self type to methodMichael Goulet-0/+4
2024-10-28Tweak more warnings.Nicholas Nethercote-18/+18
Much like the previous commit. I think the removal of "the token" in each message is fine here. There are many more error messages that mention tokens without saying "the token" than those that do say it.
2024-10-11Don't assume traits used as type are trait objsVulnBandit-3/+3
2024-06-13Point out exactly what obligation will failMichael Goulet-0/+10
2024-06-13rebase blessingWaffle Lapkin-3/+30
2024-05-17Add some more tests for the never type fallbackMaybe Waffle-0/+60
2024-05-17Add a test for never type fallback edition changeMaybe Waffle-0/+18
2024-03-20Use the more informative generic type inference failure error on method ↵Oli Scherer-5/+13
calls on raw pointers
2024-02-18macro_rules: Preserve all metavariable spans in a global side tableVadim Petrochenkov-5/+5
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-52/+52
2024-01-05macro_rules: Add more tests for using `tt` in addition to `ident`Vadim Petrochenkov-14/+75
Generally, `tt` and `ident` should behave identically, modulo the latter accepting only a subset of token trees.
2023-12-20Rollup merge of #118691 - chfogelman:improve-cstr-error, r=fmeaseMatthias Krüger-0/+129
Add check for possible CStr literals in pre-2021 Fixes [#118654](https://github.com/rust-lang/rust/issues/118654) Adds information to errors caused by possible CStr literals in pre-2021. The lexer separates `c"str"` into two tokens if the edition is less than 2021, which later causes an error when parsing. This error now has a more helpful message that directs them to information about editions. However, the user might also have written `c "str"` in a later edition, so to not confuse people who _are_ using a recent edition, I also added a note about whitespace. We could probably figure out exactly which scenario has been encountered by examining spans and editions, but I figured it would be better not to overcomplicate the creation of the error too much. This is my first code PR and I tried to follow existing conventions as much as possible, but I probably missed something, so let me know!
2023-12-19Improve compiler error for c-strings in pre-2021Carter Hunt Fogelman-0/+129
2023-12-10Remove edition umbrella features.Eric Huss-36/+0
2023-11-24Show number in error message even for one errorNilstrieb-8/+8
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-05-26improve error message for calling a method on a raw pointer with an unknown ↵asquared31415-2/+2
pointee, and add some tests
2023-01-11Move /src/test to /testsAlbert Larsan-0/+960