summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/missing_panics_doc.stderr
blob: 7f0acf8de9b771bfe004384e6f290df4de2e7f79 (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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:13:1
   |
LL | pub fn unwrap() {
   | ^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:16:5
   |
LL |     result.unwrap()
   |     ^^^^^^^^^^^^^^^
   = note: `-D clippy::missing-panics-doc` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::missing_panics_doc)]`

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:20:1
   |
LL | pub fn panic() {
   | ^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:22:5
   |
LL |     panic!("This function panics")
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:26:1
   |
LL | pub fn inner_body(opt: Option<u32>) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:30:13
   |
LL |             panic!()
   |             ^^^^^^^^

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

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:42:1
   |
LL | pub fn assert_eq() {
   | ^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:45:5
   |
LL |     assert_eq!(x, 0);
   |     ^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:49:1
   |
LL | pub fn assert_ne() {
   | ^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:52:5
   |
LL |     assert_ne!(x, 0);
   |     ^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:154:1
   |
LL | pub fn partially_const<const N: usize>(n: usize) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:161:5
   |
LL |     assert!(N > n);
   |     ^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:172:1
   |
LL | pub fn expect_allow_with_error(i: Option<isize>) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:181:5
   |
LL |     i.unwrap();
   |     ^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:184:1
   |
LL | pub fn expect_after_error(x: Option<u32>, y: Option<u32>) {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:187:13
   |
LL |     let x = x.unwrap();
   |             ^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:196:5
   |
LL |     pub fn option_unwrap<T>(v: &[T]) -> &T {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:199:9
   |
LL |         o.unwrap()
   |         ^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:202:5
   |
LL |     pub fn option_expect<T>(v: &[T]) -> &T {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:205:9
   |
LL |         o.expect("passed an empty thing")
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:208:5
   |
LL |     pub fn result_unwrap<T>(v: &[T]) -> &T {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:211:9
   |
LL |         res.unwrap()
   |         ^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:214:5
   |
LL |     pub fn result_expect<T>(v: &[T]) -> &T {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:217:9
   |
LL |         res.expect("passed an empty thing")
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:220:5
   |
LL |     pub fn last_unwrap(v: &[u32]) -> u32 {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:222:10
   |
LL |         *v.last().unwrap()
   |          ^^^^^^^^^^^^^^^^^

error: docs for function which may panic missing `# Panics` section
  --> tests/ui/missing_panics_doc.rs:225:5
   |
LL |     pub fn last_expect(v: &[u32]) -> u32 {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: first possible panic found here
  --> tests/ui/missing_panics_doc.rs:227:10
   |
LL |         *v.last().expect("passed an empty thing")
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 15 previous errors