summary refs log tree commit diff
path: root/tests/ui/const-generics/generic_const_exprs
AgeCommit message (Collapse)AuthorLines
2025-03-11Implement `#[define_opaque]` attribute for functions.Oli Scherer-4/+4
2025-03-03Don't typeck during WF, instead check outside of WF in check_crateMichael Goulet-6/+6
2025-02-14Trim suggestion parts to the subset that is purely additiveMichael Goulet-8/+8
2025-02-14Use underline suggestions for purely 'additive' replacementsMichael Goulet-24/+16
2025-02-14fallout :skull_emoji:lcnr-25/+25
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-20/+30
``` 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-5/+5
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-28Properly check that array length is valid type during built-in unsizing in indexMichael Goulet-0/+2
2025-01-26Compiler: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-5/+5
2025-01-22Auto merge of #135896 - matthiaskrgr:rollup-g6rv7za, r=matthiaskrgrbors-1/+1
Rollup of 9 pull requests Successful merges: - #132983 (Edit dangling pointers ) - #135409 (Fix ICE-133117: multiple never-pattern arm doesn't have false_edge_start_block) - #135557 (Point at invalid utf-8 span on user's source code) - #135596 (Properly note when query stack is being cut off) - #135794 (Detect missing fields with default values and suggest `..`) - #135814 (ci: use ghcr buildkit image) - #135826 (Misc. `rustc_resolve` cleanups) - #135837 (Remove test panic from File::open) - #135856 (Library: Finalize dyn compatibility renaming) r? `@ghost` `@rustbot` modify labels: rollup
2025-01-22Refactor dyn-compatibility error and suggestionsTaylor Cramer-29/+34
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
2025-01-16Properly note when query stack is being cut offMichael Goulet-1/+1
2025-01-11Remove a bunch of diagnostic stashing that doesn't do anythingMichael Goulet-5/+22
2025-01-09Always take the `Ok` path in `lit_to_const` and produce error constants insteadOli Scherer-0/+43
2025-01-01Try to write the panic message with a single `write_all` callJohn Kåre Alsaker-0/+1
2024-12-27Remove the `-test` suffix from normalize directivesZalathar-3/+3
2024-12-18add testslcnr-0/+30
2024-12-09fix ICE on type error in promotedRalf Jung-14/+0
2024-12-06Remove polymorphizationBen Kimock-46/+0
2024-12-01fix ICE when promoted has layout size overflowRalf Jung-0/+14
2024-11-27Rollup merge of #133518 - compiler-errors:structurally-resolve-never, r=lcnrMatthias Krüger-8/+8
Structurally resolve before checking `!` in HIR typeck Some more missing structural resolves in HIR typeck :> r? lcnr
2024-11-27Bless tests due to extra error reporting due to normalizing types that are ↵Michael Goulet-8/+8
not WF It's okay though b/c these are duplicated diagnostics.
2024-11-26Rollup merge of #133471 - lcnr:uwu-gamer, r=BoxyUwUMichael Goulet-0/+64
gce: fix typing_mode mismatch Fixes #133271 r? `@BoxyUwU`
2024-11-25fix gce typing_mode mismatchlcnr-0/+64
2024-11-24Simplify array length mismatch error reportingMichael Goulet-3/+1
2024-11-21Stop being so bail-y in candidate assemblyMichael Goulet-0/+36
2024-11-12Consolidate type system const evaluation under `traits::evaluate_const`Boxy-129/+0
mew
2024-11-03Yeet effects featureMichael Goulet-2/+2
2024-10-29Remove detail from label/note that is already available in other noteEsteban Küber-1/+1
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-26Deny calls to non-`#[const_trait]` methods in MIR constckDeadbeef-9/+21
2024-10-15stabilize `-Znext-solver=coherence`lcnr-20/+19
2024-10-11Don't assume traits used as type are trait objsVulnBandit-38/+5
2024-10-10UI tests: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-12/+12
2024-09-29fix(hir_analysis/wfcheck): don't leak {type error}Barrett Ray-3/+3
avoid `{type error}` being leaked in user-facing messages, particularly when using the `adt_const_params` feature
2024-09-27Rollup merge of #130826 - fmease:compiler-mv-obj-safe-dyn-compat, ↵Matthias Krüger-5/+5
r=compiler-errors Compiler: Rename "object safe" to "dyn compatible" Completed T-lang FCP: https://github.com/rust-lang/lang-team/issues/286#issuecomment-2338905118. Tracking issue: https://github.com/rust-lang/rust/issues/130852 Excludes `compiler/rustc_codegen_cranelift` (to be filed separately). Includes Stable MIR. Regarding https://github.com/rust-lang/rust/labels/relnotes, I guess I will manually open a https://github.com/rust-lang/rust/labels/relnotes-tracking-issue since this change affects everything (compiler, library, tools, docs, books, everyday language). r? ghost
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-5/+5
2024-09-24Ban combination of GCE and new solverMichael Goulet-1/+9
2024-09-22Introduce structurally_normalize_const, use it in hir_typeckMichael Goulet-2/+2
2024-09-20Normalize unevaluated consts in GCEMichael Goulet-44/+7
2024-09-17Remove redundant test typeid equality by subtypingSantiago Pastorino-81/+0
2024-09-12Re-enable `ConstArgKind::Path` lowering by defaultNoah Lev-14/+7
...and remove the `const_arg_path` feature gate as a result. It was only a stopgap measure to fix the regression that the new lowering introduced (which should now be fixed by this PR).
2024-09-11Revert 'Stabilize -Znext-solver=coherence'Michael Goulet-19/+20
2024-09-05stabilize `-Znext-solver=coherence`lcnr-20/+19
2024-08-24Rollup merge of #129246 - BoxyUwU:feature_gate_const_arg_path, r=cjgillotMatthias Krüger-10/+17
Retroactively feature gate `ConstArgKind::Path` This puts the lowering introduced by #125915 under a feature gate until we fix the regressions introduced by it. Alternative to whole sale reverting the PR since it didn't seem like a very clean revert and I think this is generally a step in the right direction and don't want to get stuck landing and reverting the PR over and over :) cc #129137 ``@camelid,`` tests taken from there. beta is branching soon so I think it makes sense to not try and rush that fix through since it wont have much time to bake and if it has issues we can't simply revert it on beta. Fixes #128016
2024-08-19Retroactively feature gate `ConstArgKind::Path`Boxy-10/+17
2024-08-17Bless test falloutMichael Goulet-3/+3
2024-08-10Auto merge of #128714 - camelid:wf-struct-exprs, r=BoxyUwUbors-1/+13
WF-check struct field types at construction site Fixes #126272. Fixes #127299. Rustc of course already WF-checked the field types at the definition site, but for error tainting of consts to work properly, there needs to be an error emitted at the use site. Previously, with no use-site error, we proceeded with CTFE and ran into ICEs since we are running code with type errors. Emitting use-site errors also brings struct-like constructors more in line with fn-like constructors since they already emit use-site errors for WF issues. r? `@BoxyUwU`
2024-08-05WF-check struct field types at construction siteNoah Lev-1/+13
Rustc of course already WF-checked the field types at the definition site, but for error tainting of consts to work properly, there needs to be an error emitted at the use site. Previously, with no use-site error, we proceeded with CTFE and ran into ICEs since we are running code with type errors. Emitting use-site errors also brings struct-like constructors more in line with fn-like constructors since they already emit use-site errors for WF issues.
2024-08-05interpret: move nullary-op evaluation into operator.rsRalf Jung-1/+1
2024-08-03Revert "Rollup merge of #125572 - mu001999-contrib:dead/enhance, r=pnkfelix"Michael Goulet-2/+1
This reverts commit 13314df21b0bb0cdd02c6760581d1b9f1052fa7e, reversing changes made to 6e534c73c35f569492ed5fb5f349075d58ed8b7e.