about summary refs log tree commit diff
path: root/tests/ui/const-generics
AgeCommit message (Collapse)AuthorLines
2023-12-14update use of feature flagslcnr-1/+1
2023-12-09report_not_const_evaluatable_error to avoid ICEing on ConstKind::ExprLenko Donchev-0/+89
2023-12-07Resolve assoc item bindings by namespaceLeón Orell Valerian Liehr-11/+23
If a const is expected, resolve a const. If a type is expected, resolve a type. Don't try to resolve a type first falling back to consts.
2023-12-02Auto merge of #118077 - calebzulawski:sync-portable-simd-2023-11-19, ↵bors-4/+4
r=workingjubilee Portable SIMD subtree update Syncs nightly to the latest changes from rust-lang/portable-simd r? `@rust-lang/libs`
2023-12-02fix an ICE when a valtree failed to evaluateRalf Jung-0/+15
2023-11-30generic_const_exprs: suggest to add the feature, not use itRalf Jung-67/+67
2023-11-27Auto merge of #117200 - rmehri01:repeated_help, r=WaffleLapkinbors-1/+0
Don't add redundant help for object safety violations Fixes #117186 r? WaffleLapkin
2023-11-26don't add redundant help for object safety violationsRyan Mehri-1/+0
2023-11-26Update std::simd usage and test outputsCaleb Zulawski-4/+4
2023-11-24Show number in error message even for one errorNilstrieb-148/+148
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-29On object safety error, mention new enum as alternativeEsteban Küber-0/+1
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-25Rollup merge of #116401 - WaffleLapkin:vtablin''', r=oli-obkMatthias Krüger-2/+5
Return multiple object-safety violation errors and code improvements to the object-safety check See individual commits for more information. Split off of #114260, since it turned out that the main intent of that PR was wrong. r? oli-obk
2023-10-25Return multiple object-safety violation errorsMaybe Waffle-2/+5
2023-10-25Auto merge of #117180 - matthiaskrgr:rollup-rxhl6ep, r=matthiaskrgrbors-0/+25
Rollup of 7 pull requests Successful merges: - #117111 (Remove support for alias `-Z instrument-coverage`) - #117141 (Require target features to match exactly during inlining) - #117152 (Fix unwrap suggestion for async fn) - #117154 (implement C ABI lowering for CSKY) - #117159 (Work around the fact that `check_mod_type_wf` may spuriously return `ErrorGuaranteed`) - #117163 (compiletest: Display compilation errors in mir-opt tests) - #117173 (Make `Iterator` a lang item) r? `@ghost` `@rustbot` modify labels: rollup
2023-10-25Work around the fact that `check_mod_type_wf` may spuriously return ↵Oli Scherer-0/+25
`ErrorGuaranteed`, even if that error is only emitted by `check_modwitem_types`
2023-10-25Fix problematic commentcui fliter-1/+1
Signed-off-by: cui fliter <imcusg@gmail.com>
2023-10-23Update `since` stability attributes in testsDavid Tolnay-3/+3
2023-10-20Avoid a `track_errors` by bubbling up most errors from `check_well_formed`Oli Scherer-3/+18
2023-10-18Tweak wording of type errors involving type paramsEsteban Küber-1/+1
Fix #78206.
2023-10-16Normalize alloc-id in tests.Camille GILLOT-1/+1
2023-10-15place evaluation: require the original pointer to be aligned if an access ↵Ralf Jung-2/+3
happens
2023-10-15Auto merge of #116688 - compiler-errors:rustfmt-up, r=WaffleLapkin,Nilstriebbors-1/+1
Format all the let-chains in compiler crates Since rust-lang/rustfmt#5910 has landed, soon we will have support for formatting let-chains (as soon as rustfmt syncs and beta gets bumped). This PR applies the changes [from master rustfmt to rust-lang/rust eagerly](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/out.20formatting.20of.20prs/near/374997516), so that the next beta bump does not have to deal with a 200+ file diff and can remain concerned with other things like `cfg(bootstrap)` -- #113637 was a pain to land, for example, because of let-else. I will also add this commit to the ignore list after it has landed. The commands that were run -- I'm not great at bash-foo, but this applies rustfmt to every compiler crate, and then reverts the two crates that should probably be formatted out-of-tree. ``` ~/rustfmt $ ls -1d ~/rust/compiler/* | xargs -I@ cargo run --bin rustfmt -- `@/src/lib.rs` --config-path ~/rust --edition=2021 # format all of the compiler crates ~/rust $ git checkout HEAD -- compiler/rustc_codegen_{gcc,cranelift} # revert changes to cg-gcc and cg-clif ``` cc `@rust-lang/rustfmt` r? `@WaffleLapkin` or `@Nilstrieb` who said they may be able to review this purely mechanical PR :> cc `@Mark-Simulacrum` and `@petrochenkov,` who had some thoughts on the order of operations with big formatting changes in https://github.com/rust-lang/rust/pull/95262#issue-1178993801. I think the situation has changed since then, given that let-chains support exists on master rustfmt now, and I'm fairly confident that this formatting PR should land even if *bootstrap* rustfmt doesn't yet format let-chains in order to lessen the burden of the next beta bump.
2023-10-14Propagate pattern errors via a new `PatKind::Error` variantNadrieril-13/+1
Instead of via `Const::new_error`
2023-10-13Bless tests and new warnings due to formatting changesMichael Goulet-1/+1
2023-10-11Prevent spurious `unreachable pattern` lintsOli Scherer-1/+13
Means you'll get more `non-exhaustive` patterns
2023-10-09Extend impl's def_span to include where clausesMichael Goulet-1/+1
2023-10-06Auto merge of #114811 - estebank:impl-ambiguity, r=wesleywiserbors-11/+20
Show more information when multiple `impl`s apply - When there are `impl`s without type params, show only those (to avoid showing overly generic `impl`s). ``` error[E0283]: type annotations needed --> $DIR/multiple-impl-apply.rs:34:9 | LL | let y = x.into(); | ^ ---- type must be known at this point | note: multiple `impl`s satisfying `_: From<Baz>` found --> $DIR/multiple-impl-apply.rs:14:1 | LL | impl From<Baz> for Bar { | ^^^^^^^^^^^^^^^^^^^^^^ ... LL | impl From<Baz> for Foo { | ^^^^^^^^^^^^^^^^^^^^^^ = note: required for `Baz` to implement `Into<_>` help: consider giving `y` an explicit type | LL | let y: /* Type */ = x.into(); | ++++++++++++ ``` - Lower the importance of `T: Sized`, `T: WellFormed` and coercion errors, to prioritize more relevant errors. The pre-existing deduplication logic deals with hiding redundant errors better that way, and we show errors with more metadata that is useful to the user. - Show `<SelfTy as Trait>::assoc_fn` suggestion in more cases. ``` error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type --> $DIR/cross-return-site-inference.rs:38:16 | LL | return Err(From::from("foo")); | ^^^^^^^^^^ cannot call associated function of trait | help: use a fully-qualified path to a specific available implementation | LL | return Err(</* self type */ as From>::from("foo")); | +++++++++++++++++++ + ``` Fix #88284.
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+5
2023-10-04Reorder fullfillment errors to keep more interesting ones firstEsteban Küber-11/+20
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-02For a single impl candidate, try to unify it with error trait refMichael Goulet-1/+1
2023-09-28make adt_const_params feature suggestion more consistent with others and ↵asquared31415-48/+193
only suggest it when the type can probably work
2023-09-24ConstParamTy: require EqRalf Jung-3/+34
2023-09-21adjust how closure/generator types and rvalues are printedRalf Jung-3/+3
2023-09-20Auto merge of #115486 - compiler-errors:dont-capture-late-pls, r=cjgillotbors-58/+94
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-11Rollup merge of #115744 - fmease:fix-e0401, r=compiler-errorsMatthias Krüger-5/+5
Improve diagnostic for generic params from outer items (E0401) Generalize the wording of E0401 to talk about *outer items* instead of *outer functions* since the current phrasing is outdated. The outer item can be a function, constant, trait, ADT or impl block (see the new UI test for the more exotic examples). Further, don't suggest introducing generic parameters to constant items unless the feature `generic_const_items` is enabled. Lastly, make E0401 translatable while we're at it. Fixes #115720.
2023-09-10Point out if a local trait has no implementationsMichael Goulet-1/+16
2023-09-10Generalize E0401León Orell Valerian Liehr-5/+5
2023-09-05Restore some removed testsMichael Goulet-12/+50
2023-09-05Correctly deny late-bound lifetimes from parent in anon consts and TAITsMichael Goulet-58/+56
2023-09-01Auto merge of #113126 - Bryanskiy:delete_old, r=petrochenkovbors-26/+2
Replace old private-in-public diagnostic with type privacy lints Next part of RFC https://github.com/rust-lang/rust/issues/48054. r? `@petrochenkov`
2023-08-30Update failure statusJohn Kåre Alsaker-2/+5
2023-08-26More accurately point at argumentsEsteban Küber-2/+2
2023-08-25Handle Self in paths tooMichael Goulet-2/+2
2023-08-25Walk through full path in point_at_path_if_possibleMichael Goulet-2/+2
2023-08-23Improve note for the invalid_reference_casting lintUrgau-0/+1
Add link to the book interior mutability chapter, https://doc.rust-lang.org/book/ch15-05-interior-mutability.html.
2023-08-09Rollup merge of #114606 - bvanjoi:fix-113462, r=compiler-errorsMatthias Krüger-0/+27
fix: not insert missing lifetime for `ConstParamTy` Fixes #113462 We should ignore the missing lifetime, as it's illegal to include a lifetime in a const param. r? ``@compiler-errors``
2023-08-08Auto merge of #114637 - matthiaskrgr:rollup-544y8p5, r=matthiaskrgrbors-70/+13
Rollup of 11 pull requests Successful merges: - #106425 (Make ExitStatus implement Default) - #113480 (add aarch64-unknown-teeos target) - #113586 (Mention style for new syntax in tracking issue template) - #113593 (CFI: Fix error compiling core with LLVM CFI enabled) - #114612 (update llvm-wrapper include to silence deprecation warning) - #114613 (Prevent constant rebuilds of `rustc-main` (and thus everything else)) - #114615 (interpret: remove incomplete protection against invalid where clauses) - #114628 (Allowing re-implementation of mir_drops_elaborated query) - #114629 (tests: Uncomment now valid GAT code behind FIXME) - #114630 (Migrate GUI colors test to original CSS color format) - #114631 (add provisional cache test for new solver) r? `@ghost` `@rustbot` modify labels: rollup
2023-08-08Rollup merge of #114615 - RalfJung:interpret-invalid-where, r=lcnrMatthias Krüger-70/+13
interpret: remove incomplete protection against invalid where clauses Cc https://github.com/rust-lang/rust/issues/97477, https://github.com/rust-lang/project-const-generics/issues/37 r? ``@lcnr``
2023-08-08Auto merge of #114545 - fee1-dead-contrib:lower-impl-effect, r=oli-obkbors-8/+36
correctly lower `impl const` to bind to host effect param r? `@oli-obk`
2023-08-08interpret: remove incomplete protection against invalid where clausesRalf Jung-70/+13