summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/missing_panics_doc.stderr
blob: c9ded7f1ad03e2296771cf9e16f9642ed228ef20 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
error: docs for function which may panic missing `# Panics` section
  --> $DIR/missing_panics_doc.rs:6:1
   |
LL | / pub fn unwrap() {
LL | |     let result = Err("Hi");
LL | |     result.unwrap()
LL | | }
   | |_^
   |
note: first possible panic found here
  --> $DIR/missing_panics_doc.rs:8:5
   |
LL |     result.unwrap()
   |     ^^^^^^^^^^^^^^^
   = note: `-D clippy::missing-panics-doc` implied by `-D warnings`

error: docs for function which may panic missing `# Panics` section
  --> $DIR/missing_panics_doc.rs:12:1
   |
LL | / pub fn panic() {
LL | |     panic!("This function panics")
LL | | }
   | |_^
   |
note: first possible panic found here
  --> $DIR/missing_panics_doc.rs:13:5
   |
LL |     panic!("This function panics")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> $DIR/missing_panics_doc.rs:17:1
   |
LL | / pub fn todo() {
LL | |     todo!()
LL | | }
   | |_^
   |
note: first possible panic found here
  --> $DIR/missing_panics_doc.rs:18:5
   |
LL |     todo!()
   |     ^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> $DIR/missing_panics_doc.rs:22:1
   |
LL | / pub fn inner_body(opt: Option<u32>) {
LL | |     opt.map(|x| {
LL | |         if x == 10 {
LL | |             panic!()
LL | |         }
LL | |     });
LL | | }
   | |_^
   |
note: first possible panic found here
  --> $DIR/missing_panics_doc.rs:25:13
   |
LL |             panic!()
   |             ^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> $DIR/missing_panics_doc.rs:31:1
   |
LL | / pub fn unreachable_and_panic() {
LL | |     if true { unreachable!() } else { panic!() }
LL | | }
   | |_^
   |
note: first possible panic found here
  --> $DIR/missing_panics_doc.rs:32:39
   |
LL |     if true { unreachable!() } else { panic!() }
   |                                       ^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> $DIR/missing_panics_doc.rs:36:1
   |
LL | / pub fn assert_eq() {
LL | |     let x = 0;
LL | |     assert_eq!(x, 0);
LL | | }
   | |_^
   |
note: first possible panic found here
  --> $DIR/missing_panics_doc.rs:38:5
   |
LL |     assert_eq!(x, 0);
   |     ^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> $DIR/missing_panics_doc.rs:42:1
   |
LL | / pub fn assert_ne() {
LL | |     let x = 0;
LL | |     assert_ne!(x, 0);
LL | | }
   | |_^
   |
note: first possible panic found here
  --> $DIR/missing_panics_doc.rs:44:5
   |
LL |     assert_ne!(x, 0);
   |     ^^^^^^^^^^^^^^^^

error: aborting due to 7 previous errors