about summary refs log tree commit diff
path: root/tests/ui/higher-ranked
AgeCommit message (Collapse)AuthorLines
2024-12-07Mention type parameter in more cases and don't suggest ~const bound already ↵Esteban Küber-1/+1
there
2024-12-07Use trait name instead of full constraint in suggestion messageEsteban Küber-4/+4
``` help: consider restricting type parameter `T` with traits `Copy` and `Trait` | LL | fn duplicate_custom<T: Copy + Trait>(t: S<T>) -> (S<T>, S<T>) { | ++++++++++++++ ``` ``` help: consider restricting type parameter `V` with trait `Copy` | LL | fn index<'a, K, V: std::marker::Copy>(map: &'a HashMap<K, V>, k: K) -> &'a V { | +++++++++++++++++++ ```
2024-12-07reword trait bound suggestion message to include the boundsEsteban Küber-4/+4
2024-12-04Avoid `opaque type not constrained` errors in the presence of other errorsOli Scherer-13/+4
2024-12-02Assert that obligations are empty before deeply normalizingMichael Goulet-13/+1
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-7/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-11-22Stabilize the 2024 editionEric Huss-1/+0
2024-11-12Make sure to ignore elided lifetimes when pointing at args for fulfillment ↵Michael Goulet-2/+2
errors
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-3/+3
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-15Bless testsMichael Goulet-13/+22
2024-10-15update test descriptionlcnr-3/+3
2024-10-15stabilize `-Znext-solver=coherence`lcnr-23/+13
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-2/+2
2024-09-11Revert 'Stabilize -Znext-solver=coherence'Michael Goulet-16/+26
2024-09-05update test descriptionlcnr-3/+3
2024-09-05stabilize `-Znext-solver=coherence`lcnr-23/+13
2024-08-13Use the right type when coercing fn items to pointersMichael Goulet-0/+10
2024-07-25Auto merge of #127042 - GrigorenkoPV:derivative, r=compiler-errorsbors-2/+2
Switch from `derivative` to `derive-where` This is a part of the effort to get rid of `syn 1.*` in compiler's dependencies: #109302 Derivative has not been maintained in nearly 3 years[^1]. It also depends on `syn 1.*`. This PR replaces `derivative` with `derive-where`[^2], a not dead alternative, which uses `syn 2.*`. A couple of `Debug` formats have changed around the skipped fields[^3], but I doubt this is an issue. [^1]: https://github.com/mcarton/rust-derivative/issues/117 [^2]: https://lib.rs/crates/derive-where [^3]: See the changes in `tests/ui`
2024-07-17Rollup merge of #127844 - chenyukang:yukang-fix-type-bound-127555, r=jieyouxuMatthias Krüger-20/+0
Remove invalid further restricting suggestion for type bound This PR partially addresses #127555, it will remove the obvious error suggestion: ```console | ^^^^ required by this bound in `<Baz as Foo>::bar` help: consider further restricting this bound | 12 | F: FnMut() + Send + std::marker::Send, | +++++++++++++++++++ ``` I may create another PR to get a better diagnostic for `impl has stricter requirements than trait` scenario.
2024-07-17Remove invalid further restricting for type boundyukang-20/+0
2024-07-14Use ordinal number in argument errorlong-long-float-1/+1
Fix error message Fix tests Format
2024-07-12rustc_type_ir: derivative -> derive-wherePavel Grigorenko-2/+2
2024-07-10instantiate higher ranked goals in candidate selectionlcnr-208/+94
reverts #119820
2024-07-03Auto merge of #123737 - compiler-errors:alias-wf, r=lcnrbors-0/+20
Check alias args for WF even if they have escaping bound vars #### What This PR stops skipping arguments of aliases if they have escaping bound vars, instead recursing into them and only discarding the resulting obligations referencing bounds vars. #### An example: From the test: ``` trait Trait { type Gat<U: ?Sized>; } fn test<T>(f: for<'a> fn(<&'a T as Trait>::Gat<&'a [str]>)) where for<'a> &'a T: Trait {} //~^ ERROR the size for values of type `[()]` cannot be known at compilation time fn main() {} ``` We now prove that `str: Sized` in order for `&'a [str]` to be well-formed. We were previously unconditionally skipping over `&'a [str]` as it referenced a buond variable. We now recurse into it and instead only discard the `[str]: 'a` obligation because of the escaping bound vars. #### Why? This is a change that improves consistency about proving well-formedness earlier in the pipeline, which is necessary for future work on where-bounds in binders and correctly handling higher-ranked implied bounds. I don't expect this to fix any unsoundness. #### What doesn't it fix? Specifically, this doesn't check projection predicates' components are well-formed, because there are too many regressions: https://github.com/rust-lang/rust/pull/123737#issuecomment-2052198478
2024-06-28Move binder and polarity parsing into parse_generic_ty_boundMichael Goulet-0/+30
2024-06-20Add opaque type testOli Scherer-5/+81
2024-06-19rustc_type_ir: Omit some struct fields from Debug outputLeón Orell Valerian Liehr-2/+2
2024-06-12Also passthrough for projection clausesMichael Goulet-2/+2
2024-06-11Remove DebugWithInfcxMichael Goulet-2/+2
2024-06-08tests: Add ui/higher-ranked/trait-bounds/normalize-generic-arg.rsMartin Nordholts-0/+39
2024-05-30update UI testslcnr-2/+2
2024-05-24drop region constraints for ambiguous goalslcnr-0/+104
2024-05-21Okay actually check only alias TYPESMichael Goulet-0/+20
2024-05-18Fix typos (taking into account review comments)blyxyas-1/+1
2024-05-11Consolidate obligation cause codes for where clausesMichael Goulet-6/+41
2024-05-02Use a proof tree visitor to refine the Obligation for error reportingMichael Goulet-1/+14
2024-04-03rebase oddityBoxy-40/+41
2024-04-03move leak check out of candidate evaluationlcnr-157/+765
this prevents higher ranked goals from guiding selection
2024-04-01Fix obligation param and bless testsMichael Goulet-61/+43
2024-04-01Instantiate closure-like bounds with placeholders to deal with binders correctlyMichael Goulet-0/+51
2024-03-25In `pretty_print_type()`, print `async fn` futures' paths instead of spans.Kevin Reid-1/+1
This makes `-Zprint-type-sizes`'s output easier to read, because the name of an `async fn` is more immediately recognizable than its span. I also deleted the comment "FIXME(eddyb) should use `def_span`." because it appears to have already been fixed by commit 67727aa7c31a24ea73a91a9134c3653fae8209ab.
2024-03-23Add test in `higher-ranked`Luv-Ray-0/+44
2024-03-14eagerly instantiate binders to avoid relying on `sub`lcnr-77/+39
2024-03-11Revert "Auto merge of #122140 - oli-obk:track_errors13, r=davidtwco"Oli Scherer-13/+13
This reverts commit 65cd843ae06ad00123c131a431ed5304e4cd577a, reversing changes made to d255c6a57c393db6221b1ff700daea478436f1cd.
2024-03-11Auto merge of #122338 - workingjubilee:rollup-xzpt4v4, r=workingjubileebors-10/+37
Rollup of 15 pull requests Successful merges: - #116791 (Allow codegen backends to opt-out of parallel codegen) - #116793 (Allow targets to override default codegen backend) - #117458 (LLVM Bitcode Linker: A self contained linker for nvptx and other targets) - #119385 (Fix type resolution of associated const equality bounds (take 2)) - #121438 (std support for wasm32 panic=unwind) - #121893 (Add tests (and a bit of cleanup) for interior mut handling in promotion and const-checking) - #122080 (Clarity improvements to `DropTree`) - #122152 (Improve diagnostics for parenthesized type arguments) - #122166 (Remove the unused `field_remapping` field from `TypeLowering`) - #122249 (interpret: do not call machine read hooks during validation) - #122299 (Store backtrace for `must_produce_diag`) - #122318 (Revision-related tweaks for next-solver tests) - #122320 (Use ptradd for vtable indexing) - #122328 (unix_sigpipe: Replace `inherit` with `sig_dfl` in syntax tests) - #122330 (bootstrap readme: fix, improve, update) r? `@ghost` `@rustbot` modify labels: rollup
2024-03-11Run a single huge `par_body_owners` instead of many small ones after each other.Oli Scherer-13/+13
This improves parallel rustc parallelism by avoiding the bottleneck after each individual `par_body_owners` (because it needs to wait for queries to finish, so if there is one long running one, a lot of cores will be idle while waiting for the single query).
2024-03-10Ignore tests w/ current/next revisions from compare-mode=next-solverMichael Goulet-10/+37
2024-03-01Rollup merge of #121497 - lcnr:coherence-suggest-increasing-recursion-limit, ↵Matthias Krüger-1/+0
r=compiler-errors `-Znext-solver=coherence`: suggest increasing recursion limit r? `@compiler-errors`
2024-03-01Rollup merge of #121475 - jieyouxu:tidy-stderr-check, r=the8472,compiler-errorsMatthias Krüger-79/+0
Add tidy check for .stderr/.stdout files for non-existent test revisions Closes #77498.
2024-02-29Remove stray stdout/stderr files许杰友 Jieyou Xu (Joe)-79/+0