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.
24#[macro_export]
25#[rustfmt::skip]
26macro_rules! error_codes {
27    ($macro:path) => (
28        $macro!(
290001,
300002,
310004,
320005,
330007,
340009,
350010,
360013,
370014,
380015,
390023,
400025,
410026,
420027,
430029,
440030,
450033,
460034,
470038,
480040,
490044,
500045,
510046,
520049,
530050,
540053,
550054,
560055,
570057,
580059,
590060,
600061,
610062,
620063,
630067,
640069,
650070,
660071,
670072,
680073,
690074,
700075,
710076,
720077,
730080,
740081,
750084,
760087,
770088,
780089,
790090,
800091,
810092,
820093,
830094,
840106,
850107,
860109,
870110,
880116,
890117,
900118,
910119,
920120,
930121,
940124,
950128,
960130,
970131,
980132,
990133,
1000136,
1010137,
1020138,
1030139,
1040152,
1050154,
1060158,
1070161,
1080162,
1090164,
1100165,
1110170,
1120178,
1130183,
1140184,
1150185,
1160186,
1170191,
1180192,
1190193,
1200195,
1210197,
1220198,
1230199,
1240200,
1250201,
1260203,
1270204,
1280205,
1290206,
1300207,
1310208,
1320210,
1330211,
1340212,
1350214,
1360220,
1370221,
1380222,
1390223,
1400224,
1410225,
1420226,
1430227,
1440228,
1450229,
1460230,
1470231,
1480232,
1490243,
1500244,
1510251,
1520252,
1530253,
1540254,
1550255,
1560256,
1570259,
1580260,
1590261,
1600262,
1610263,
1620264,
1630267,
1640268,
1650271,
1660275,
1670276,
1680277,
1690281,
1700282,
1710283,
1720284,
1730297,
1740301,
1750302,
1760303,
1770307,
1780308,
1790309,
1800310,
1810311,
1820312,
1830316,
1840317,
1850320,
1860321,
1870322,
1880323,
1890324,
1900325,
1910326,
1920328,
1930329,
1940364,
1950365,
1960366,
1970367,
1980368,
1990369,
2000370,
2010371,
2020373,
2030374,
2040375,
2050376,
2060377,
2070378,
2080379,
2090380,
2100381,
2110382,
2120383,
2130384,
2140386,
2150387,
2160388,
2170389,
2180390,
2190391,
2200392,
2210393,
2220398,
2230399,
2240401,
2250403,
2260404,
2270405,
2280407,
2290408,
2300409,
2310411,
2320412,
2330415,
2340416,
2350422,
2360423,
2370424,
2380425,
2390426,
2400428,
2410429,
2420430,
2430431,
2440432,
2450433,
2460434,
2470435,
2480436,
2490437,
2500438,
2510439,
2520445,
2530446,
2540447,
2550448,
2560449,
2570451,
2580452,
2590453,
2600454,
2610455,
2620457,
2630458,
2640459,
2650460,
2660461,
2670462,
2680463,
2690464,
2700466,
2710468,
2720469,
2730472,
2740476,
2750477,
2760478,
2770482,
2780491,
2790492,
2800493,
2810495,
2820496,
2830497,
2840498,
2850499,
2860500,
2870501,
2880502,
2890503,
2900504,
2910505,
2920506,
2930507,
2940508,
2950509,
2960510,
2970511,
2980512,
2990514,
3000515,
3010516,
3020517,
3030518,
3040519,
3050520,
3060521,
3070522,
3080523,
3090524,
3100525,
3110527,
3120528,
3130529,
3140530,
3150531,
3160532,
3170533,
3180534,
3190535,
3200536,
3210537,
3220538,
3230539,
3240541,
3250542,
3260543,
3270544,
3280545,
3290546,
3300547,
3310549,
3320550,
3330551,
3340552,
3350554,
3360556,
3370557,
3380559,
3390560,
3400561,
3410562,
3420565,
3430566,
3440567,
3450568,
3460569,
3470570,
3480571,
3490572,
3500573,
3510574,
3520575,
3530576,
3540577,
3550578,
3560579,
3570580,
3580581,
3590582,
3600583,
3610584,
3620585,
3630586,
3640587,
3650588,
3660589,
3670590,
3680591,
3690592,
3700593,
3710594,
3720595,
3730596,
3740597,
3750599,
3760600,
3770601,
3780602,
3790603,
3800604,
3810605,
3820606,
3830607,
3840608,
3850609,
3860610,
3870614,
3880615,
3890616,
3900617,
3910618,
3920619,
3930620,
3940621,
3950622, // REMOVED: rustc-intrinsic ABI was removed
3960623,
3970624,
3980625,
3990626,
4000627,
4010628,
4020631,
4030632,
4040633,
4050634,
4060635,
4070636,
4080637,
4090638,
4100639,
4110640,
4120641,
4130642,
4140643,
4150644,
4160646,
4170647,
4180648,
4190657,
4200658,
4210659,
4220660,
4230661,
4240662,
4250663,
4260664,
4270665,
4280666,
4290667,
4300668,
4310669,
4320670,
4330671,
4340687,
4350688,
4360689,
4370690,
4380691,
4390692,
4400693,
4410695,
4420696,
4430697,
4440698,
4450699, // REMOVED: merged into generic inference var error
4460700,
4470701,
4480703,
4490704,
4500705,
4510706,
4520708,
4530710,
4540712,
4550713,
4560714,
4570715,
4580716,
4590711,
4600717,
4610718,
4620719,
4630720,
4640722,
4650724,
4660725,
4670726,
4680727,
4690728,
4700729,
4710730,
4720731,
4730732,
4740733,
4750734,
4760735,
4770736,
4780737,
4790739,
4800740,
4810741,
4820742,
4830743,
4840744,
4850745,
4860746,
4870747,
4880748,
4890749,
4900750,
4910751,
4920752,
4930753,
4940754,
4950755,
4960756,
4970757,
4980758,
4990759,
5000760,
5010761,
5020762,
5030763,
5040764,
5050765,
5060766,
5070767,
5080768,
5090769,
5100770,
5110771,
5120772,
5130773, // REMOVED: no longer an error
5140774,
5150775,
5160776,
5170777,
5180778,
5190779,
5200780,
5210781,
5220782,
5230783,
5240784,
5250785,
5260786,
5270787,
5280788,
5290789,
5300790,
5310791,
5320792,
5330793,
5340794,
5350795,
5360796,
5370797,
5380798,
5390799,
5400800,
5410801,
5420802,
5430803,
5440804,
5450805,
5460806,
547        );
548    )
549}
550
551// Undocumented removed error codes. Note that many removed error codes are kept in the list above
552// and marked as no-longer emitted with a note in the markdown file (see E0001 for an example).
553//  E0006, // merged with E0005
554//  E0008, // cannot bind by-move into a pattern guard
555//  E0019, // merged into E0015
556//  E0035, // merged into E0087/E0089
557//  E0036, // merged into E0087/E0089
558//  E0068,
559//  E0085,
560//  E0086,
561//  E0101, // replaced with E0282
562//  E0102, // replaced with E0282
563//  E0103,
564//  E0104,
565//  E0122, // bounds in type aliases are ignored, turned into proper lint
566//  E0123,
567//  E0127,
568//  E0129,
569//  E0134,
570//  E0135,
571//  E0141,
572//  E0153, // unused error code
573//  E0157, // unused error code
574//  E0159, // use of trait `{}` as struct constructor
575//  E0163, // merged into E0071
576//  E0167,
577//  E0168,
578//  E0172, // non-trait found in a type sum, moved to resolve
579//  E0173, // manual implementations of unboxed closure traits are experimental
580//  E0174,
581//  E0182, // merged into E0229
582//  E0187, // cannot infer the kind of the closure
583//  E0188, // can not cast an immutable reference to a mutable pointer
584//  E0189, // deprecated: can only cast a boxed pointer to a boxed object
585//  E0190, // deprecated: can only cast a &-pointer to an &-object
586//  E0194, // merged into E0403
587//  E0196, // cannot determine a type for this closure
588//  E0209, // builtin traits can only be implemented on structs or enums
589//  E0213, // associated types are not accepted in this context
590//  E0215, // angle-bracket notation is not stable with `Fn`
591//  E0216, // parenthetical notation is only stable with `Fn`
592//  E0217, // ambiguous associated type, defined in multiple supertraits
593//  E0218, // no associated type defined
594//  E0219, // associated type defined in higher-ranked supertrait
595//  E0233,
596//  E0234,
597//  E0235, // structure constructor specifies a structure of type but
598//  E0236, // no lang item for range syntax
599//  E0237, // no lang item for range syntax
600//  E0238, // parenthesized parameters may only be used with a trait
601//  E0239, // `next` method of `Iterator` trait has unexpected type
602//  E0240,
603//  E0241,
604//  E0242,
605//  E0245, // not a trait
606//  E0246, // invalid recursive type
607//  E0247,
608//  E0248, // value used as a type, now reported earlier during resolution
609//         // as E0412
610//  E0249,
611//  E0257,
612//  E0258,
613//  E0272, // on_unimplemented #0
614//  E0273, // on_unimplemented #1
615//  E0274, // on_unimplemented #2
616//  E0278, // requirement is not satisfied
617//  E0279,
618//  E0280, // changed to ICE
619//  E0285, // overflow evaluation builtin bounds
620//  E0296, // replaced with a generic attribute input check
621//  E0298, // cannot compare constants
622//  E0299, // mismatched types between arms
623//  E0300, // unexpanded macro
624//  E0304, // expected signed integer constant
625//  E0305, // expected constant
626//  E0313, // removed: found unreachable
627//  E0314, // closure outlives stack frame
628//  E0315, // cannot invoke closure outside of its lifetime
629//  E0319, // trait impls for defaulted traits allowed just for structs/enums
630//  E0372, // coherence not dyn-compatible
631//  E0385, // {} in an aliasable location
632//  E0402, // cannot use an outer type parameter in this context
633//  E0406, // merged into 420
634//  E0410, // merged into 408
635//  E0413, // merged into 530
636//  E0414, // merged into 530
637//  E0417, // merged into 532
638//  E0418, // merged into 532
639//  E0419, // merged into 531
640//  E0420, // merged into 532
641//  E0421, // merged into 531
642//  E0427, // merged into 530
643//  E0445, // merged into 446 and type privacy lints
644//  E0456, // plugin `..` is not available for triple `..`
645//  E0465, // removed: merged with E0464
646//  E0467, // removed
647//  E0470, // removed
648//  E0471, // constant evaluation error (in pattern)
649//  E0473, // dereference of reference outside its lifetime
650//  E0474, // captured variable `..` does not outlive the enclosing closure
651//  E0475, // index of slice outside its lifetime
652//  E0479, // the type `..` (provided as the value of a type parameter) is...
653//  E0480, // lifetime of method receiver does not outlive the method call
654//  E0481, // lifetime of function argument does not outlive the function call
655//  E0483, // lifetime of operand does not outlive the operation
656//  E0484, // reference is not valid at the time of borrow
657//  E0485, // automatically reference is not valid at the time of borrow
658//  E0486, // type of expression contains references that are not valid during..
659//  E0487, // unsafe use of destructor: destructor might be called while...
660//  E0488, // lifetime of variable does not enclose its declaration
661//  E0489, // type/lifetime parameter not in scope here
662//  E0490, // removed: unreachable
663//  E0526, // shuffle indices are not constant
664//  E0540, // multiple rustc_deprecated attributes
665//  E0548, // replaced with a generic attribute input check
666//  E0553, // multiple rustc_const_unstable attributes
667//  E0555, // replaced with a generic attribute input check
668//  E0558, // replaced with a generic attribute input check
669//  E0563, // cannot determine a type for this `impl Trait` removed in 6383de15
670//  E0564, // only named lifetimes are allowed in `impl Trait`,
671//         // but `{}` was found in the type `{}`
672//  E0598, // lifetime of {} is too short to guarantee its contents can be...
673//  E0611, // merged into E0616
674//  E0612, // merged into E0609
675//  E0613, // Removed (merged with E0609)
676//  E0629, // missing 'feature' (rustc_const_unstable)
677//  E0630, // rustc_const_unstable attribute must be paired with stable/unstable
678//         // attribute
679//  E0645, // trait aliases not finished
680//  E0694, // an unknown tool name found in scoped attributes
681//  E0702, // replaced with a generic attribute input check
682//  E0707, // multiple elided lifetimes used in arguments of `async fn`
683//  E0709, // multiple different lifetimes used in arguments of `async fn`
684//  E0721, // `await` keyword
685//  E0722, // replaced with a generic attribute input check
686//  E0723, // unstable feature in `const` context
687//  E0738, // Removed; errored on `#[track_caller] fn`s in `extern "Rust" { ... }`.
688//  E0744, // merged into E0728
689//  E0776, // Removed; `#[cmse_nonsecure_entry]` is now `extern "cmse-nonsecure-entry"`
690//  E0796, // unused error code. We use `static_mut_refs` lint instead.