rustc_error_codes/lib.rs
1//! This library is used to gather all error codes into one place, to make
2//! their maintenance easier.
3
4// tidy-alphabetical-start
5#![deny(rustdoc::invalid_codeblock_attributes)]
6// tidy-alphabetical-end
7
8// This higher-order macro defines the error codes that are in use. It is used
9// in the `rustc_errors` crate. Removed error codes are listed in the comment
10// below.
11//
12// /!\ IMPORTANT /!\
13//
14// Error code explanation are defined in `error_codes/EXXXX.md` files. They must follow the RFC
15// 1567 available here:
16// https://rust-lang.github.io/rfcs/1567-long-error-codes-explanation-normalization.html
17//
18// Also, the contents of this macro is checked by tidy (in `check_error_codes_docs`). If you change
19// the macro syntax you will need to change tidy as well.
20//
21// Do *not* remove entries from this list. Instead, just add a note to the corresponding markdown
22// file saying that this error is not emitted by the compiler any more (see E0001.md for an
23// example), and remove all code examples that do not build any more by marking them
24// with `ignore (no longer emitted)`.
25#[macro_export]
26#[rustfmt::skip]
27macro_rules! error_codes {
28 ($macro:path) => (
29 $macro!(
300001,
310002,
320004,
330005,
340007,
350009,
360010,
370013,
380014,
390015,
400023,
410025,
420026,
430027,
440029,
450030,
460033,
470034,
480038,
490040,
500044,
510045,
520046,
530049,
540050,
550053,
560054,
570055,
580057,
590059,
600060,
610061,
620062,
630063,
640067,
650069,
660070,
670071,
680072,
690073,
700074,
710075,
720076,
730077,
740080,
750081,
760084,
770087,
780088,
790089,
800090,
810091,
820092,
830093,
840094,
850106,
860107,
870109,
880110,
890116,
900117,
910118,
920119,
930120,
940121,
950124,
960128,
970130,
980131,
990132,
1000133,
1010136,
1020137,
1030138,
1040139,
1050152,
1060154,
1070158,
1080161,
1090162,
1100164,
1110165,
1120170,
1130178,
1140183,
1150184,
1160185,
1170186,
1180191,
1190192,
1200193,
1210195,
1220197,
1230198,
1240199,
1250200,
1260201,
1270203,
1280204,
1290205,
1300206,
1310207,
1320208,
1330210,
1340211,
1350212,
1360214,
1370220,
1380221,
1390222,
1400223,
1410224,
1420225,
1430226,
1440227,
1450228,
1460229,
1470230,
1480231,
1490232,
1500243,
1510244,
1520251,
1530252,
1540253,
1550254,
1560255,
1570256,
1580259,
1590260,
1600261,
1610262,
1620263,
1630264,
1640267,
1650268,
1660271,
1670275,
1680276,
1690277,
1700281,
1710282,
1720283,
1730284,
1740297,
1750301,
1760302,
1770303,
1780307,
1790308,
1800309,
1810310,
1820311,
1830312,
1840316,
1850317,
1860320,
1870321,
1880322,
1890323,
1900324,
1910325,
1920326,
1930328,
1940329,
1950364,
1960365,
1970366,
1980367,
1990368,
2000369,
2010370,
2020371,
2030373,
2040374,
2050375,
2060376,
2070377,
2080378,
2090379,
2100380,
2110381,
2120382,
2130383,
2140384,
2150386,
2160387,
2170388,
2180389,
2190390,
2200391,
2210392,
2220393,
2230398,
2240399,
2250401,
2260403,
2270404,
2280405,
2290407,
2300408,
2310409,
2320411,
2330412,
2340415,
2350416,
2360422,
2370423,
2380424,
2390425,
2400426,
2410428,
2420429,
2430430,
2440431,
2450432,
2460433,
2470434,
2480435,
2490436,
2500437,
2510438,
2520439,
2530445,
2540446,
2550447,
2560448,
2570449,
2580451,
2590452,
2600453,
2610454,
2620455,
2630457,
2640458,
2650459,
2660460,
2670461,
2680462,
2690463,
2700464,
2710466,
2720468,
2730469,
2740472,
2750476,
2760477,
2770478,
2780482,
2790491,
2800492,
2810493,
2820495,
2830496,
2840497,
2850498,
2860499,
2870500,
2880501,
2890502,
2900503,
2910504,
2920505,
2930506,
2940507,
2950508,
2960509,
2970510,
2980511,
2990512,
3000514,
3010515,
3020516,
3030517,
3040518,
3050519,
3060520,
3070521,
3080522,
3090523,
3100524,
3110525,
3120527,
3130528,
3140529,
3150530,
3160531,
3170532,
3180533,
3190534,
3200535,
3210536,
3220537,
3230538,
3240539,
3250541,
3260542,
3270543,
3280544,
3290545,
3300546,
3310547,
3320549,
3330550,
3340551,
3350552,
3360554,
3370556, // REMOVED: merged with other attribute error codes
3380557,
3390559,
3400560,
3410561,
3420562,
3430565,
3440566,
3450567,
3460568,
3470569,
3480570,
3490571,
3500572,
3510573,
3520574,
3530575,
3540576,
3550577,
3560578,
3570579,
3580580,
3590581,
3600582,
3610583,
3620584,
3630585,
3640586,
3650587,
3660588,
3670589,
3680590,
3690591,
3700592,
3710593,
3720594,
3730595,
3740596,
3750597,
3760599,
3770600,
3780601,
3790602,
3800603,
3810604,
3820605,
3830606,
3840607,
3850608,
3860609,
3870610,
3880614,
3890615,
3900616,
3910617,
3920618,
3930619,
3940620,
3950621,
3960622, // REMOVED: rustc-intrinsic ABI was removed
3970623,
3980624,
3990625,
4000626,
4010627,
4020628,
4030631,
4040632,
4050633,
4060634,
4070635,
4080636,
4090637,
4100638,
4110639,
4120640,
4130641,
4140642,
4150643,
4160644,
4170646,
4180647,
4190648,
4200657,
4210658,
4220659,
4230660,
4240661,
4250662,
4260663,
4270664,
4280665,
4290666,
4300667,
4310668,
4320669,
4330670,
4340671,
4350687,
4360688,
4370689,
4380690,
4390691,
4400692,
4410693,
4420695,
4430696,
4440697,
4450698,
4460699, // REMOVED: merged into generic inference var error
4470700,
4480701,
4490703,
4500704,
4510705,
4520706,
4530708,
4540710,
4550712,
4560713,
4570714,
4580715,
4590716,
4600711,
4610717,
4620718,
4630719,
4640720,
4650722,
4660724,
4670725,
4680726,
4690727,
4700728,
4710729,
4720730,
4730731,
4740732,
4750733,
4760734,
4770735,
4780736,
4790737,
4800739,
4810740,
4820741,
4830742,
4840743,
4850744,
4860745,
4870746,
4880747,
4890748,
4900749,
4910750,
4920751,
4930752,
4940753,
4950754,
4960755,
4970756,
4980757,
4990758,
5000759,
5010760,
5020761,
5030762,
5040763,
5050764,
5060765,
5070766,
5080767,
5090768,
5100769,
5110770,
5120771,
5130772,
5140773, // REMOVED: no longer an error
5150774,
5160775,
5170776,
5180777,
5190778,
5200779,
5210780,
5220781,
5230782,
5240783,
5250784,
5260785,
5270786,
5280787,
5290788,
5300789,
5310790,
5320791,
5330792,
5340793,
5350794,
5360795,
5370796,
5380797,
5390798,
5400799,
5410800,
5420801,
5430802,
5440803,
5450804,
5460805,
5470806,
548 );
549 )
550}
551
552// Undocumented removed error codes. Note that many removed error codes are kept in the list above
553// and marked as no-longer emitted with a note in the markdown file (see E0001 for an example).
554// E0006, // merged with E0005
555// E0008, // cannot bind by-move into a pattern guard
556// E0019, // merged into E0015
557// E0035, // merged into E0087/E0089
558// E0036, // merged into E0087/E0089
559// E0068,
560// E0085,
561// E0086,
562// E0101, // replaced with E0282
563// E0102, // replaced with E0282
564// E0103,
565// E0104,
566// E0122, // bounds in type aliases are ignored, turned into proper lint
567// E0123,
568// E0127,
569// E0129,
570// E0134,
571// E0135,
572// E0141,
573// E0153, // unused error code
574// E0157, // unused error code
575// E0159, // use of trait `{}` as struct constructor
576// E0163, // merged into E0071
577// E0167,
578// E0168,
579// E0172, // non-trait found in a type sum, moved to resolve
580// E0173, // manual implementations of unboxed closure traits are experimental
581// E0174,
582// E0182, // merged into E0229
583// E0187, // cannot infer the kind of the closure
584// E0188, // can not cast an immutable reference to a mutable pointer
585// E0189, // deprecated: can only cast a boxed pointer to a boxed object
586// E0190, // deprecated: can only cast a &-pointer to an &-object
587// E0194, // merged into E0403
588// E0196, // cannot determine a type for this closure
589// E0209, // builtin traits can only be implemented on structs or enums
590// E0213, // associated types are not accepted in this context
591// E0215, // angle-bracket notation is not stable with `Fn`
592// E0216, // parenthetical notation is only stable with `Fn`
593// E0217, // ambiguous associated type, defined in multiple supertraits
594// E0218, // no associated type defined
595// E0219, // associated type defined in higher-ranked supertrait
596// E0233,
597// E0234,
598// E0235, // structure constructor specifies a structure of type but
599// E0236, // no lang item for range syntax
600// E0237, // no lang item for range syntax
601// E0238, // parenthesized parameters may only be used with a trait
602// E0239, // `next` method of `Iterator` trait has unexpected type
603// E0240,
604// E0241,
605// E0242,
606// E0245, // not a trait
607// E0246, // invalid recursive type
608// E0247,
609// E0248, // value used as a type, now reported earlier during resolution
610// // as E0412
611// E0249,
612// E0257,
613// E0258,
614// E0272, // on_unimplemented #0
615// E0273, // on_unimplemented #1
616// E0274, // on_unimplemented #2
617// E0278, // requirement is not satisfied
618// E0279,
619// E0280, // changed to ICE
620// E0285, // overflow evaluation builtin bounds
621// E0296, // replaced with a generic attribute input check
622// E0298, // cannot compare constants
623// E0299, // mismatched types between arms
624// E0300, // unexpanded macro
625// E0304, // expected signed integer constant
626// E0305, // expected constant
627// E0313, // removed: found unreachable
628// E0314, // closure outlives stack frame
629// E0315, // cannot invoke closure outside of its lifetime
630// E0319, // trait impls for defaulted traits allowed just for structs/enums
631// E0372, // coherence not dyn-compatible
632// E0385, // {} in an aliasable location
633// E0402, // cannot use an outer type parameter in this context
634// E0406, // merged into 420
635// E0410, // merged into 408
636// E0413, // merged into 530
637// E0414, // merged into 530
638// E0417, // merged into 532
639// E0418, // merged into 532
640// E0419, // merged into 531
641// E0420, // merged into 532
642// E0421, // merged into 531
643// E0427, // merged into 530
644// E0445, // merged into 446 and type privacy lints
645// E0456, // plugin `..` is not available for triple `..`
646// E0465, // removed: merged with E0464
647// E0467, // removed
648// E0470, // removed
649// E0471, // constant evaluation error (in pattern)
650// E0473, // dereference of reference outside its lifetime
651// E0474, // captured variable `..` does not outlive the enclosing closure
652// E0475, // index of slice outside its lifetime
653// E0479, // the type `..` (provided as the value of a type parameter) is...
654// E0480, // lifetime of method receiver does not outlive the method call
655// E0481, // lifetime of function argument does not outlive the function call
656// E0483, // lifetime of operand does not outlive the operation
657// E0484, // reference is not valid at the time of borrow
658// E0485, // automatically reference is not valid at the time of borrow
659// E0486, // type of expression contains references that are not valid during..
660// E0487, // unsafe use of destructor: destructor might be called while...
661// E0488, // lifetime of variable does not enclose its declaration
662// E0489, // type/lifetime parameter not in scope here
663// E0490, // removed: unreachable
664// E0526, // shuffle indices are not constant
665// E0540, // multiple rustc_deprecated attributes
666// E0548, // replaced with a generic attribute input check
667// E0553, // multiple rustc_const_unstable attributes
668// E0555, // replaced with a generic attribute input check
669// E0558, // replaced with a generic attribute input check
670// E0563, // cannot determine a type for this `impl Trait` removed in 6383de15
671// E0564, // only named lifetimes are allowed in `impl Trait`,
672// // but `{}` was found in the type `{}`
673// E0598, // lifetime of {} is too short to guarantee its contents can be...
674// E0611, // merged into E0616
675// E0612, // merged into E0609
676// E0613, // Removed (merged with E0609)
677// E0629, // missing 'feature' (rustc_const_unstable)
678// E0630, // rustc_const_unstable attribute must be paired with stable/unstable
679// // attribute
680// E0645, // trait aliases not finished
681// E0694, // an unknown tool name found in scoped attributes
682// E0702, // replaced with a generic attribute input check
683// E0707, // multiple elided lifetimes used in arguments of `async fn`
684// E0709, // multiple different lifetimes used in arguments of `async fn`
685// E0721, // `await` keyword
686// E0722, // replaced with a generic attribute input check
687// E0723, // unstable feature in `const` context
688// E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
689// E0744, // merged into E0728
690// E0776, // Removed; `#[cmse_nonsecure_entry]` is now `extern "cmse-nonsecure-entry"`
691// E0796, // unused error code. We use `static_mut_refs` lint instead.