about summary refs log tree commit diff
path: root/tests/ui/span
AgeCommit message (Collapse)AuthorLines
2025-07-15New example for E0536Jonathan Brouwer-7/+6
2025-06-22Implement DesugaringKind::FormatLiteralmejrs-5/+2
2025-06-18Rollup merge of #141610 - BoxyUwU:stabilize_generic_arg_infer, ↵Jakub Beránek-3/+23
r=lcnr,traviscross Stabilize `feature(generic_arg_infer)` Fixes rust-lang/rust#85077 r? lcnr cc ````@rust-lang/project-const-generics````
2025-06-17make error codes reflect reality betterJana Dönszelmann-7/+4
2025-06-17use consistent attr errors in all attribute parsersJana Dönszelmann-1/+1
2025-06-17fix bugs in inline/force_inline and diagnostics of all attr parsersJana Dönszelmann-4/+16
2025-06-11stabilize gaiBoxy-3/+23
2025-06-05Add more missing 2015 edition directivesLukas Wirth-2/+4
2025-06-05Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-15/+15
2025-03-30Remove attribute `#[rustc_error]`Vadim Petrochenkov-5/+4
2025-03-14Do not suggest using `-Zmacro-backtrace` for builtin macrosEsteban Küber-4/+0
For macros that are implemented on the compiler, we do *not* mention the `-Zmacro-backtrace` flag. This includes `derive`s and standard macros.
2025-02-21More sophisticated span trimmingMichael Goulet-18/+12
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-30/+45
``` 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-02-05When displaying a parameter mismatch error, only highlight the mismatched ↵Jason Newcomb-3/+3
parameters when showing the definition.
2025-01-23Bless and add testsBoxy-4/+0
2024-12-13Arbitrary self types v2: adjust diagnostic.Adrian Taylor-2/+2
The recently landed PR to adjust arbitrary self types was a bit overenthusiastic, advising folks to use the new Receiver trait even before it's been stabilized. Revert to the older wording of the lint in such cases.
2024-12-11Arbitrary self types v2: use Receiver traitAdrian Taylor-2/+2
In this new version of Arbitrary Self Types, we no longer use the Deref trait exclusively when working out which self types are valid. Instead, we follow a chain of Receiver traits. This enables methods to be called on smart pointer types which fundamentally cannot support Deref (for instance because they are wrappers for pointers that don't follow Rust's aliasing rules). This includes: * Changes to tests appropriately * New tests for: * The basics of the feature * Ensuring lifetime elision works properly * Generic Receivers * A copy of the method subst test enhanced with Receiver This is really the heart of the 'arbitrary self types v2' feature, and is the most critical commit in the current PR. Subsequent commits are focused on: * Detecting "shadowing" problems, where a smart pointer type can hide methods in the pointee. * Diagnostics and cleanup. Naming: in this commit, the "Autoderef" type is modified so that it no longer solely focuses on the "Deref" trait, but can now consider the "Receiver" trait instead. Should it be renamed, to something like "TraitFollower"? This was considered, but rejected, because * even in the Receiver case, it still considers built-in derefs * the name Autoderef is short and snappy.
2024-11-22Stabilize the 2024 editionEric Huss-1/+1
2024-09-22Don't call const normalize in error reportingMichael Goulet-2/+2
2024-09-09Ban non-array SIMDScott McMurray-2/+1
2024-08-01Do not underline suggestions for code that is already thereEsteban Küber-4/+0
When a suggestion part is for already present code, do not highlight it. If after that there are no highlights left, do not show the suggestion at all. Fix clippy lint suggestion incorrectly treated as `span_help`.
2024-07-26Peel off explicit (or implicit) deref before suggesting clone on move error ↵Michael Goulet-3/+3
in borrowck
2024-07-18Be more accurate about calculating `display_col` from a `BytePos`Esteban Küber-1/+1
No longer track "zero-width" chars in `SourceMap`, read directly from the line when calculating the `display_col` of a `BytePos`. Move `char_width` to `rustc_span` and use it from the emitter. This change allows the following to properly align in terminals (depending on the font, the replaced control codepoints are rendered as 1 or 2 width, on my terminal they are rendered as 1, on VSCode text they are rendered as 2): ``` error: this file contains an unclosed delimiter --> $DIR/issue-68629.rs:5:17 | LL | ␜␟ts␀![{i | -- unclosed delimiter | | | unclosed delimiter LL | ␀␀ fn rݻoa>rݻm | ^ ```
2024-07-14Use ordinal number in argument errorlong-long-float-7/+7
Fix error message Fix tests Format
2024-07-05Use verbose style for argument removal suggestionEsteban Küber-8/+12
2024-06-20Fix `...` in multline code-skips in suggestionsEsteban Küber-1/+1
When we have long code skips, we write `...` in the line number gutter. For suggestions, we were "centering" the `...` with the line, but that was consistent with what we do in every other case.
2024-06-12Spell out other trait diagnosticAlex Macleod-4/+4
2024-05-21Make early lints translatableXiretza-1/+1
2024-05-11ignore generics args in attribute pathsbohan-8/+1
2024-05-03Rollup merge of #124510 - linyihai:raw-ident-in-typo-suggestion, r=fmeaseMatthias Krüger-0/+29
Add raw identifier in a typo suggestion Fixes #68962
2024-04-30Replace item names containing an error code with something more meaningfulLeón Orell Valerian Liehr-1/+1
or inline such functions if useless.
2024-04-29Add raw identifier in a typo suggestionLin Yihai-0/+29
2024-04-24Modify `find_expr` from `Span` to better account for closuresEsteban Küber-0/+3
Start pointing to where bindings were declared when they are captured in closures: ``` error[E0597]: `x` does not live long enough --> $DIR/suggest-return-closure.rs:23:9 | LL | let x = String::new(); | - binding `x` declared here ... LL | |c| { | --- value captured here LL | x.push(c); | ^ borrowed value does not live long enough ... LL | } | -- borrow later used here | | | `x` dropped here while still borrowed ``` Suggest cloning in more cases involving closures: ``` error[E0507]: cannot move out of `foo` in pattern guard --> $DIR/issue-27282-move-ref-mut-into-guard.rs:11:19 | LL | if { (|| { let mut bar = foo; bar.take() })(); false } => {}, | ^^ --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait | | | `foo` is moved here | = note: variables bound in patterns cannot be moved from until after the end of the pattern guard help: consider cloning the value if the performance cost is acceptable | LL | if { (|| { let mut bar = foo.clone(); bar.take() })(); false } => {}, | ++++++++ ```
2024-04-11Suggest `.clone()` in some move errorsEsteban Küber-0/+5
``` error[E0507]: cannot move out of `*x` which is behind a shared reference --> $DIR/borrowck-fn-in-const-a.rs:6:16 | LL | return *x | ^^ move occurs because `*x` has type `String`, which does not implement the `Copy` trait | help: consider cloning the value if the performance cost is acceptable | LL - return *x LL + return x.clone() | ```
2024-04-11Account for unops when suggesting cloningEsteban Küber-6/+9
2024-04-11Suggest `.clone()` when moved while borrowedEsteban Küber-0/+20
2024-03-27Use `TraitRef::to_string` sorting in favor of `TraitRef::ord`, as the latter ↵Oli Scherer-2/+2
compares `DefId`s which we need to avoid
2024-03-07Merge collect_mod_item_types query into check_well_formedOli Scherer-2/+17
2024-02-22remove `sub_relations` from infcx, recompute in diagnosticslcnr-16/+1
we don't track them when canonicalizing or when freshening, resulting in instable caching in the old solver, and issues when instantiating query responses in the new one.
2024-02-18macro_rules: Preserve all metavariable spans in a global side tableVadim Petrochenkov-7/+4
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-17/+17
2024-02-14remove importing suggestions when there is a shadowed typo canddiateyukang-5/+0
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-3/+18
2024-02-06Make sure that async closures (and fns) only capture their parent callable's ↵Michael Goulet-27/+2
parameters by move, and nothing else
2024-01-29Supress unhelpful diagnostics for unresolved top level attributesyukang-12/+3
2024-01-13Bless testsGeorge-lewis-0/+1
Update tests
2024-01-05Remove revisions for THIR unsafeckMatthew Jasper-1593/+188
This is to make the diff when stabilizing it easier to review.
2023-11-24Show number in error message even for one errorNilstrieb-49/+49
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-07Rework print_disambiguation_helpMichael Goulet-4/+4
2023-10-26Tweak suggestion spans for invalid crate-level inner attributeEsteban Küber-2/+6
CC #89566.