@@ -64,7 +64,9 @@ E0004: r##"
64
64
This error indicates that the compiler cannot guarantee a matching pattern for
65
65
one or more possible inputs to a match expression. Guaranteed matches are
66
66
required in order to assign values to match expressions, or alternatively,
67
- determine the flow of execution. Erroneous code example:
67
+ determine the flow of execution.
68
+
69
+ Erroneous code example:
68
70
69
71
```compile_fail,E0004
70
72
enum Terminator {
@@ -109,7 +111,9 @@ match x {
109
111
110
112
E0005 : r##"
111
113
Patterns used to bind names must be irrefutable, that is, they must guarantee
112
- that a name will be extracted in all cases. Erroneous code example:
114
+ that a name will be extracted in all cases.
115
+
116
+ Erroneous code example:
113
117
114
118
```compile_fail,E0005
115
119
let x = Some(1);
@@ -145,6 +149,8 @@ like the following is invalid as it requires the entire `Option<String>` to be
145
149
moved into a variable called `op_string` while simultaneously requiring the
146
150
inner `String` to be moved into a variable called `s`.
147
151
152
+ Erroneous code example:
153
+
148
154
```compile_fail,E0007
149
155
let x = Some("s".to_string());
150
156
@@ -208,15 +214,128 @@ match x {
208
214
```
209
215
"## ,
210
216
217
+ E0010 : r##"
218
+ The value of statics and constants must be known at compile time, and they live
219
+ for the entire lifetime of a program. Creating a boxed value allocates memory on
220
+ the heap at runtime, and therefore cannot be done at compile time.
221
+
222
+ Erroneous code example:
223
+
224
+ ```compile_fail,E0010
225
+ const CON: Vec<i32> = vec![0]; // error!
226
+ ```
227
+ "## ,
228
+
229
+ E0013 : r##"
230
+ Static and const variables can refer to other const variables. But a const
231
+ variable cannot refer to a static variable.
232
+
233
+ Erroneous code example:
234
+
235
+ ```compile_fail,E0013
236
+ static X: i32 = 42;
237
+ const Y: i32 = X;
238
+ ```
239
+
240
+ In this example, `Y` cannot refer to `X` here. To fix this, the value can be
241
+ extracted as a const and then used:
242
+
243
+ ```
244
+ const A: i32 = 42;
245
+ static X: i32 = A;
246
+ const Y: i32 = A;
247
+ ```
248
+ "## ,
249
+
250
+ // FIXME(#57563) Change the language here when const fn stabilizes
251
+ E0015 : r##"
252
+ The only functions that can be called in static or constant expressions are
253
+ `const` functions, and struct/enum constructors. `const` functions are only
254
+ available on a nightly compiler. Rust currently does not support more general
255
+ compile-time function execution.
256
+
257
+ ```
258
+ const FOO: Option<u8> = Some(1); // enum constructor
259
+ struct Bar {x: u8}
260
+ const BAR: Bar = Bar {x: 1}; // struct constructor
261
+ ```
262
+
263
+ See [RFC 911] for more details on the design of `const fn`s.
264
+
265
+ [RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md
266
+ "## ,
267
+
268
+ E0017 : r##"
269
+ References in statics and constants may only refer to immutable values.
270
+
271
+ Erroneous code example:
272
+
273
+ ```compile_fail,E0017
274
+ static X: i32 = 1;
275
+ const C: i32 = 2;
276
+
277
+ // these three are not allowed:
278
+ const CR: &mut i32 = &mut C;
279
+ static STATIC_REF: &'static mut i32 = &mut X;
280
+ static CONST_REF: &'static mut i32 = &mut C;
281
+ ```
282
+
283
+ Statics are shared everywhere, and if they refer to mutable data one might
284
+ violate memory safety since holding multiple mutable references to shared data
285
+ is not allowed.
286
+
287
+ If you really want global mutable state, try using `static mut` or a global
288
+ `UnsafeCell`.
289
+ "## ,
290
+
291
+ E0019 : r##"
292
+ A function call isn't allowed in the const's initialization expression
293
+ because the expression's value must be known at compile-time.
294
+
295
+ Erroneous code example:
296
+
297
+ ```compile_fail,E0019
298
+ #![feature(box_syntax)]
299
+
300
+ fn main() {
301
+ struct MyOwned;
302
+
303
+ static STATIC11: Box<MyOwned> = box MyOwned; // error!
304
+ }
305
+ ```
306
+
307
+ Remember: you can't use a function call inside a const's initialization
308
+ expression! However, you can totally use it anywhere else:
309
+
310
+ ```
311
+ enum Test {
312
+ V1
313
+ }
314
+
315
+ impl Test {
316
+ fn func(&self) -> i32 {
317
+ 12
318
+ }
319
+ }
320
+
321
+ fn main() {
322
+ const FOO: Test = Test::V1;
323
+
324
+ FOO.func(); // here is good
325
+ let x = FOO.func(); // or even here!
326
+ }
327
+ ```
328
+ "## ,
329
+
211
330
E0030 : r##"
212
331
When matching against a range, the compiler verifies that the range is
213
- non-empty. Range patterns include both end-points, so this is equivalent to
332
+ non-empty. Range patterns include both end-points, so this is equivalent to
214
333
requiring the start of the range to be less than or equal to the end of the
215
334
range.
216
335
217
- For example:
336
+ Erroneous code example:
218
337
219
- ```compile_fail
338
+ ```compile_fail,E0030
220
339
match 5u32 {
221
340
// This range is ok, albeit pointless.
222
341
1 ..= 1 => {}
@@ -226,7 +345,61 @@ match 5u32 {
226
345
```
227
346
"## ,
228
347
348
+ E0133 : r##"
349
+ Unsafe code was used outside of an unsafe function or block.
350
+
351
+ Erroneous code example:
352
+
353
+ ```compile_fail,E0133
354
+ unsafe fn f() { return; } // This is the unsafe code
355
+
356
+ fn main() {
357
+ f(); // error: call to unsafe function requires unsafe function or block
358
+ }
359
+ ```
360
+
361
+ Using unsafe functionality is potentially dangerous and disallowed by safety
362
+ checks. Examples:
363
+
364
+ * Dereferencing raw pointers
365
+ * Calling functions via FFI
366
+ * Calling functions marked unsafe
367
+
368
+ These safety checks can be relaxed for a section of the code by wrapping the
369
+ unsafe instructions with an `unsafe` block. For instance:
370
+
371
+ ```
372
+ unsafe fn f() { return; }
373
+
374
+ fn main() {
375
+ unsafe { f(); } // ok!
376
+ }
377
+ ```
378
+
379
+ See also https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
380
+ "## ,
381
+
229
382
E0158 : r##"
383
+ An associated const has been referenced in a pattern.
384
+
385
+ Erroneous code example:
386
+
387
+ ```compile_fail,E0158
388
+ enum EFoo { A, B, C, D }
389
+
390
+ trait Foo {
391
+ const X: EFoo;
392
+ }
393
+
394
+ fn test<A: Foo>(arg: EFoo) {
395
+ match arg {
396
+ A::X => { // error!
397
+ println!("A::X");
398
+ }
399
+ }
400
+ }
401
+ ```
402
+
230
403
`const` and `static` mean different things. A `const` is a compile-time
231
404
constant, an alias for a literal value. This property means you can match it
232
405
directly within a pattern.
@@ -247,6 +420,39 @@ match Some(42) {
247
420
```
248
421
"## ,
249
422
423
+ E0161 : r##"
424
+ A value was moved. However, its size was not known at compile time, and only
425
+ values of a known size can be moved.
426
+
427
+ Erroneous code example:
428
+
429
+ ```compile_fail,E0161
430
+ #![feature(box_syntax)]
431
+
432
+ fn main() {
433
+ let array: &[isize] = &[1, 2, 3];
434
+ let _x: Box<[isize]> = box *array;
435
+ // error: cannot move a value of type [isize]: the size of [isize] cannot
436
+ // be statically determined
437
+ }
438
+ ```
439
+
440
+ In Rust, you can only move a value when its size is known at compile time.
441
+
442
+ To work around this restriction, consider "hiding" the value behind a reference:
443
+ either `&x` or `&mut x`. Since a reference has a fixed size, this lets you move
444
+ it around as usual. Example:
445
+
446
+ ```
447
+ #![feature(box_syntax)]
448
+
449
+ fn main() {
450
+ let array: &[isize] = &[1, 2, 3];
451
+ let _x: Box<&[isize]> = box array; // ok!
452
+ }
453
+ ```
454
+ "## ,
455
+
250
456
E0162 : r##"
251
457
#### Note: this error code is no longer emitted by the compiler.
252
458
@@ -468,158 +674,6 @@ The `op_string_ref` binding has type `&Option<&String>` in both cases.
468
674
See also https://github.com/rust-lang/rust/issues/14587
469
675
"## ,
470
676
471
- E0010 : r##"
472
- The value of statics and constants must be known at compile time, and they live
473
- for the entire lifetime of a program. Creating a boxed value allocates memory on
474
- the heap at runtime, and therefore cannot be done at compile time. Erroneous
475
- code example:
476
-
477
- ```compile_fail,E0010
478
- #![feature(box_syntax)]
479
-
480
- const CON : Box<i32> = box 0;
481
- ```
482
- "## ,
483
-
484
- E0013 : r##"
485
- Static and const variables can refer to other const variables. But a const
486
- variable cannot refer to a static variable. For example, `Y` cannot refer to
487
- `X` here:
488
-
489
- ```compile_fail,E0013
490
- static X: i32 = 42;
491
- const Y: i32 = X;
492
- ```
493
-
494
- To fix this, the value can be extracted as a const and then used:
495
-
496
- ```
497
- const A: i32 = 42;
498
- static X: i32 = A;
499
- const Y: i32 = A;
500
- ```
501
- "## ,
502
-
503
- // FIXME(#57563) Change the language here when const fn stabilizes
504
- E0015 : r##"
505
- The only functions that can be called in static or constant expressions are
506
- `const` functions, and struct/enum constructors. `const` functions are only
507
- available on a nightly compiler. Rust currently does not support more general
508
- compile-time function execution.
509
-
510
- ```
511
- const FOO: Option<u8> = Some(1); // enum constructor
512
- struct Bar {x: u8}
513
- const BAR: Bar = Bar {x: 1}; // struct constructor
514
- ```
515
-
516
- See [RFC 911] for more details on the design of `const fn`s.
517
-
518
- [RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md
519
- "## ,
520
-
521
- E0017 : r##"
522
- References in statics and constants may only refer to immutable values.
523
- Erroneous code example:
524
-
525
- ```compile_fail,E0017
526
- static X: i32 = 1;
527
- const C: i32 = 2;
528
-
529
- // these three are not allowed:
530
- const CR: &mut i32 = &mut C;
531
- static STATIC_REF: &'static mut i32 = &mut X;
532
- static CONST_REF: &'static mut i32 = &mut C;
533
- ```
534
-
535
- Statics are shared everywhere, and if they refer to mutable data one might
536
- violate memory safety since holding multiple mutable references to shared data
537
- is not allowed.
538
-
539
- If you really want global mutable state, try using `static mut` or a global
540
- `UnsafeCell`.
541
- "## ,
542
-
543
- E0019 : r##"
544
- A function call isn't allowed in the const's initialization expression
545
- because the expression's value must be known at compile-time. Erroneous code
546
- example:
547
-
548
- ```compile_fail
549
- enum Test {
550
- V1
551
- }
552
-
553
- impl Test {
554
- fn test(&self) -> i32 {
555
- 12
556
- }
557
- }
558
-
559
- fn main() {
560
- const FOO: Test = Test::V1;
561
-
562
- const A: i32 = FOO.test(); // You can't call Test::func() here!
563
- }
564
- ```
565
-
566
- Remember: you can't use a function call inside a const's initialization
567
- expression! However, you can totally use it anywhere else:
568
-
569
- ```
570
- enum Test {
571
- V1
572
- }
573
-
574
- impl Test {
575
- fn func(&self) -> i32 {
576
- 12
577
- }
578
- }
579
-
580
- fn main() {
581
- const FOO: Test = Test::V1;
582
-
583
- FOO.func(); // here is good
584
- let x = FOO.func(); // or even here!
585
- }
586
- ```
587
- "## ,
588
-
589
- E0133 : r##"
590
- Unsafe code was used outside of an unsafe function or block.
591
-
592
- Erroneous code example:
593
-
594
- ```compile_fail,E0133
595
- unsafe fn f() { return; } // This is the unsafe code
596
-
597
- fn main() {
598
- f(); // error: call to unsafe function requires unsafe function or block
599
- }
600
- ```
601
-
602
- Using unsafe functionality is potentially dangerous and disallowed by safety
603
- checks. Examples:
604
-
605
- * Dereferencing raw pointers
606
- * Calling functions via FFI
607
- * Calling functions marked unsafe
608
-
609
- These safety checks can be relaxed for a section of the code by wrapping the
610
- unsafe instructions with an `unsafe` block. For instance:
611
-
612
- ```
613
- unsafe fn f() { return; }
614
-
615
- fn main() {
616
- unsafe { f(); } // ok!
617
- }
618
- ```
619
-
620
- See also https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
621
- "## ,
622
-
623
677
E0373 : r##"
624
678
This error occurs when an attempt is made to use data captured by a closure,
625
679
when that data may no longer exist. It's most commonly seen when attempting to
@@ -672,7 +726,9 @@ about safety.
672
726
"## ,
673
727
674
728
E0381 : r##"
675
- It is not allowed to use or capture an uninitialized variable. For example:
729
+ It is not allowed to use or capture an uninitialized variable.
730
+
731
+ Erroneous code example:
676
732
677
733
```compile_fail,E0381
678
734
fn main() {
@@ -694,7 +750,9 @@ fn main() {
694
750
695
751
E0382 : r##"
696
752
This error occurs when an attempt is made to use a variable after its contents
697
- have been moved elsewhere. For example:
753
+ have been moved elsewhere.
754
+
755
+ Erroneous code example:
698
756
699
757
```compile_fail,E0382
700
758
struct MyStruct { s: u32 }
@@ -842,7 +900,8 @@ x = Foo { a: 2 };
842
900
843
901
E0384 : r##"
844
902
This error occurs when an attempt is made to reassign an immutable variable.
845
- For example:
903
+
904
+ Erroneous code example:
846
905
847
906
```compile_fail,E0384
848
907
fn main() {
@@ -862,13 +921,15 @@ fn main() {
862
921
```
863
922
"## ,
864
923
865
- /*E0386: r##"
924
+ E0386 : r##"
925
+ #### Note: this error code is no longer emitted by the compiler.
926
+
866
927
This error occurs when an attempt is made to mutate the target of a mutable
867
928
reference stored inside an immutable container.
868
929
869
930
For example, this can happen when storing a `&mut` inside an immutable `Box`:
870
931
871
- ```compile_fail,E0386
932
+ ```
872
933
let mut x: i64 = 1;
873
934
let y: Box<_> = Box::new(&mut x);
874
935
**y = 2; // error, cannot assign to data in an immutable container
@@ -892,13 +953,15 @@ let x: i64 = 1;
892
953
let y: Box<Cell<_>> = Box::new(Cell::new(x));
893
954
y.set(2);
894
955
```
895
- "##,*/
956
+ "## ,
896
957
897
958
E0387 : r##"
898
959
#### Note: this error code is no longer emitted by the compiler.
899
960
900
961
This error occurs when an attempt is made to mutate or mutably reference data
901
- that a closure has captured immutably. Examples of this error are shown below:
962
+ that a closure has captured immutably.
963
+
964
+ Erroneous code example:
902
965
903
966
```compile_fail
904
967
// Accepts a function or a closure that captures its environment immutably.
@@ -963,7 +1026,7 @@ An attempt was made to mutate data using a non-mutable reference. This
963
1026
commonly occurs when attempting to assign to a non-mutable reference of a
964
1027
mutable reference (`&(&mut T)`).
965
1028
966
- Example of erroneous code:
1029
+ Erroneous code example :
967
1030
968
1031
```compile_fail
969
1032
struct FancyNum {
@@ -1022,43 +1085,11 @@ fn main() {
1022
1085
```
1023
1086
"## ,
1024
1087
1025
- E0161 : r##"
1026
- A value was moved. However, its size was not known at compile time, and only
1027
- values of a known size can be moved.
1088
+ E0492 : r##"
1089
+ A borrow of a constant containing interior mutability was attempted.
1028
1090
1029
1091
Erroneous code example:
1030
1092
1031
- ```compile_fail
1032
- #![feature(box_syntax)]
1033
-
1034
- fn main() {
1035
- let array: &[isize] = &[1, 2, 3];
1036
- let _x: Box<[isize]> = box *array;
1037
- // error: cannot move a value of type [isize]: the size of [isize] cannot
1038
- // be statically determined
1039
- }
1040
- ```
1041
-
1042
- In Rust, you can only move a value when its size is known at compile time.
1043
-
1044
- To work around this restriction, consider "hiding" the value behind a reference:
1045
- either `&x` or `&mut x`. Since a reference has a fixed size, this lets you move
1046
- it around as usual. Example:
1047
-
1048
- ```
1049
- #![feature(box_syntax)]
1050
-
1051
- fn main() {
1052
- let array: &[isize] = &[1, 2, 3];
1053
- let _x: Box<&[isize]> = box array; // ok!
1054
- }
1055
- ```
1056
- "## ,
1057
-
1058
- E0492 : r##"
1059
- A borrow of a constant containing interior mutability was attempted. Erroneous
1060
- code example:
1061
-
1062
1093
```compile_fail,E0492
1063
1094
use std::sync::atomic::AtomicUsize;
1064
1095
@@ -1174,7 +1205,9 @@ static FOO: Foo = Foo { field1: DropType::A }; // We initialize all fields
1174
1205
"## ,
1175
1206
1176
1207
E0499 : r##"
1177
- A variable was borrowed as mutable more than once. Erroneous code example:
1208
+ A variable was borrowed as mutable more than once.
1209
+
1210
+ Erroneous code example:
1178
1211
1179
1212
```compile_fail,E0499
1180
1213
let mut i = 0;
1205
1238
"## ,
1206
1239
1207
1240
E0500 : r##"
1208
- A borrowed variable was used by a closure. Example of erroneous code:
1241
+ A borrowed variable was used by a closure.
1242
+
1243
+ Erroneous code example:
1209
1244
1210
1245
```compile_fail,E0500
1211
1246
fn you_know_nothing(jon_snow: &mut i32) {
@@ -1256,7 +1291,7 @@ situation, the closure is borrowing the variable. Take a look at
1256
1291
http://rustbyexample.com/fn/closures/capture.html for more information about
1257
1292
capturing.
1258
1293
1259
- Example of erroneous code:
1294
+ Erroneous code example :
1260
1295
1261
1296
```compile_fail,E0501
1262
1297
fn inside_closure(x: &mut i32) {
@@ -1329,7 +1364,7 @@ E0502: r##"
1329
1364
This error indicates that you are trying to borrow a variable as mutable when it
1330
1365
has already been borrowed as immutable.
1331
1366
1332
- Example of erroneous code:
1367
+ Erroneous code example :
1333
1368
1334
1369
```compile_fail,E0502
1335
1370
fn bar(x: &mut i32) {}
@@ -1360,7 +1395,7 @@ https://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html.
1360
1395
E0503 : r##"
1361
1396
A value was used after it was mutably borrowed.
1362
1397
1363
- Example of erroneous code:
1398
+ Erroneous code example :
1364
1399
1365
1400
```compile_fail,E0503
1366
1401
fn main() {
@@ -1418,7 +1453,7 @@ E0504: r##"
1418
1453
This error occurs when an attempt is made to move a borrowed variable into a
1419
1454
closure.
1420
1455
1421
- Example of erroneous code:
1456
+ Erroneous code example :
1422
1457
1423
1458
```compile_fail
1424
1459
struct FancyNum {
@@ -1609,7 +1644,7 @@ http://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html
1609
1644
E0506 : r##"
1610
1645
This error occurs when an attempt is made to assign to a borrowed value.
1611
1646
1612
- Example of erroneous code:
1647
+ Erroneous code example :
1613
1648
1614
1649
```compile_fail,E0506
1615
1650
struct FancyNum {
@@ -1827,7 +1862,7 @@ http://doc.rust-lang.org/book/ch04-02-references-and-borrowing.html
1827
1862
E0508 : r##"
1828
1863
A value was moved out of a non-copy fixed-size array.
1829
1864
1830
- Example of erroneous code:
1865
+ Erroneous code example :
1831
1866
1832
1867
```compile_fail,E0508
1833
1868
struct NonCopy;
@@ -1872,7 +1907,7 @@ E0509: r##"
1872
1907
This error occurs when an attempt is made to move out of a value whose type
1873
1908
implements the `Drop` trait.
1874
1909
1875
- Example of erroneous code:
1910
+ Erroneous code example :
1876
1911
1877
1912
```compile_fail,E0509
1878
1913
struct FancyNum {
@@ -1982,30 +2017,14 @@ Here executing `x = None` would modify the value being matched and require us
1982
2017
to go "back in time" to the `None` arm.
1983
2018
"## ,
1984
2019
1985
- E0579 : r##"
1986
- When matching against an exclusive range, the compiler verifies that the range
1987
- is non-empty. Exclusive range patterns include the start point but not the end
1988
- point, so this is equivalent to requiring the start of the range to be less
1989
- than the end of the range.
1990
-
1991
- For example:
1992
-
1993
- ```compile_fail
1994
- match 5u32 {
1995
- // This range is ok, albeit pointless.
1996
- 1 .. 2 => {}
1997
- // This range is empty, and the compiler can tell.
1998
- 5 .. 5 => {}
1999
- }
2000
- ```
2001
- "## ,
2002
-
2003
2020
E0515 : r##"
2004
2021
Cannot return value that references local variable
2005
2022
2006
2023
Local variables, function parameters and temporaries are all dropped before the
2007
2024
end of the function body. So a reference to them cannot be returned.
2008
2025
2026
+ Erroneous code example:
2027
+
2009
2028
```compile_fail,E0515
2010
2029
fn get_dangling_reference() -> &'static i32 {
2011
2030
let x = 0;
@@ -2101,6 +2120,28 @@ fn dragoooon(x: &mut isize) {
2101
2120
```
2102
2121
"## ,
2103
2122
2123
+ E0579 : r##"
2124
+ When matching against an exclusive range, the compiler verifies that the range
2125
+ is non-empty. Exclusive range patterns include the start point but not the end
2126
+ point, so this is equivalent to requiring the start of the range to be less
2127
+ than the end of the range.
2128
+
2129
+ Erroneous code example:
2130
+
2131
+ ```compile_fail,E0579
2132
+ #![feature(exclusive_range_pattern)]
2133
+
2134
+ fn main() {
2135
+ match 5u32 {
2136
+ // This range is ok, albeit pointless.
2137
+ 1 .. 2 => {}
2138
+ // This range is empty, and the compiler can tell.
2139
+ 5 .. 5 => {} // error!
2140
+ }
2141
+ }
2142
+ ```
2143
+ "## ,
2144
+
2104
2145
E0595 : r##"
2105
2146
#### Note: this error code is no longer emitted by the compiler.
2106
2147
@@ -2124,7 +2165,7 @@ let mut c = || { x += 1 };
2124
2165
E0596 : r##"
2125
2166
This error occurs because you tried to mutably borrow a non-mutable variable.
2126
2167
2127
- Example of erroneous code:
2168
+ Erroneous code example :
2128
2169
2129
2170
```compile_fail,E0596
2130
2171
let x = 1;
@@ -2143,7 +2184,7 @@ let y = &mut x; // ok!
2143
2184
E0597 : r##"
2144
2185
This error occurs because a value was dropped while it was still borrowed
2145
2186
2146
- Example of erroneous code:
2187
+ Erroneous code example :
2147
2188
2148
2189
```compile_fail,E0597
2149
2190
struct Foo<'a> {
@@ -2180,6 +2221,8 @@ E0626: r##"
2180
2221
This error occurs because a borrow in a generator persists across a
2181
2222
yield point.
2182
2223
2224
+ Erroneous code example:
2225
+
2183
2226
```compile_fail,E0626
2184
2227
# #![feature(generators, generator_trait, pin)]
2185
2228
# use std::ops::Generator;
@@ -2271,7 +2314,7 @@ E0712: r##"
2271
2314
This error occurs because a borrow of a thread-local variable was made inside a
2272
2315
function which outlived the lifetime of the function.
2273
2316
2274
- Example of erroneous code:
2317
+ Erroneous code example :
2275
2318
2276
2319
```compile_fail,E0712
2277
2320
#![feature(thread_local)]
@@ -2293,7 +2336,7 @@ E0713: r##"
2293
2336
This error occurs when an attempt is made to borrow state past the end of the
2294
2337
lifetime of a type that implements the `Drop` trait.
2295
2338
2296
- Example of erroneous code:
2339
+ Erroneous code example :
2297
2340
2298
2341
```compile_fail,E0713
2299
2342
#![feature(nll)]
0 commit comments