You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR promotes const_generics to a standard feature not anymore behind a feature flag.
#7512 made const_generic experimental feature enabled by default, but still kept it as experimental, with the decision to remove the feature flag as a part of the next breaking release 0.71.0.
The const_generic experimental feature is removed. If a compilation used --experimental/no-experimental const_generic or #[cfg(experimental_const_generics)] it will fail now. The solution is to simply remove all the usages of the feature flag.
Checklist
I have linked to any relevant issues.
I have commented my code, particularly in hard-to-understand areas.
I have updated the documentation where relevant (API docs, the reference, and the Sway book).
Medium Risk
Promotes const_generics out of the experimental/flagged path and rewires stdlib encoding/decoding and generic-param handling, which could affect compilation and ABI behavior for arrays/str[N] across projects. Most changes are mechanical removals of cfg(experimental_const_generics) branches, but the surface area is large in sway-lib-std.
Overview Promotes const_generics to always-on behavior by removing the const_generics entry from sway-features and dropping related #[cfg(experimental_const_generics = ...)] gating in docs and stdlib.
In sway-core, const generic parameters are now always converted into ConstGenericParameters without emitting “feature disabled” diagnostics.
In sway-lib-std, array and str[N] support is simplified to rely on const generics directly: the code generator script stops emitting the many fixed-size non-const-generic AbiEncode/AbiDecode/Debug impls, and the stdlib keeps only the generic [T; N] and str[N] implementations (still respecting experimental_str_array_no_padding).
Reviewed by Cursor Bugbot for commit 14da455. Bugbot is set up for automated code reviews on this repo. Configure here.
ironcev
added
compiler
General compiler. Should eventually become more specific as the issue is triaged
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
compiler: ui
Mostly compiler messages
labels
Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
breakingMay cause existing user code to break. Requires a minor or major release.compiler: frontendEverything to do with type checking, control flow analysis, and everything between parsing and IRgencompiler: uiMostly compiler messagescompilerGeneral compiler. Should eventually become more specific as the issue is triaged
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR promotes
const_genericsto a standard feature not anymore behind a feature flag.#7512 made
const_genericexperimental feature enabled by default, but still kept it as experimental, with the decision to remove the feature flag as a part of the next breaking release 0.71.0.Breaking change
The
const_genericexperimental feature is removed. If a compilation used--experimental/no-experimental const_genericor#[cfg(experimental_const_generics)]it will fail now. The solution is to simply remove all the usages of the feature flag.Checklist
Breaking*orNew Featurelabels where relevant.