summary refs log tree commit diff
path: root/tests/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2024-03-14Auto merge of #122347 - oli-obk:track_errors13, r=compiler-errorsbors-32/+32
Revert "Auto merge of #122140 - oli-obk:track_errors13, r=davidtwco" This reverts commit 65cd843ae06ad00123c131a431ed5304e4cd577a, reversing changes made to d255c6a57c393db6221b1ff700daea478436f1cd. reverts https://github.com/rust-lang/rust/pull/122140 It was a large regression in wall time due to trashing CPU caches
2024-03-11Revert "Auto merge of #122140 - oli-obk:track_errors13, r=davidtwco"Oli Scherer-32/+32
This reverts commit 65cd843ae06ad00123c131a431ed5304e4cd577a, reversing changes made to d255c6a57c393db6221b1ff700daea478436f1cd.
2024-03-11Remove some unnecessary allow(incomplete_features)Michael Goulet-10/+5
2024-03-11Run a single huge `par_body_owners` instead of many small ones after each other.Oli Scherer-32/+32
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-09Auto merge of #122150 - ShoyuVanilla:replace-typewalker, r=lcnrbors-1/+10
Replace `TypeWalker` usage with `TypeVisitor` in `wf.rs` Resolves #121693
2024-03-08Auto merge of #121500 - oli-obk:track_errors12, r=petrochenkovbors-20/+20
Merge `collect_mod_item_types` query into `check_well_formed` follow-up to https://github.com/rust-lang/rust/pull/121154 this removes more potential parallel-compiler bottlenecks and moves diagnostics for the same items next to each other, instead of grouping diagnostics by analysis kind
2024-03-08Auto merge of #122078 - gurry:121443-ice-layout-is-sized-alt, r=oli-obkbors-2/+27
Check that return type is WF in typeck Ensures that non-WF types do not pass typeck and then later ICE in MIR/const eval Fixes #121443
2024-03-08Replace `TypeWalker` usage with `TypeVisitor`Shoyu Vanilla-1/+10
2024-03-07Use the same collection order as check_mod_type_wfOli Scherer-20/+20
2024-03-07Merge `check_mod_impl_wf` and `check_mod_type_wf`Oli Scherer-7/+38
2024-03-06Check that return type is WF in typeckGurinder Singh-2/+27
Without it non-WF types could pass typeck and then later fail in MIR/const eval
2024-03-02Auto merge of #121657 - estebank:issue-119665, r=davidtwcobors-3/+3
Detect more cases of `=` to `:` typo When a `Local` is fully parsed, but not followed by a `;`, keep the `:` span arround and mention it. If the type could continue being parsed as an expression, suggest replacing the `:` with a `=`. ``` error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.` --> file.rs:2:32 | 2 | let _: std::env::temp_dir().join("foo"); | - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=` | | | while parsing the type for `_` | help: use `=` if you meant to assign ``` Fix #119665.
2024-03-01Detect more cases of `=` to `:` typoEsteban Küber-3/+3
When a `Local` is fully parsed, but not followed by a `;`, keep the `:` span arround and mention it. If the type could continue being parsed as an expression, suggest replacing the `:` with a `=`. ``` error: expected one of `!`, `+`, `->`, `::`, `;`, or `=`, found `.` --> file.rs:2:32 | 2 | let _: std::env::temp_dir().join("foo"); | - ^ expected one of `!`, `+`, `->`, `::`, `;`, or `=` | | | while parsing the type for `_` | help: use `=` if you meant to assign ``` Fix #119665.
2024-02-29Make infer higher ranked equate use bidirectional subtyping in invariant contextSantiago Pastorino-1/+17
2024-02-25Auto merge of #120393 - Urgau:rfc3373-non-local-defs, r=WaffleLapkinbors-0/+2
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-22remove `sub_relations` from infcx, recompute in diagnosticslcnr-9/+8
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-20Auto merge of #121087 - oli-obk:eager_const_failures, r=lcnrbors-12/+2
Always evaluate free constants and statics, even if previous errors occurred work towards https://github.com/rust-lang/rust/issues/79738 We will need to evaluate static items before the `definitions.freeze()` below, as we will start creating new `DefId`s (for nested allocations) within the `eval_static_initializer` query. But even without that motivation, this is a good change. Hard errors should always be reported and not silenced if other errors happened earlier.
2024-02-19Always evaluate free constants and statics, even if previous errors occurredOli Scherer-12/+2
2024-02-18Change leak check lint message to behavior is likely to change in the futureSantiago Pastorino-8/+6
2024-02-17Allow newly added non_local_definitions lint in testsUrgau-0/+2
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-337/+337
2024-02-14Continue compilation even if inherent impl checks failOli Scherer-2/+15
2024-02-14Use the correct char type on all platformsOli Scherer-9/+8
2024-02-14Continue compilation after check_mod_type_wf errorsOli Scherer-25/+239
2024-02-08Continue to borrowck even if there were previous errorsOli Scherer-3/+60
2024-02-07Update testsr0cky-6/+38
2024-02-04Auto merge of #120649 - matthiaskrgr:rollup-ek80j61, r=matthiaskrgrbors-26/+91
Rollup of 8 pull requests Successful merges: - #119759 (Add FileCheck annotations to dataflow-const-prop tests) - #120323 (On E0277 be clearer about implicit `Sized` bounds on type params and assoc types) - #120473 (Only suggest removal of `as_*` and `to_` conversion methods on E0308) - #120540 (add test for try-block-in-match-arm) - #120547 (`#![feature(inline_const_pat)]` is no longer incomplete) - #120552 (Correctly check `never_type` feature gating) - #120555 (put pnkfelix (me) back on the review queue.) - #120556 (Improve the diagnostics for unused generic parameters) r? `@ghost` `@rustbot` modify labels: rollup
2024-02-04Rollup merge of #120556 - fmease:improve-unused-generic-param-diags, r=oli-obkMatthias Krüger-26/+91
Improve the diagnostics for unused generic parameters * Don't emit two errors (namely E0091 *and* E0392) for unused type parameters on *lazy* type aliases * Fix the diagnostic help message of E0392 for *lazy* type aliases: Don't talk about the “fields” of lazy type aliases (use the term “body” instead) and don't suggest `PhantomData` for them, it doesn't make much sense * Consolidate the diagnostics for E0091 (unused type parameters in type aliases) and E0392 (unused generic parameters due to bivariance) and make it translatable * Still keep the error codes distinct (for now) * Naturally leads to better diagnostics for E0091 r? ```@oli-obk``` (to ballast your review load :P) or compiler
2024-02-03Rollup merge of #120531 - oli-obk:track_errors7, r=estebankMatthias Krüger-7/+44
Remove a bunch of `has_errors` checks that have no meaningful or the wrong effect r? `@nnethercote`
2024-02-01Improve the diagnostics for unused generic parametersLeón Orell Valerian Liehr-26/+91
2024-01-31Remove a has_errors check that only hides errors after unrelated items have ↵Oli Scherer-7/+44
errored.
2024-01-30Provide more context on derived obligation error primary labelEsteban Küber-7/+7
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-30Rollup merge of #120293 - estebank:issue-102629, r=nnethercoteGuillaume Gomez-15/+15
Deduplicate more sized errors on call exprs 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-26Auto merge of #116167 - RalfJung:structural-eq, r=lcnrbors-50/+15
remove StructuralEq trait The documentation given for the trait is outdated: *all* function pointers implement `PartialEq` and `Eq` these days. So the `StructuralEq` trait doesn't really seem to have any reason to exist any more. One side-effect of this PR is that we allow matching on some consts that do not implement `Eq`. However, we already allowed matching on floats and consts containing floats, so this is not new, it is just allowed in more cases now. IMO it makes no sense at all to allow float matching but also sometimes require an `Eq` instance. If we want to require `Eq` we should adjust https://github.com/rust-lang/rust/pull/115893 to check for `Eq`, and rule out float matching for good. Fixes https://github.com/rust-lang/rust/issues/115881
2024-01-25Rollup merge of #119895 - oli-obk:track_errors_3, r=matthewjasperMatthias Krüger-1/+10
Remove `track_errors` entirely follow up to https://github.com/rust-lang/rust/pull/119869 r? `@matthewjasper` There are some diagnostic changes adding new diagnostics or not emitting some anymore. We can improve upon that in follow-up work imo.
2024-01-24remove StructuralEq traitRalf Jung-50/+15
2024-01-24Deduplicate more sized errors on call exprsEsteban Küber-15/+15
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-24Remove extra # from urlest31-2/+2
2024-01-23Rollup merge of #119805 - chenyukang:yukang-fix-119530, r=davidtwcoLeón Orell Valerian Liehr-0/+4
Suggest array::from_fn for array initialization Fixes #119530
2024-01-23Remove track_errors entirelyOli Scherer-1/+10
2024-01-22Make generic const type mismatches not hide trait impls from the trait solverOli Scherer-3/+50
2024-01-21Suggest arry::from_fn for array initializationyukang-0/+4
2024-01-13Bless testsGeorge-lewis-0/+2
Update tests
2024-01-11Silence follow up errors if astconv already erroredOli Scherer-34/+7
2024-01-09Avoid silencing relevant follow-up errorsOli Scherer-13/+156
2024-01-05Auto merge of #118297 - shepmaster:warn-dead-tuple-fields, r=WaffleLapkinbors-4/+4
Merge `unused_tuple_struct_fields` into `dead_code` This implicitly upgrades the lint from `allow` to `warn` and places it into the `unused` lint group. [Discussion on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Moving.20.60unused_tuple_struct_fields.60.20from.20allow.20to.20warn)
2024-01-02Adjust compiler tests for unused_tuple_struct_fields -> dead_codeJake Goulding-4/+4
2024-01-02Reorder `check_item_type` diagnostics so they occur next to the ↵Oli Scherer-2/+43
corresponding `check_well_formed` diagnostics
2023-12-24add test for #116796bohan-0/+16
2023-12-14update use of feature flagslcnr-1/+1