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
Turn pointer_structural_match forward compat lint into normal lint
This commit removes the pointer_structural_match forward compat lint
from the forward compatibility warning mechanism, as there is no concrete
plan for removal of matching on function pointers.
It also turns the lint from allow-by-default to warn-by-default,
as the behaviour might be surprising to users and they should specifically
opt into the dangers.
As the lint is recognized on older compilers, users can easily allow it
after having made the descision on whether they want to keep it in their
code or not.
warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
2
-
--> $DIR/issue-44333.rs:19:9
2
+
--> $DIR/issue-44333.rs:17:9
3
3
|
4
4
LL | FOO => println!("foo"),
5
5
| ^^^
6
6
|
7
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8
-
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
9
-
note: the lint level is defined here
10
-
--> $DIR/issue-44333.rs:3:9
11
-
|
12
-
LL | #![warn(pointer_structural_match)]
13
-
| ^^^^^^^^^^^^^^^^^^^^^^^^
7
+
= note: `#[warn(pointer_structural_match)]` on by default
14
8
15
9
warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
16
-
--> $DIR/issue-44333.rs:21:9
10
+
--> $DIR/issue-44333.rs:18:9
17
11
|
18
12
LL | BAR => println!("bar"),
19
13
| ^^^
20
-
|
21
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
22
-
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
warning: function pointers and unsized pointers in patterns behave unpredictably and should not be relied upon. See https://github.com/rust-lang/rust/issues/70861 for details.
2
-
--> $DIR/issue-63479-match-fnptr.rs:35:7
2
+
--> $DIR/issue-63479-match-fnptr.rs:33:7
3
3
|
4
4
LL | B(TEST) => println!("matched"),
5
5
| ^^^^
6
6
|
7
-
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
8
-
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/70861>
9
-
note: the lint level is defined here
10
-
--> $DIR/issue-63479-match-fnptr.rs:8:9
11
-
|
12
-
LL | #![warn(pointer_structural_match)]
13
-
| ^^^^^^^^^^^^^^^^^^^^^^^^
7
+
= note: `#[warn(pointer_structural_match)]` on by default
0 commit comments