summaryrefslogtreecommitdiff
path: root/tests/ui/rust-2018
AgeCommit message (Collapse)Author
2024-06-13Tweak output of import suggestionsEsteban Küber
When both `std::` and `core::` items are available, only suggest the `std::` ones. We ensure that in `no_std` crates we suggest `core::` items. Ensure that the list of items suggested to be imported are always in the order of local crate items, `std`/`core` items and finally foreign crate items. Tweak wording of import suggestion: if there are multiple items but they are all of the same kind, we use the kind name and not the generic "items". Fix #83564.
2024-06-03Spruce up the diagnostics of some early lintsLeón Orell Valerian Liehr
2024-05-07Make sure we don't deny macro vars w keyword namesMichael Goulet
2024-05-04compiletest: add enable-by-default check-cfgUrgau
2024-04-22Deny gen keyword in edition_2024_compat lintsMichael Goulet
2024-04-09Further cleanup cfgs in the UI test suiteUrgau
This commit does three things: 1. replaces (the last remaining) never true cfgs by the FALSE cfg 2. fix derive-helper-configured.rs (typo in directive) 3. and comment some current unused #[cfg_attr] (missing revisions)
2024-03-25Add needs-unwind for proc macro testsbjorn3
Rustc gives a warning when compiling proc macros with panic=abort.
2024-03-10Detect unused struct impls pub traitr0cky
2024-03-01If suggestion would leave an empty line, delete itclubby789
2024-02-25Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkinbors
Implement RFC 3373: Avoid non-local definitions in functions This PR implements [RFC 3373: Avoid non-local definitions in functions](https://github.com/rust-lang/rust/issues/120363).
2024-02-22Deduplicate some logic and reword outputEsteban Küber
2024-02-22Tweak wording of "implemented trait isn't imported" suggestionEsteban Küber
2024-02-22Make confusable suggestions `verbose`Esteban Küber
2024-02-22Consider methods from traits when suggesting typosEsteban Küber
Do not provide a structured suggestion when the arguments don't match. ``` error[E0599]: no method named `test_mut` found for struct `Vec<{integer}>` in the current scope --> $DIR/auto-ref-slice-plus-ref.rs:7:7 | LL | a.test_mut(); | ^^^^^^^^ | = help: items from traits can only be used if the trait is implemented and in scope note: `MyIter` defines an item `test_mut`, perhaps you need to implement it --> $DIR/auto-ref-slice-plus-ref.rs:14:1 | LL | trait MyIter { | ^^^^^^^^^^^^ help: there is a method `get_mut` with a similar name, but with different arguments --> $SRC_DIR/core/src/slice/mod.rs:LL:COL ``` Consider methods beyond inherent ones when suggesting typos. ``` error[E0599]: no method named `owned` found for reference `&dyn Foo` in the current scope --> $DIR/object-pointer-types.rs:11:7 | LL | fn owned(self: Box<Self>); | --------- the method might not be found because of this arbitrary self type ... LL | x.owned(); | ^^^^^ help: there is a method with a similar name: `to_owned` ``` Fix #101013.
2024-02-18Auto merge of #119673 - petrochenkov:dialoc5, r=compiler-errors,cjgillotbors
macro_rules: Preserve all metavariable spans in a global side table This PR preserves spans of `tt` metavariables used to pass tokens to declarative macros. Such metavariable spans can then be used in span combination operations like `Span::to` to improve all kinds of diagnostics. Spans of non-`tt` metavariables are currently kept in nonterminal tokens, but the long term plan is remove all nonterminal tokens from rustc parser and rely on the proc macro model with invisible delimiters (#114647, #67062). In particular, `NtIdent` nonterminal (corresponding to `ident` metavariables) becomes easy to remove when this PR lands (#119412 does it). The metavariable spans are kept in a global side table keyed by `Span`s of original tokens. The alternative to the side table is keeping them in `SpanData` instead, but the performance regressions would be large because any spans from tokens passed to declarative macros would stop being inline and would work through span interner instead, and the penalty would be paid even if we never use the metavar span for the given original span. (But also see the comment on `fn maybe_use_metavar_location` describing the map collision issues with the side table approach.) There are also other alternatives - keeping the metavar span in `Token` or `TokenTree`, but associating it with `Span` itsel is the most natural choice because metavar spans are used in span combining operations, and those operations are not necessarily tied to tokens.
2024-02-18By tracking import use types to check whether it is scope uses or the other ↵surechen
situations like module-relative uses, we can do more accurate redundant import checking. fixes #117448 For example unnecessary imports in std::prelude that can be eliminated: ```rust use std::option::Option::Some;//~ WARNING the item `Some` is imported redundantly use std::option::Option::None; //~ WARNING the item `None` is imported redundantly ```
2024-02-18macro_rules: Preserve all metavariable spans in a global side tableVadim Petrochenkov
2024-02-17Allow newly added non_local_definitions lint in testsUrgau
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)
2024-02-07Update testsr0cky
2024-01-29Supress unhelpful diagnostics for unresolved top level attributesyukang
2023-12-10Remove edition umbrella features.Eric Huss
2023-11-24Show number in error message even for one errorNilstrieb
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-19Fix duplicate labels emitted in `render_multispan_macro_backtrace()`Gurinder Singh
Using hash set instead of vec to weed out duplicates
2023-10-05Add a note to duplicate diagnosticsAlex Macleod
2023-09-20Validate crate name in CLI option --externLeón Orell Valerian Liehr
2023-06-29resolve: Remove artificial import ambiguity errorsVadim Petrochenkov
2023-06-13Fix explicit-outlives-requirements lint spanSam Ginnett
2023-05-21Rename `drop_copy` lint to `dropping_copy_types`Urgau
2023-05-10Adjust tests for new drop and forget lintsUrgau
2023-04-12Special-case item attributes in the suggestion outputEsteban Küber
2023-04-12Tweak output for 'add line' suggestionEsteban Küber
2023-04-07Use smart-resolve when checking for trait in RHS of UFCSMichael Goulet
2023-02-22Move the unused extern crate check back to the resolver.Camille GILLOT
2023-01-20fix overlapping spans for `explicit_outlives_requirements` in macrosLukas Markeffsky
also delete trailing comma if necessary
2023-01-11Move /src/test to /testsAlbert Larsan