diff --git a/lib/feature.pm b/lib/feature.pm index 8d1c930ca542..e9fe3bc74636 100644 --- a/lib/feature.pm +++ b/lib/feature.pm @@ -4,7 +4,7 @@ # Any changes made here will be lost! package feature; -our $VERSION = '1.92'; +our $VERSION = '1.93'; our %feature = ( fc => 'feature_fc', @@ -801,6 +801,8 @@ sub __common { my $name = shift; if (substr($name, 0, 1) eq ":") { my $v = substr($name, 1); + carp('Feature bundle ":all" is deprecated and should not be used') + if $v eq 'all'; if (!exists $feature_bundle{$v}) { $v =~ s/^([0-9]+)\.([0-9]+).[0-9]+$/$1.$2/; if (!exists $feature_bundle{$v}) { @@ -841,6 +843,11 @@ sub unknown_feature_bundle { $feature, $^V)); } +sub carp { + require Carp; + Carp::carp(@_); +} + sub croak { require Carp; Carp::croak(@_); diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 3c162e56d5a0..ce980febb67e 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -167,6 +167,12 @@ L has been upgraded from version A.xx to B.yy. XXX If there was something important to note about this change, include that here. +=item * + +L has been upgraded from version 1.89 to 1.93. + +The C<:all> feature bundle now warns, suggesting you should not use it. + =back =head2 Removed Modules and Pragmata diff --git a/regen/feature.pl b/regen/feature.pl index 9ff19fbfca1a..ab3afb679f9f 100755 --- a/regen/feature.pl +++ b/regen/feature.pl @@ -546,7 +546,7 @@ sub longest { __END__ package feature; -our $VERSION = '1.92'; +our $VERSION = '1.93'; FEATURES @@ -1175,6 +1175,8 @@ sub __common { my $name = shift; if (substr($name, 0, 1) eq ":") { my $v = substr($name, 1); + carp('Feature bundle ":all" is deprecated and should not be used') + if $v eq 'all'; if (!exists $feature_bundle{$v}) { $v =~ s/^([0-9]+)\.([0-9]+).[0-9]+$/$1.$2/; if (!exists $feature_bundle{$v}) { @@ -1215,6 +1217,11 @@ sub unknown_feature_bundle { $feature, $^V)); } +sub carp { + require Carp; + Carp::carp(@_); +} + sub croak { require Carp; Carp::croak(@_); diff --git a/t/comp/require.t b/t/comp/require.t index aecacd74e191..e413a389153c 100644 --- a/t/comp/require.t +++ b/t/comp/require.t @@ -368,7 +368,6 @@ BEGIN { my @params = ( 'use v5.37', 'use feature ":5.38"', - 'use feature ":all"', 'use feature "module_true"', 'no feature "module_true"', '', diff --git a/t/lib/feature/bundle b/t/lib/feature/bundle index ef24bb953f13..d738d984f990 100644 --- a/t/lib/feature/bundle +++ b/t/lib/feature/bundle @@ -100,6 +100,7 @@ Assigning non-zero to $[ is no longer possible at - line 5. no feature ':all'; # turns array_base (and everything else) off $[ = 1; EXPECT +Feature bundle ":all" is deprecated and should not be used at - line 2. Assigning non-zero to $[ is no longer possible at - line 3. ######## # NAME $^H accidentally enabling all features diff --git a/t/op/lexsub.t b/t/op/lexsub.t index 5f4a5e6739d1..a7751085aced 100644 --- a/t/op/lexsub.t +++ b/t/op/lexsub.t @@ -442,7 +442,7 @@ like runperl( # This used to fail an assertion, but only as a standalone script is runperl(switches => ['-lXMfeature=:all'], prog => 'state sub x {}; undef &x; print defined &x', - stderr => 1), "\n", 'undefining state sub'; + stderr => 1), "Feature bundle \":all\" is deprecated and should not be used at -e line 0.\n\n", 'undefining state sub'; { state sub x { is +(caller 0)[3], 'x', 'state sub name in caller' } x @@ -475,7 +475,7 @@ is runperl(switches => ['-lXMfeature=:all'], x() } x()', - stderr => 1), "42\n", + stderr => 1), "Feature bundle \":all\" is deprecated and should not be used at -e line 0.\n42\n", 'closure behaviour of state sub in predeclared package sub'; # -------------------- my -------------------- # @@ -830,7 +830,7 @@ pass "pad taking ownership once more of packagified my-sub"; # This used to fail an assertion, but only as a standalone script is runperl(switches => ['-lXMfeature=:all'], prog => 'my sub x {}; undef &x; print defined &x', - stderr => 1), "\n", 'undefining my sub'; + stderr => 1), "Feature bundle \":all\" is deprecated and should not be used at -e line 0.\n\n", 'undefining my sub'; { my sub x { is +(caller 0)[3], 'x', 'my sub name in caller' } x