summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/ext/attributes/attributes.pm
diff options
context:
space:
mode:
authorafresh1 <afresh1@openbsd.org>2019-02-13 21:15:00 +0000
committerafresh1 <afresh1@openbsd.org>2019-02-13 21:15:00 +0000
commit9f11ffb7133c203312a01e4b986886bc88c7d74b (patch)
tree6618511204c614b20256e4ef9dea39a7b311d638 /gnu/usr.bin/perl/ext/attributes/attributes.pm
parentImport perl-5.28.1 (diff)
downloadwireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.tar.xz
wireguard-openbsd-9f11ffb7133c203312a01e4b986886bc88c7d74b.zip
Fix merge issues, remove excess files - match perl-5.28.1 dist
looking good sthen@, Great! bluhm@
Diffstat (limited to 'gnu/usr.bin/perl/ext/attributes/attributes.pm')
-rw-r--r--gnu/usr.bin/perl/ext/attributes/attributes.pm24
1 files changed, 6 insertions, 18 deletions
diff --git a/gnu/usr.bin/perl/ext/attributes/attributes.pm b/gnu/usr.bin/perl/ext/attributes/attributes.pm
index f7af31b7b4c..c60f9406b99 100644
--- a/gnu/usr.bin/perl/ext/attributes/attributes.pm
+++ b/gnu/usr.bin/perl/ext/attributes/attributes.pm
@@ -1,6 +1,6 @@
package attributes;
-our $VERSION = 0.27;
+our $VERSION = 0.33;
@EXPORT_OK = qw(get reftype);
@EXPORT = ();
@@ -18,10 +18,9 @@ sub carp {
goto &Carp::carp;
}
+# Hash of SV type (CODE, SCALAR, etc.) to regex matching deprecated
+# attributes for that type.
my %deprecated;
-$deprecated{CODE} = qr/\A-?(locked)\z/;
-$deprecated{ARRAY} = $deprecated{HASH} = $deprecated{SCALAR}
- = qr/\A-?(unique)\z/;
my %msg = (
lvalue => 'lvalue attribute applied to already-defined subroutine',
@@ -31,14 +30,15 @@ my %msg = (
sub _modify_attrs_and_deprecate {
my $svtype = shift;
- # Now that we've removed handling of locked from the XS code, we need to
+ # After we've removed a deprecated attribute from the XS code, we need to
# remove it here, else it ends up in @badattrs. (If we do the deprecation in
# XS, we can't control the warning based on *our* caller's lexical settings,
# and the warned line is in this package)
grep {
$deprecated{$svtype} && /$deprecated{$svtype}/ ? do {
require warnings;
- warnings::warnif('deprecated', "Attribute \"$1\" is deprecated");
+ warnings::warnif('deprecated', "Attribute \"$1\" is deprecated, " .
+ "and will disappear in Perl 5.28");
0;
} : $svtype eq 'CODE' && exists $msg{$_} ? do {
require warnings;
@@ -255,11 +255,6 @@ C<sub foo($$) : prototype(@) {}> is indistinguishable from C<sub foo(@){}>.
If illegalproto warnings are enabled, the prototype declared inside this
attribute will be sanity checked at compile time.
-=item locked
-
-The "locked" attribute is deprecated, and has no effect in 5.10.0 and later.
-It was used as part of the now-removed "Perl 5.005 threads".
-
=item const
This experimental attribute, introduced in Perl 5.22, only applies to
@@ -278,13 +273,6 @@ The following are the built-in attributes for variables:
Indicates that the referenced variable can be shared across different threads
when used in conjunction with the L<threads> and L<threads::shared> modules.
-=item unique
-
-The "unique" attribute is deprecated, and has no effect in 5.10.0 and later.
-It used to indicate that a single copy of an C<our> variable was to be used by
-all interpreters should the program happen to be running in a
-multi-interpreter environment.
-
=back
=head2 Available Subroutines