blob: 2cdf320b8092fb52fa31f433a33aa108211ae109 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
error: dereferencing a reference to an uninhabited type would be undefined behavior
--> $DIR/uninhabited_references.rs:4:23
|
LL | fn ret_uninh_ref() -> &'static std::convert::Infallible {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::uninhabited-references` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::uninhabited_references)]`
error: dereferencing a reference to an uninhabited type would be undefined behavior
--> $DIR/uninhabited_references.rs:10:30
|
LL | fn $name(x: &$ty) -> &$ty {
| ^^^^
...
LL | ret_something!(id_never, !);
| --------------------------- in this macro invocation
|
= note: this error originates in the macro `ret_something` (in Nightly builds, run with -Z macro-backtrace for more info)
error: dereferencing a reference to an uninhabited type is undefined behavior
--> $DIR/uninhabited_references.rs:11:14
|
LL | &*x
| ^^
...
LL | ret_something!(id_never, !);
| --------------------------- in this macro invocation
|
= note: this error originates in the macro `ret_something` (in Nightly builds, run with -Z macro-backtrace for more info)
error: dereferencing a reference to an uninhabited type is undefined behavior
--> $DIR/uninhabited_references.rs:21:13
|
LL | let _ = *x;
| ^^
error: aborting due to 4 previous errors
|