about summary refs log tree commit diff
path: root/tests/ui/traits
AgeCommit message (Collapse)AuthorLines
2025-07-04Rollup merge of #143300 - Kivooeo:tf25, r=tgross35Jubilee-0/+13
`tests/ui`: A New Order [25/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-04Rollup merge of #143297 - Kivooeo:tf22, r=tgross35Jubilee-0/+45
`tests/ui`: A New Order [22/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-04Rollup merge of #143296 - Kivooeo:tf21, r=tgross35Jubilee-0/+103
`tests/ui`: A New Order [21/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-05cleaned up some testsKivooeo-5/+7
2025-07-05cleaned up some testsKivooeo-2/+3
2025-07-05cleaned up some testsKivooeo-7/+8
2025-07-05cleaned up some testsKivooeo-2/+4
2025-07-05moved & deleted testsKivooeo-0/+43
opeq.rs was removed as duplicating test logic in other tests
2025-07-05moved testsKivooeo-0/+102
2025-07-04Fix pretty printing of placeholder typesMichael Goulet-21/+22
2025-07-04Remove Symbol for Named LateParam/Bound variantsMichael Goulet-1/+1
2025-07-04Rollup merge of #143308 - compiler-errors:no-pointer-like, r=oli-obkMatthias Krüger-38/+0
Remove `PointerLike` trait r? oli-obk
2025-07-04Rollup merge of #143307 - compiler-errors:fast-path-nitpicks, r=lcnrJacob Pratt-0/+23
Fast path nitpicks Miscellaneous commits that I didn't really want to fold into anything else. Fixes one theoretical bug with the fast path not considering polarity for `T: !Sized` bounds.
2025-07-03Remove PointerLike traitMichael Goulet-38/+0
2025-07-02Rollup merge of #143235 - compiler-errors:const-item-bound, r=oli-obkMatthias Krüger-0/+19
Assemble const bounds via normal item bounds in old solver too Fixes the first example in https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/elaboration.20of.20const.20bounds.3F/with/526378135 The code duplication here is not that nice, but it's at least very localized. cc `@davidtwco` r? oli-obk
2025-07-02Rollup merge of #142237 - benschulz:unused-parens-fn, r=fee1-deadMatthias Krüger-2/+2
Detect more cases of unused_parens around types With this change, more unused parentheses around bounds and types nested within bounds are detected.
2025-07-02Consider polarity in sizedness fast pathMichael Goulet-0/+23
2025-07-01Auto merge of #143036 - compiler-errors:no-dyn-star, r=oli-obkbors-42/+0
Remove support for `dyn*` from the compiler This PR removes support for `dyn*` (https://github.com/rust-lang/rust/issues/102425), which are a currently un-RFC'd experiment that was opened a few years ago to explore a component that we thought was necessary for AFIDT (async fn in dyn trait). It doesn't seem like we are going to need `dyn*` types -- even in an not-exposed-to-the-user way[^1] -- for us to implement AFIDT. Given that AFIDT was the original motivating purpose of `dyn*` types, I don't really see a compelling reason to have to maintain their implementation in the compiler. [^1]: Compared to, e.g., generators whih are an unstable building block we use to implement stable syntax like `async {}`. We've learned quite a lot from `dyn*`, but I think at this point its current behavior leads to more questions than answers. For example, `dyn*` support today remains somewhat fragile; it ICEs in many cases where the current "normal" `dyn Trait` types rely on their unsizedness for their vtable-based implementation to be sound I wouldn't be surprised if it's unsound in other ways, though I didn't play around with it too much. See the examples below. ```rust #![feature(dyn_star)] trait Foo { fn hello(self); } impl Foo for usize { fn hello(self) { println!("hello, world"); } } fn main() { let x: dyn* Foo = 1usize; x.hello(); } ``` And: ```rust #![feature(dyn_star)] trait Trait { type Out where Self: Sized; } fn main() { let x: <dyn* Trait as Trait>::Out; } ``` ...and probably many more problems having to do with the intersection of dyn-compatibility and `Self: Sized` bounds that I was too lazy to look into like: * GATs * Methods with invalid signatures * Associated consts Generally, `dyn*` types also end up getting in the way of working with [normal `dyn` types](https://github.com/rust-lang/rust/issues/102425#issuecomment-1712604409) to an extent that IMO outweighs the benefit of experimentation. I recognize that there are probably other, more creative usages of `dyn*` that are orthogonal to AFIDT. However, I think any work along those lines should first have to think through some of the more fundamental interactions between `dyn*` and dyn-compatibility before we think about reimplementing them in the type system. --- I'm planning on removing the `DynKind` enum and the `PointerLike` built-in trait from the compiler after this PR lands. Closes rust-lang/rust#102425. cc `@eholk` `@rust-lang/lang` `@rust-lang/types` Closes rust-lang/rust#116979. Closes rust-lang/rust#119694. Closes rust-lang/rust#134591. Closes rust-lang/rust#104800.
2025-07-01Remove support for dyn*Michael Goulet-42/+0
2025-07-01moved testsKivooeo-0/+45
2025-07-01Auto merge of #143287 - GuillaumeGomez:rollup-fdjcti9, r=GuillaumeGomezbors-0/+162
Rollup of 12 pull requests Successful merges: - rust-lang/rust#136801 (Implement `Random` for tuple) - rust-lang/rust#141867 (Describe Future invariants more precisely) - rust-lang/rust#142760 (docs(fs): Touch up grammar on lock api) - rust-lang/rust#143181 (Improve testing and error messages for malformed attributes) - rust-lang/rust#143210 (`tests/ui`: A New Order [19/N] ) - rust-lang/rust#143212 (`tests/ui`: A New Order [20/N]) - rust-lang/rust#143230 ([COMPILETEST-UNTANGLE 2/N] Make some compiletest errors/warnings/help more visually obvious) - rust-lang/rust#143240 (Port `#[rustc_object_lifetime_default]` to the new attribute parsing …) - rust-lang/rust#143255 (Do not enable LLD by default in the dist profile) - rust-lang/rust#143262 (mir: Mark `Statement` and `BasicBlockData` as `#[non_exhaustive]`) - rust-lang/rust#143269 (bootstrap: make comment more clear) - rust-lang/rust#143279 (Remove `ItemKind::descr` method) Failed merges: - rust-lang/rust#143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-01Rollup merge of #143210 - Kivooeo:tf19, r=tgross35Guillaume Gomez-0/+162
`tests/ui`: A New Order [19/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35`
2025-07-01Auto merge of #142030 - oli-obk:wfck-less-hir, r=compiler-errorsbors-85/+181
Start moving wf checking away from HIR I'm trying to only access the HIR in the error path. My hope is that once we move significant portions of wfcheck off HIR that incremental will be able to cache wfcheck queries significantly better. I think I am reaching a blocker because we normally need to provide good spans to `ObligationCause`, so that the trait solver can report good errors. In some cases I have been able to use bad spans and improve them depending on the `ObligationCauseCode` (by loading HIR in the case where we actually want to error). To scale that further we'll likely need to remove spans from the `ObligationCause` entirely (leaving it to some variants of `ObligationCauseCode` to have a span when they can't recompute the information later). Unsure this is the right approach, but we've already been using it. I will create an MCP about it, but that should not affect this PR, which is fairly limited in where it does those kind of tricks. Especially https://github.com/rust-lang/rust/commit/b862d8828e375ab8c128a9d9e93bf98b77cb5928 is interesting here, because I think it improves spans in all cases
2025-07-01moved testsKivooeo-0/+12
2025-07-01Detect more cases of unused_parens around typesBenjamin Schulz-2/+2
2025-07-01Rollup merge of #143234 - GuillaumeGomez:ice-143128, r=oli-obkMatthias Krüger-2/+2
Replace `ItemCtxt::report_placeholder_type_error` match with a call to `TyCtxt::def_descr` Fixes rust-lang/rust#143128. We could likely use `tcx.def_descr` in more places (and therefore remove more `descr` methods). If it's something that we want to do, I can send a follow-up. r? `@oli-obk`
2025-07-01moved testsKivooeo-0/+47
2025-06-30Replace `ItemCtxt::report_placeholder_type_error` `match` with a call to ↵Guillaume Gomez-2/+2
`TyCtxt::def_descr`
2025-06-30Assemble const bounds via normal item bounds in old solver tooMichael Goulet-0/+19
2025-06-30Rollup merge of #143168 - Kivooeo:tf16, r=tgross35dianqk-0/+49
`tests/ui`: A New Order [16/N] > [!NOTE] > > Intermediate commits are intended to help review, but will be squashed prior to merge. Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@tgross35` (just small one to test new method, also I should squash all this commits except move commit, so we after review will end up having like one move commit and one commit with changes, right?)
2025-06-30Rollup merge of #143159 - compiler-errors:freshen-re-error, r=oli-obkdianqk-0/+56
Do not freshen `ReError` Because `ReError` has `ErrorGuaranteed` in it, it affects candidate selection and thus causes incompleteness which leads to weirdness in eval. See the comment in the test. Also remove an unnecessary `lookup_op_method` since it doesn't effect tests. Fixes rust-lang/rust#132882. r? types
2025-06-30Rollup merge of #142429 - Kivooeo:tf13, r=jieyouxudianqk-0/+229
`tests/ui`: A New Order [13/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? ```@jieyouxu```
2025-06-30Merge `lower_item` into `check_item_type`Oli Scherer-1/+1
2025-06-30Move lazy type alias checks to non-hir-wfckOli Scherer-2/+2
2025-06-30Use predicate spans instead of whole item spansOli Scherer-19/+14
2025-06-30Check variances in the non-hir wfcheckerOli Scherer-11/+11
2025-06-30Don't look at static items' HIR for wfcheckOli Scherer-11/+11
2025-06-30Unconditionally run `check_item_type` on all itemsOli Scherer-50/+151
2025-06-30cleaned up some testsKivooeo-3/+12
2025-06-30cleaned up some testsKivooeo-60/+79
2025-06-29moved & deleted some testsKivooeo-0/+143
2025-06-29cleaned up some testsKivooeo-0/+229
2025-06-29Rollup merge of #142417 - Kivooeo:tf12, r=jieyouxuGuillaume Gomez-0/+151
`tests/ui`: A New Order [12/N] Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895. r? `@jieyouxu`
2025-06-29Fix the span of trait bound modifier `[const]`León Orell Valerian Liehr-215/+215
2025-06-28Do not freshen ReErrorMichael Goulet-0/+56
2025-06-28moved testsKivooeo-0/+40
2025-06-28cleaned up some testsKivooeo-0/+151
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-1211/+1266
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-27Rollup merge of #142671 - davidtwco:no-default-bounds-attr, r=lcnrGuillaume Gomez-89/+109
add #![rustc_no_implicit_bounds] Follow-up from rust-lang/rust#137944. Adds a new `rustc_attrs` attribute that stops rustc from adding any default bounds. Useful for tests where default bounds just add noise and make debugging harder. After reviewing all tests with `?Sized`, these tests seem like they could probably benefit from `#![rustc_no_implicit_bounds]`. - Skipping most of `tests/ui/unsized` as these seem to want to test `?Sized` - Skipping tests that used `Box<T>` because it's still bound by `T: MetaSized` - Skipping parsing or other tests that cared about `?Sized` syntactically - Skipping tests for `derive(CoercePointee)` because this appears to check that the pointee type is relaxed with `?Sized` explicitly r? `@lcnr`
2025-06-27tests: add #![rustc_no_implicit_bounds]David Wood-89/+109
After reviewing all tests with `?Sized` and discussing with lcnr, these tests seem like they could probably benefit from `#![rustc_no_implicit_bounds]`.