about summary refs log tree commit diff
path: root/tests/ui/traits/non_lifetime_binders
AgeCommit message (Collapse)AuthorLines
2025-07-04Fix pretty printing of placeholder typesMichael Goulet-21/+22
2025-06-16tests: unconstrain params in `non_lifetime_binders`David Wood-43/+64
It seems like generics from `non_lifetime_binders` don't have any default bounds like normal generics, so all of the `?Sized` relaxations need to be further relaxed with `PointeeSized` for this test to be the equivalent of before.
2025-05-27Use more detailed spans in dyn compat errors within bodiesOli Scherer-20/+3
2025-05-26Deduplicate dyn compatibility violations due to coercionMichael Goulet-20/+2
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-1/+1
2025-04-04Don't construct preds w escaping bound vars in diagnostic_hir_wf_checkMichael Goulet-0/+83
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-3/+3
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-9/+6
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-8/+12
``` 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-31Rollup merge of #135860 - fmease:compiler-mv-obj-save-dyn-compat-ii, r=jieyouxuMatthias Krüger-3/+3
Compiler: Finalize dyn compatibility renaming Update the Reference link to use the new URL fragment from https://github.com/rust-lang/reference/pull/1666 (this change has finally hit stable). Fixes a FIXME. Follow-up to #130826. Part of #130852. ~~Blocking it on #133372.~~ (merged) r? ghost
2025-01-30move non_lifetime_binder testslcnr-0/+97
2025-01-26Compiler: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-3/+3
2025-01-22Refactor dyn-compatibility error and suggestionsTaylor Cramer-18/+21
This CL makes a number of small changes to dyn compatibility errors: - "object safety" has been renamed to "dyn-compatibility" throughout - "Convert to enum" suggestions are no longer generated when there exists a type-generic impl of the trait or an impl for `dyn OtherTrait` - Several error messages are reorganized for user readability Additionally, the dyn compatibility error creation code has been split out into functions. cc #132713 cc #133267
2024-12-24chore: fix typosoliveredget-1/+1
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-2/+2
Remove the "which is required by `{root_obligation}`" post-script in "the trait `X` is not implemented for `Y`" explanation in E0277. This information is already conveyed in the notes explaining requirements, making it redundant while making the text (particularly in labels) harder to read. ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ``` vs the prior ``` error[E0277]: the trait bound `NotCopy: Copy` is not satisfied --> $DIR/wf-static-type.rs:10:13 | LL | static FOO: IsCopy<Option<NotCopy>> = IsCopy { t: None }; | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `NotCopy`, which is required by `Option<NotCopy>: Copy` | = note: required for `Option<NotCopy>` to implement `Copy` note: required by a bound in `IsCopy` --> $DIR/wf-static-type.rs:7:17 | LL | struct IsCopy<T:Copy> { t: T } | ^^^^ required by this bound in `IsCopy` ```
2024-10-10UI tests: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-7/+7
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-3/+3
2024-07-29Detect non-lifetime binder params shadowing item paramsMichael Goulet-0/+62
2024-07-20Just totally fully deny late-bound constsMichael Goulet-9/+60
2024-07-16Add `ConstArgKind::Path` and make `ConstArg` its own HIR nodeNoah Lev-30/+0
This is a very large commit since a lot needs to be changed in order to make the tests pass. The salient changes are: - `ConstArgKind` gets a new `Path` variant, and all const params are now represented using it. Non-param paths still use `ConstArgKind::Anon` to prevent this change from getting too large, but they will soon use the `Path` variant too. - `ConstArg` gets a distinct `hir_id` field and its own variant in `hir::Node`. This affected many parts of the compiler that expected the parent of an `AnonConst` to be the containing context (e.g., an array repeat expression). They have been changed to check the "grandparent" where necessary. - Some `ast::AnonConst`s now have their `DefId`s created in rustc_ast_lowering rather than `DefCollector`. This is because in some cases they will end up becoming a `ConstArgKind::Path` instead, which has no `DefId`. We have to solve this in a hacky way where we guess whether the `AnonConst` could end up as a path const since we can't know for sure until after name resolution (`N` could refer to a free const or a nullary struct). If it has no chance as being a const param, then we create a `DefId` in `DefCollector` -- otherwise we decide during ast_lowering. This will have to be updated once all path consts use `ConstArgKind::Path`. - We explicitly use `ConstArgHasType` for array lengths, rather than implicitly relying on anon const type feeding -- this is due to the addition of `ConstArgKind::Path`. - Some tests have their outputs changed, but the changes are for the most part minor (including removing duplicate or almost-duplicate errors). One test now ICEs, but it is for an incomplete, unstable feature and is now tracked at #127009.
2024-03-14Consolidate WF for aliasesMichael Goulet-1/+22
2024-03-10Ignore tests w/ current/next revisions from compare-mode=next-solverMichael Goulet-4/+6
2024-02-27when defining opaques, require the hidden type to be well-formedlcnr-1/+15
2024-02-21Add a non-lifetime-binders testMichael Goulet-0/+60
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-20/+20
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-2/+2
Expand the primary span of E0277 when the immediate unmet bound is not what the user wrote: ``` error[E0277]: the trait bound `i32: Bar` is not satisfied --> f100.rs:6:6 | 6 | <i32 as Foo>::foo(); | ^^^ the trait `Bar` is not implemented for `i32`, which is required by `i32: Foo` | help: this trait has no implementations, consider adding one --> f100.rs:2:1 | 2 | trait Bar {} | ^^^^^^^^^ note: required for `i32` to implement `Foo` --> f100.rs:3:14 | 3 | impl<T: Bar> Foo for T {} | --- ^^^ ^ | | | unsatisfied trait bound introduced here ``` Fix #40120.
2024-01-24Deduplicate more sized errors on call exprsEsteban Küber-7/+7
Change the implicit `Sized` `Obligation` `Span` for call expressions to include the whole expression. This aids the existing deduplication machinery to reduce the number of errors caused by a single unsized expression.
2024-01-13Add a simpler testMichael Goulet-0/+45
2024-01-13Make sure to instantiate placeholders correctly in old solverMichael Goulet-0/+49
2024-01-09Avoid silencing relevant follow-up errorsOli Scherer-1/+1
2024-01-01Deny defaults for higher-ranked generic parametersLeón Orell Valerian Liehr-7/+98
2023-12-26fallback `default` to `None` during ast-loweing for lifetime binderbohan-0/+30
2023-12-21Simple modification of diagnostic informationsurechen-0/+22
fixes #119067
2023-11-24Show number in error message even for one errorNilstrieb-13/+13
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-11-19Make regionck care about placeholders in outlives componentsMichael Goulet-3/+91
2023-11-06Only check predicates for late-bound non-lifetime vars in object candidate ↵Michael Goulet-0/+19
assembly
2023-10-29On object safety error, mention new enum as alternativeEsteban Küber-0/+3
When we encounter a `dyn Trait` that isn't object safe, look for its implementors. If there's one, mention using it directly If there are less than 9, mention the possibility of creating a new enum and using that instead. Account for object unsafe `impl Trait on dyn Trait {}`. Make a distinction between public and sealed traits. Fix #80194.
2023-10-04Reorder fullfillment errors to keep more interesting ones firstEsteban Küber-6/+6
In `report_fullfillment_errors` push back `T: Sized`, `T: WellFormed` and coercion errors to the end of the list. The pre-existing deduplication logic eliminates redundant errors better that way, keeping the resulting output with fewer errors than before, while also having more detail.
2023-10-03non_lifetime_binders: fix ICE in lint opaque-hidden-inferred-boundLeón Orell Valerian Liehr-0/+27
2023-09-20Auto merge of #115486 - compiler-errors:dont-capture-late-pls, r=cjgillotbors-4/+4
Correctly deny late-bound lifetimes from parent in anon consts and TAITs Reuse the `AnonConstBoundary` scope (introduced in #108553, renamed in this PR to `LateBoundary`) to deny late-bound vars of *all* kinds (ty/const/lifetime) in anon consts and TAITs. Side-note, but I would like to consolidate this with the error reporting for RPITs (E0657): https://github.com/rust-lang/rust/blob/c4f25777a08cd64b710e8a9a6159e67cbb35e6f5/compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs#L733-L754 but the semantics about what we're allowed to capture there are slightly different, so I'm leaving that untouched. Fixes #115474
2023-09-10Point out if a local trait has no implementationsMichael Goulet-0/+5
2023-09-05Correctly deny late-bound lifetimes from parent in anon consts and TAITsMichael Goulet-4/+4
2023-08-28Revert "Suggest using `Arc` on `!Send`/`!Sync` types"David Tolnay-1/+0
This reverts commit 9de1a472b68ed85f396b2e2cc79c3ef17584d6e1.
2023-08-16Don't ICE in is_trivially_sized when encountering late-bound self tyMichael Goulet-0/+30
2023-08-09Suggest using `Arc` on `!Send`/`!Sync` typesEsteban Kuber-0/+1
2023-06-26Account for late-bound vars from parent arg-position impl traitMichael Goulet-0/+28
2023-06-19Don't ICE on bound var in reject_fn_ptr_implsMichael Goulet-0/+40
2023-05-15Tweaks and a testMichael Goulet-0/+45
2023-05-12Note base types of coercionMichael Goulet-2/+1
2023-05-04Add test for #110557Michael Goulet-0/+60