@@ -83,5 +83,77 @@ note: first possible panic found here
83
83
LL | assert_ne!(x, 0);
84
84
| ^^^^^^^^^^^^^^^^
85
85
86
- error: aborting due to 7 previous errors
86
+ error: docs for function which may panic missing `# Panics` section
87
+ --> $DIR/missing_panics_doc.rs:158:5
88
+ |
89
+ LL | pub fn option_unwrap<T>(v: &[T]) -> &T {
90
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91
+ |
92
+ note: first possible panic found here
93
+ --> $DIR/missing_panics_doc.rs:160:9
94
+ |
95
+ LL | o.unwrap()
96
+ | ^^^^^^^^^^
97
+
98
+ error: docs for function which may panic missing `# Panics` section
99
+ --> $DIR/missing_panics_doc.rs:163:5
100
+ |
101
+ LL | pub fn option_expect<T>(v: &[T]) -> &T {
102
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
103
+ |
104
+ note: first possible panic found here
105
+ --> $DIR/missing_panics_doc.rs:165:9
106
+ |
107
+ LL | o.expect("passed an empty thing")
108
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
109
+
110
+ error: docs for function which may panic missing `# Panics` section
111
+ --> $DIR/missing_panics_doc.rs:168:5
112
+ |
113
+ LL | pub fn result_unwrap<T>(v: &[T]) -> &T {
114
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
115
+ |
116
+ note: first possible panic found here
117
+ --> $DIR/missing_panics_doc.rs:170:9
118
+ |
119
+ LL | res.unwrap()
120
+ | ^^^^^^^^^^^^
121
+
122
+ error: docs for function which may panic missing `# Panics` section
123
+ --> $DIR/missing_panics_doc.rs:173:5
124
+ |
125
+ LL | pub fn result_expect<T>(v: &[T]) -> &T {
126
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
127
+ |
128
+ note: first possible panic found here
129
+ --> $DIR/missing_panics_doc.rs:175:9
130
+ |
131
+ LL | res.expect("passed an empty thing")
132
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
133
+
134
+ error: docs for function which may panic missing `# Panics` section
135
+ --> $DIR/missing_panics_doc.rs:178:5
136
+ |
137
+ LL | pub fn last_unwrap(v: &[u32]) -> u32 {
138
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139
+ |
140
+ note: first possible panic found here
141
+ --> $DIR/missing_panics_doc.rs:179:10
142
+ |
143
+ LL | *v.last().unwrap()
144
+ | ^^^^^^^^^^^^^^^^^
145
+
146
+ error: docs for function which may panic missing `# Panics` section
147
+ --> $DIR/missing_panics_doc.rs:182:5
148
+ |
149
+ LL | pub fn last_expect(v: &[u32]) -> u32 {
150
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
151
+ |
152
+ note: first possible panic found here
153
+ --> $DIR/missing_panics_doc.rs:183:10
154
+ |
155
+ LL | *v.last().expect("passed an empty thing")
156
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157
+
158
+ error: aborting due to 13 previous errors
87
159
0 commit comments