Here, is the detailed description of all the error codes which are emitted by emitted by rustc and their support in gccrs. See this gist for more detail.
New ErrorCode Framework:
List of ErrorCodes:
E0004
Error Description: This error indicates that the compiler cannot guarantee a matching pattern for
one or more possible inputs to a match expression. Guaranteed matches are
required in order to assign values to match expressions, or alternatively,
determine the flow of execution.
Non-Exhaustive Patterns: Matching Error (E0004) #2311
E0005
E0010
Error Description: The value of statics and constants must be known at compile time, and they live
for the entire lifetime of a program. Creating a boxed value allocates memory on
the heap at runtime, and therefore cannot be done at compile time.
E0013
Error Description: Static and const variables can refer to other const variables. But a const
variable cannot refer to a static variable.
E0015
E0023
E0025
Error Description: Each field of a struct can only be bound once in a pattern.
E0026
E0027
E0029
Error Description: Something other than numbers and characters has been used for a range.
E0030
Error Description: When matching against a range, the compiler verifies that the range is
non-empty. Range patterns include both end-points, so this is equivalent to
requiring the start of the range to be less than or equal to the end of the
range.
E0033
Error Description: A trait type has been dereferenced.
E0034
E0038
Error Description: For any given trait Trait there may be a related type called the trait
object type which is typically written as dyn Trait. In earlier editions of
Rust, trait object types were written as plain Trait (just the name of the
trait, written in type positions) but this was a bit too confusing, so we now
write dyn Trait.
Resolve type path error #2375
E0040
Error Description: It is not allowed to manually call destructors in Rust.
E0044
E0045
E0046
E0049
Error Description: An attempted implementation of a trait method has the wrong number of type or
const parameters.
E0050
Error Description: An attempted implementation of a trait method has the wrong number of function
parameters.
E0053
E0054
E0055
Error Description: During a method call, a value is automatically dereferenced as many times as
needed to make the value's type match the method's receiver. The catch is that
the compiler will only attempt to dereference a number of times up to the
recursion limit (which can be set via the recursion_limit attribute).
E0057
E0059
Error Description: The built-in function traits are generic over a tuple of the function arguments.
If one uses angle-bracket notation (Fn<(T,), Output=U>) instead of parentheses
(Fn(T) -> U) to denote the function trait, the type parameter should be a
tuple. Otherwise function call notation cannot be used and the trait will not be
implemented by closures.
E0060
Error Description: External C functions are allowed to be variadic. However, a variadic function
takes a minimum number of arguments. For example, consider C's variadic printf
function:
E0061
E0062
E0063
E0067
Error Description: An invalid left-hand side expression was used on an assignment operation.
E0069
Error Description: The compiler found a function whose body contains a return; statement but
whose return type is not ().
E0070
E0071
Error Description: A structure-literal syntax was used to create an item that is not a structure
or enum variant.
E0072
Error Description: A recursive type has infinite size because it doesn't have an indirection.
E0075
Error Description: A #[simd] attribute was applied to an empty tuple struct.
E0076
Error Description: All types in a tuple struct aren't the same when using the #[simd]
attribute.
E0077
Error Description: A tuple struct's element isn't a machine type when using the #[simd]
attribute.
E0080
E0081
Error Description: A discriminant value is present more than once.
E0084
Error Description: An unsupported representation was attempted on a zero-variant enum.
E0091
Error Description: An unnecessary type or const parameter was given in a type alias.
E0092
Error Description: An undefined atomic operation function was declared.
E0093
E0094
Error Description: An invalid number of generic parameters was passed to an intrinsic function.
E0106
Error Description: This error indicates that a lifetime is missing from a type. If it is an error
inside a function signature, the problem may be with failing to adhere to the
lifetime elision rules (see below).
E0107
E0109
Error Description: You tried to provide a generic argument to a type which doesn't need it.
E0116
E0117
Error Description: Only traits defined in the current crate can be implemented for arbitrary types.
E0118
Error Description: An inherent implementation was defined for something which isn't a struct,
enum, union, or trait object.
E0119
Error Description: There are conflicting trait implementations for the same type.
E0120
Error Description: Drop was implemented on a trait, which is not allowed: only structs and
enums can implement Drop.
E0121
Error Description: The type placeholder _ was used within a type on an item's signature.
E0124
E0128
Error Description: A type parameter with default value is using forward declared identifier.
E0130
Error Description: A pattern was declared as an argument in a foreign function declaration.
E0131
Error Description: The main function was defined with generic parameters.
E0132
Error Description: A function with the start attribute was declared with type parameters.
E0133
E0138
Error Description: More than one function was declared with the #[start] attribute.
E0152
Error Description: A lang item was redefined.
E0158
Error Description: An associated const, const parameter or static has been referenced
in a pattern.
E0161
Error Description: A value was moved whose size was not known at compile time.
E0164
E0170
Error Description: A pattern binding is using the same name as one of the variants of a type.
E0178
Error Description: The + type operator was used in an ambiguous context.
E0183
Error Description: Manual implementation of a Fn* trait.
E0184
E0185
Error Description: An associated function for a trait was defined to be static, but an
implementation of the trait declared the same function to be a method (i.e., to
take a self parameter).
E0186
Error Description: An associated function for a trait was defined to be a method (i.e., to take a
self parameter), but an implementation of the trait declared the same function
to be static.
E0191
Error Description: An associated type wasn't specified for a trait object.
E0195
Error Description: The lifetime parameters of the method do not match the trait declaration.
E0197
Error Description: An inherent implementation was marked unsafe.
E0198
Error Description: A negative implementation was marked as unsafe.
E0199
Error Description: A trait implementation was marked as unsafe while the trait is safe.
E0200
Error Description: An unsafe trait was implemented without an unsafe implementation.
E0201
Error Description: Two associated items (like methods, associated types, associated functions,
etc.) were defined with the same identifier.
E0203
Error Description: Having multiple relaxed default bounds is unsupported.
E0204
Error Description: The Copy trait was implemented on a type which contains a field that doesn't
implement the Copy trait.
E0206
Error Description: The Copy trait was implemented on a type which is neither a struct, an
enum, nor a union.
E0207
Error Description: A type, const or lifetime parameter that is specified for impl is not
constrained.
E0210
Error Description: This error indicates a violation of one of Rust's orphan rules for trait
implementations. The rule concerns the use of type parameters in an
implementation of a foreign trait (a trait defined in another crate), and
states that type parameters must be "covered" by a local type.
E0212
Error Description: Cannot use the associated type of
a trait with uninferred generic parameters.
E0214
Error Description: A generic type was described using parentheses rather than angle brackets.
E0220
Error Description: The associated type used was not defined in the trait.
E0221
Error Description: An attempt was made to retrieve an associated type, but the type was ambiguous.
E0222
Error Description: An attempt was made to constrain an associated type.
E0223
Error Description: An attempt was made to retrieve an associated type, but the type was ambiguous.
E0224
Error Description: A trait object was declared with no traits.
E0225
Error Description: Multiple types were used as bounds for a closure or trait object.
E0226
Error Description: More than one explicit lifetime bound was used on a trait object.
E0227
Error Description: This error indicates that the compiler is unable to determine whether there is
exactly one unique region in the set of derived region bounds.
E0228
Error Description: The lifetime bound for this object type cannot be deduced from context and must
be specified.
E0229
E0230
Error Description: The #[rustc_on_unimplemented] attribute lets you specify a custom error
message for when a particular trait isn't implemented on a type placed in a
position that needs that trait. For example, when the following code is
compiled:
E0231
Error Description: The #[rustc_on_unimplemented] attribute lets you specify a custom error
message for when a particular trait isn't implemented on a type placed in a
position that needs that trait. For example, when the following code is
compiled:
E0232
Error Description: The #[rustc_on_unimplemented] attribute lets you specify a custom error
message for when a particular trait isn't implemented on a type placed in a
position that needs that trait. For example, when the following code is
compiled:
E0252
Error Description: Two items of the same name cannot be imported without rebinding one of the
items under a new local name.
E0253
Error Description: Attempt was made to import an unimportable value. This can happen when trying
to import a method from a trait.
E0254
Error Description: Attempt was made to import an item whereas an extern crate with this name has
already been imported.
E0255
Error Description: You can't import a value whose name is the same as another value defined in the
module.
E0259
Error Description: The name chosen for an external crate conflicts with another external crate
that has been imported into the current module.
E0260
Error Description: The name for an item declaration conflicts with an external crate's name.
E0261
Error Description: An undeclared lifetime was used.
E0262
Error Description: An invalid name was used for a lifetime parameter.
E0264
Error Description: An unknown external lang item was used.
E0267
E0268
E0271
E0275
Error Description: An evaluation of a trait requirement overflowed.
E0276
Error Description: A trait implementation has stricter requirements than the trait definition.
E0277
E0282
E0283
Error Description: An implementation cannot be chosen unambiguously because of lack of information.
E0284
Error Description: This error occurs when the compiler is unable to unambiguously infer the
return type of a function or method which is generic on return type, such
as the collect method for Iterators.
E0307
Error Description: The self parameter in a method has an invalid "receiver type".
E0308
E0309
Error Description: A parameter type is missing an explicit lifetime bound and may not live long
enough.
E0310
Error Description: A parameter type is missing a lifetime constraint or has a lifetime that
does not live long enough.
E0311
Error Description: This error occurs when there is an unsatisfied outlives bound involving an
elided region and a generic type parameter or associated type.
E0316
Error Description: A where clause contains a nested quantification over lifetimes.
E0317
Error Description: An if expression is missing an else block.
E0320
Error Description: Recursion limit reached while creating drop-check rules.
E0321
Error Description: A cross-crate opt-out trait was implemented on something which wasn't a struct
or enum type.
E0322
Error Description: A built-in trait was implemented explicitly. All implementations of the trait
are provided automatically by the compiler.
E0323
E0324
E0325
Error Description: An associated type was implemented when another trait item was expected.
E0326
Error Description: An implementation of a trait doesn't match the type constraint.
E0328
Error Description: The Unsize trait should not be implemented directly. All implementations of
Unsize are provided automatically by the compiler.
E0364
Error Description: Private items cannot be publicly re-exported. This error indicates that you
attempted to pub use a type or value that was not itself public.
E0365
Error Description: Private modules cannot be publicly re-exported. This error indicates that you
attempted to pub use a module that was not itself public.
E0366
Error Description: An attempt was made to implement Drop on a concrete specialization of a
generic type. An example is shown below:
E0367
Error Description: An attempt was made to implement Drop on a specialization of a generic type.
E0368
Error Description: A binary assignment operator like += or ^= was applied to a type that
doesn't support it.
E0369
Error Description: A binary operation was attempted on a type which doesn't support it.
E0370
Error Description: The maximum value of an enum was reached, so it cannot be automatically
set in the next enum value.
E0371
Error Description: A trait was implemented on another which already automatically implemented it.
E0373
Error Description: A captured variable in a closure may not live long enough.
E0374
Error Description: CoerceUnsized was implemented on a struct which does not contain a field with
an unsized type.
E0375
Error Description: CoerceUnsized was implemented on a struct which contains more than one field
with an unsized type.
E0376
Error Description: CoerceUnsized was implemented on something that isn't a struct.
E0377
Error Description: The trait CoerceUnsized may only be implemented for a coercion between
structures with the same definition.
E0378
Error Description: The DispatchFromDyn trait was implemented on something which is not a pointer
or a newtype wrapper around a pointer.
E0379
Error Description: A trait method was declared const.
E0380
E0381
Error Description: It is not allowed to use or capture an uninitialized variable.
E0382
Error Description: A variable was used after its contents have been moved elsewhere.
E0384
Error Description: An immutable variable was reassigned.
E0390
E0391
E0392
Error Description: A type or lifetime parameter has been declared but is not actually used.
E0393
Error Description: A type parameter which references Self in its default value was not specified.
E0399
Error Description: #### Note: this error code is no longer emitted by the compiler
E0401
Error Description: Inner items do not inherit type or const parameters from the functions
they are embedded in.
E0403
Error Description: Some type parameters have the same name.
E0404
E0405
Error Description: The code refers to a trait that is not in scope.
E0407
Error Description: A definition of a method not in the implemented trait was given in a trait
implementation.
E0408
Error Description: An "or" pattern was used where the variable bindings are not consistently bound
across patterns.
E0409
Error Description: An "or" pattern was used where the variable bindings are not consistently bound
across patterns.
E0411
Error Description: The Self keyword was used outside an impl, trait, or type definition.
E0412
E0415
Error Description: More than one function parameter have the same name.
E0416
Error Description: An identifier is bound more than once in a pattern.
E0422
Error Description: An identifier that is neither defined nor a struct was used.
E0423
E0424
Error Description: The self keyword was used inside of an associated function without a "self
receiver" parameter.
E0425
E0426
E0428
Error Description: A type or module has been defined more than once.
E0429
Error Description: The self keyword cannot appear alone as the last segment in a use
declaration.
E0430
Error Description: The self import appears more than once in the list.
E0431
E0432
Error Description: An import was unresolved.
E0433
E0434
Error Description: A variable used inside an inner function comes from a dynamic environment.
E0435
Error Description: A non-constant value was used in a constant expression.
E0436
Error Description: The functional record update syntax was used on something other than a struct.
E0437
Error Description: An associated type whose name does not match any of the associated types
in the trait was used when implementing the trait.
E0438
Error Description: An associated constant whose name does not match any of the associated constants
Wrong Error on E0438 #2481
in the trait was used when implementing the trait.
E0445
Error Description: A private trait was used on a public type parameter bound.
E0446
Error Description: A private type was used in a public type signature.
E0449
Error Description: A visibility qualifier was used where one is not permitted. Visibility
qualifiers are not permitted on enum variants, trait items, impl blocks, and
extern blocks, as they already share the visibility of the parent item.
E0451
Error Description: A struct constructor with private fields was invoked.
E0452
Error Description: An invalid lint attribute has been given.
E0453
Error Description: A lint check attribute was overruled by a forbid directive set as an
attribute on an enclosing scope, or on the command line with the -F option.
E0454
Error Description: A link name was given with an empty name.
E0455
Error Description: Some linking kinds are target-specific and not supported on all platforms.
E0457
Error Description: Plugin .. only found in rlib format, but must be available in dylib format.
E0458
Error Description: An unknown "kind" was specified for a link attribute.
E0459
Error Description: A link was used without a name parameter.
E0460
Error Description: Found possibly newer version of crate .. which .. depends on.
E0461
Error Description: Couldn't find crate .. with expected target triple ...
E0462
Error Description: Found staticlib .. instead of rlib or dylib.
E0463
Error Description: A plugin/crate was declared but cannot be found.
E0464
Error Description: The compiler found multiple library files with the requested crate name.
E0466
Error Description: Macro import declaration was malformed.
E0468
Error Description: A non-root module tried to import macros from another crate.
E0469
Error Description: A macro listed for import was not found.
E0472
Error Description: Inline assembly (asm!) is not supported on this target.
E0476
Error Description: The coerced type does not outlive the value being coerced to.
E0478
Error Description: A lifetime bound was not satisfied.
E0491
Error Description: A reference has a longer lifetime than the data it references.
E0492
Error Description: A borrow of a constant containing interior mutability was attempted.
E0493
Error Description: A value with a custom Drop implementation may be dropped during const-eval.
E0496
Error Description: A lifetime name is shadowing another lifetime name.
E0498
Error Description: The plugin attribute was malformed.
E0499
Error Description: A variable was borrowed as mutable more than once.
E0500
Error Description: A borrowed variable was used by a closure.
E0501
Error Description: A mutable variable is used but it is already captured by a closure.
E0502
Error Description: A variable already borrowed as immutable was borrowed as mutable.
E0503
Error Description: A value was used after it was mutably borrowed.
E0505
Error Description: A value was moved out while it was still borrowed.
E0506
Error Description: An attempt was made to assign to a borrowed value.
E0507
Error Description: A borrowed value was moved out.
E0508
Error Description: A value was moved out of a non-copy fixed-size array.
E0509
Error Description: This error occurs when an attempt is made to move out of a value whose type
implements the Drop trait.
E0510
Error Description: The matched value was assigned in a match guard.
E0511
Error Description: Invalid monomorphization of an intrinsic function was used.
E0512
Error Description: Transmute with two differently sized types was attempted.
E0514
Error Description: Dependency compiled with different version of rustc.
E0515
Error Description: A reference to a local variable was returned.
E0516
Error Description: The typeof keyword is currently reserved but unimplemented.
E0517
Error Description: A #[repr(..)] attribute was placed on an unsupported item.
E0518
Error Description: An #[inline(..)] attribute was incorrectly placed on something other than a
function or method.
E0519
Error Description: The current crate is indistinguishable from one of its dependencies, in terms
of metadata.
E0520
Error Description: A non-default implementation was already made on this type so it cannot be
specialized further.
E0521
Error Description: Borrowed data escapes outside of closure.
E0522
Error Description: The lang attribute was used in an invalid context.
E0524
Error Description: A variable which requires unique access is being used in more than one closure
at the same time.
E0525
Error Description: A closure was used but didn't implement the expected trait.
E0527
Error Description: The number of elements in an array or slice pattern differed from the number of
elements in the array being matched.
E0528
Error Description: An array or slice pattern required more elements than were present in the
matched array.
E0529
Error Description: An array or slice pattern was matched against some other type.
E0530
Error Description: A binding shadowed something it shouldn't.
E0531
Error Description: An unknown tuple struct/variant has been used.
E0532
E0533
Error Description: An item which isn't a unit struct, a variant, nor a constant has been used as a
match pattern.
E0534
E0535
E0536
Error Description: The not cfg-predicate was malformed.
E0537
Error Description: An unknown predicate was used inside the cfg attribute.
E0538
Error Description: Attribute contains same meta item more than once.
E0539
Error Description: An invalid meta-item was used inside an attribute.
E0541
E0542
Error Description: The since value is missing in a stability attribute.
E0543
Error Description: The note value is missing in a stability attribute.
E0544
Error Description: Multiple stability attributes were declared on the same item.
E0545
Error Description: The issue value is incorrect in a stability attribute.
E0546
Error Description: The feature value is missing in a stability attribute.
E0547
Error Description: The issue value is missing in a stability attribute.
E0549
Error Description: A deprecated attribute wasn't paired with a stable/unstable attribute with
#![feature(staged_api)] enabled.
E0550
Error Description: #### Note: this error code is no longer emitted by the compiler
E0551
Error Description: An invalid meta-item was used inside an attribute.
E0552
E0554
Error Description: Feature attributes are only allowed on the nightly release channel. Stable or
beta compilers will not comply.
E0556
Error Description: The feature attribute was badly formed.
E0557
Error Description: A feature attribute named a feature that has been removed.
E0559
Error Description: An unknown field was specified into an enum's structure variant.
E0560
Error Description: An unknown field was specified into a structure.
E0561
Error Description: A non-ident or non-wildcard pattern has been used as a parameter of a function
pointer type.
E0562
Error Description: Abstract return types (written impl Trait for some trait Trait) are only
allowed as function and inherent impl return types.
E0565
Error Description: A literal was used in a built-in attribute that doesn't support literals.
E0566
Error Description: Conflicting representation hints have been used on a same item.
E0567
Error Description: Generics have been used on an auto trait.
E0568
Error Description: A super trait has been added to an auto trait.
E0569
Error Description: If an impl has a generic parameter with the #[may_dangle] attribute, then
that impl must be declared as an unsafe impl.
E0570
Error Description: The requested ABI is unsupported by the current target.
E0571
E0572
E0573
E0574
Error Description: Something other than a struct, variant or union has been used when one was
expected.
E0575
Error Description: Something other than a type or an associated type was given.
E0576
Error Description: An associated item wasn't found in the given type.
E0577
Error Description: Something other than a module was found in visibility scope.
E0578
Error Description: A module cannot be found and therefore, the visibility cannot be determined.
E0579
Error Description: A lower range wasn't less than the upper range.
E0580
Error Description: The main function was incorrectly declared.
E0581
Error Description: In a fn type, a lifetime appears only in the return type
and not in the arguments types.
E0582
Error Description: A lifetime is only present in an associated-type binding, and not in the input
types to the trait.
E0583
Error Description: A file wasn't found for an out-of-line module.
E0584
Error Description: A doc comment that is not attached to anything has been encountered.
E0585
Error Description: A documentation comment that doesn't document anything was found.
E0586
Error Description: An inclusive range was used with no end.
E0587
Error Description: A type has both packed and align representation hints.
E0588
Error Description: A type with packed representation hint has a field with align
representation hint.
E0589
Error Description: The value of N that was specified for repr(align(N)) was not a power
of two, or was greater than 2^29.
E0590
Error Description: break or continue keywords were used in a condition of a while loop
without a label.
E0591
Error Description: Per [RFC 401][rfc401], if you have a function declaration foo:
E0592
E0593
Error Description: You tried to supply an Fn-based type with an incorrect number of arguments
than what was expected.
E0594
Error Description: A non-mutable value was assigned a value.
E0596
Error Description: This error occurs because you tried to mutably borrow a non-mutable variable.
E0597
Error Description: This error occurs because a value was dropped while it was still borrowed.
E0599
E0600
Error Description: An unary operator was used on a type which doesn't implement it.
E0601
E0602
Error Description: An unknown or invalid lint was used on the command line.
E0603
E0604
E0605
Error Description: An invalid cast was attempted.
E0606
E0607
Error Description: A cast between a thin and a fat pointer was attempted.
E0608
Error Description: An attempt to use index on a type which doesn't implement the std::ops::Index
trait was performed.
E0609 - GodBolt
Error Description: Attempted to access a nonexistent field in a struct.
E0610
Error Description: Attempted to access a field on a primitive type.
E0614
Error Description: Attempted to dereference a variable which cannot be dereferenced.
E0615
Error Description: Attempted to access a method like a field.
E0616
Error Description: Attempted to access a private field on a struct.
E0617
E0618
E0620
E0621
Error Description: This error code indicates a mismatch between the lifetimes appearing in the
function signature (i.e., the parameter types and the return type) and the
data-flow found in the function body.
E0622
Error Description: An intrinsic was declared without being a function.
E0623
Error Description: A lifetime didn't match what was expected.
E0624
Error Description: A private item was used outside of its scope.
E0625
Error Description: A compile-time const variable is referring to a thread-local static variable.
E0626
Error Description: This error occurs because a borrow in a generator persists across a
yield point.
E0627
Error Description: A yield expression was used outside of the generator literal.
E0628
Error Description: More than one parameter was used for a generator.
E0631
Error Description: This error indicates a type mismatch in closure arguments.
E0634
Error Description: A type has conflicting packed representation hints.
E0635
E0636
Error Description: A #![feature] attribute was declared multiple times.
E0637
Error Description: '_ lifetime name or &T without an explicit lifetime name has been used
on illegal place.
E0638
Error Description: This error indicates that the struct, enum or enum variant must be matched
non-exhaustively as it has been marked as non_exhaustive.
E0639
Error Description: This error indicates that the struct, enum or enum variant cannot be
instantiated from outside of the defining crate as it has been marked
as non_exhaustive and as such more fields/variants may be added in
future that could cause adverse side effects for this code.
E0640
Error Description: #### This error code is internal to the compiler and will not be emitted with normal Rust code.
E0641
Error Description: Attempted to cast to/from a pointer with an unknown kind.
E0642
Error Description: Trait methods currently cannot take patterns as arguments.
E0643
Error Description: This error indicates that there is a mismatch between generic parameters and
impl Trait parameters in a trait declaration versus its impl.
E0644
Error Description: A closure or generator was constructed that references its own type.
E0646
Error Description: It is not possible to define main with a where clause.
E0647
Error Description: The start function was defined with a where clause.
E0648
Error Description: An export_name attribute contains null characters (\0).
E0657
Error Description: A lifetime bound on a trait implementation was captured at an incorrect place.
E0658
E0659
Error Description: An item usage is ambiguous.
E0666
Error Description: impl Trait types cannot appear nested in the generic arguments of other
impl Trait types.
E0667
Error Description: impl Trait is not allowed in path parameters.
E0670
Error Description: Rust 2015 does not permit the use of async fn.
E0689
Error Description: A method was called on an ambiguous numeric type.
E0690
Error Description: A struct with the representation hint repr(transparent) had two or more fields
that were not guaranteed to be zero-sized.
E0691
Error Description: A struct, enum, or union with the repr(transparent) representation hint
contains a zero-sized field that requires non-trivial alignment.
E0692
Error Description: A repr(transparent) type was also annotated with other, incompatible
representation hints.
E0693
Error Description: align representation hint was incorrectly declared.
E0695
Error Description: A break statement without a label appeared inside a labeled block.
E0696
Error Description: A function is using continue keyword incorrectly.
E0697
Error Description: A closure has been used as static.
E0698
Error Description: When using generators (or async) all type variables must be bound so a
generator can be constructed.
E0699
Error Description: A method was called on a raw pointer whose inner type wasn't completely known.
E0700
Error Description: The impl Trait return type captures lifetime parameters that do not
appear within the impl Trait itself.
E0701
Error Description: This error indicates that a #[non_exhaustive] attribute was incorrectly placed
on something other than a struct or enum.
E0703
E0704
Error Description: An incorrect visibility restriction was specified.
E0705
Error Description: A #![feature] attribute was declared for a feature that is stable in the
current edition, but not in all editions.
E0706
Error Description: async fns are not yet supported in traits in Rust.
E0708
Error Description: async non-move closures with parameters are currently not supported.
E0710
Error Description: An unknown tool name was found in a scoped lint.
E0711
Error Description: #### This error code is internal to the compiler and will not be emitted with normal Rust code.
E0712
Error Description: A borrow of a thread-local variable was made inside a function which outlived
the lifetime of the function.
E0713
Error Description: This error occurs when an attempt is made to borrow state past the end of the
lifetime of a type that implements the Drop trait.
E0714
Error Description: A #[marker] trait contained an associated item.
E0715
Error Description: An impl for a #[marker] trait tried to override an associated item.
E0716
Error Description: A temporary value is being dropped while a borrow is still in active use.
E0717
Error Description: #### This error code is internal to the compiler and will not be emitted with normal Rust code.
E0718
Error Description: A #[lang = ".."] attribute was placed on the wrong item type.
E0719
Error Description: An associated type value was specified more than once.
E0720
E0722
Error Description: The optimize attribute was malformed.
E0724
Error Description: #[ffi_returns_twice] was used on something other than a foreign function
declaration.
E0725
Error Description: A feature attribute named a feature that was disallowed in the compiler
command line flags.
E0726
Error Description: An argument lifetime was elided in an async function.
E0727
Error Description: A yield clause was used in an async context.
E0728
Error Description: [await] has been used outside [async] function or [async] block.
E0729
Error Description: #### Note: this error code is no longer emitted by the compiler
E0730
Error Description: An array without a fixed length was pattern-matched.
E0731
Error Description: An enum with the representation hint repr(transparent) had zero or more than
one variants.
E0732
Error Description: An enum with a discriminant must specify a #[repr(inttype)].
E0733
Error Description: An [async] function used recursion without boxing.
E0734
Error Description: A stability attribute has been used outside of the standard library.
E0735
Error Description: Type parameter defaults cannot use Self on structs, enums, or unions.
E0736
Error Description: #[track_caller] and #[naked] cannot both be applied to the same function.
E0737
Error Description: #[track_caller] requires functions to have the "Rust" ABI for implicitly
receiving caller location. See [RFC 2091] for details on this and other
restrictions.
E0739
Error Description: #[track_caller] can not be applied on struct.
E0740
Error Description: A union was declared with fields with destructors.
E0741
Error Description: A non-structural-match type was used as the type of a const generic parameter.
E0742
Error Description: Visibility is restricted to a module which isn't an ancestor of the current
item.
E0743
Error Description: The C-variadic type ... has been nested inside another type.
E0744
Error Description: An unsupported expression was used inside a const context.
E0745
Error Description: The address of temporary value was taken.
E0746
Error Description: An unboxed trait object was used as a return value.
E0747
Error Description: Generic arguments were not provided in the same order as the corresponding
generic parameters are declared.
E0748
Error Description: A raw string isn't correctly terminated because the trailing # count doesn't
match its leading # count.
E0749
Error Description: An item was added on a negative impl.
E0750
Error Description: A negative impl was made default impl.
E0751
Error Description: There are both a positive and negative trait implementation for the same type.
E0752
Error Description: The entry point of the program was marked as async.
E0753
E0754
Error Description: A non-ASCII identifier was used in an invalid context.
Thanks @tamaroning
E0755
Error Description: The ffi_pure attribute was used on a non-foreign function.
E0756
Error Description: The ffi_const attribute was used on something other than a foreign function
declaration.
E0757
Error Description: A function was given both the ffi_const and ffi_pure attributes.
E0758
Error Description: A multi-line (doc-)comment is unterminated.
E0761
Error Description: Multiple candidate files were found for an out-of-line module.
E0762
Error Description: A character literal wasn't ended with a quote.
E0763
Error Description: A byte constant wasn't correctly ended.
E0764
Error Description: A mutable reference was used in a constant.
E0765
Error Description: A double quote string (") was not terminated.
E0766
Error Description: A double quote byte string (b") was not terminated.
E0767
Error Description: An unreachable label was used.
E0768
Error Description: A number in a non-decimal base has no digits.
E0769
E0770
Error Description: The type of a const parameter references other generic parameters.
E0771
Error Description: #### Note: this error code is no longer emitted by the compiler
E0773
Error Description: A builtin-macro was defined more than once.
E0774
Error Description: derive was applied on something which is not a struct, a union or an enum.
E0775
Error Description: #[cmse_nonsecure_entry] is only valid for targets with the TrustZone-M
extension.
E0776
Error Description: #[cmse_nonsecure_entry] functions require a C ABI
E0777
Error Description: A literal value was used inside #[derive].
E0778
Error Description: The instruction_set attribute was malformed.
E0779
Error Description: An unknown argument was given to the instruction_set attribute.
E0780
Error Description: Cannot use doc(inline) with anonymous imports
E0781
Error Description: The C-cmse-nonsecure-call ABI can only be used with function pointers.
E0782
Error Description: Trait objects must include the dyn keyword.
E0783
Error Description: The range pattern ... is no longer allowed.
E0784
Error Description: A union expression does not have exactly one field.
E0785
Error Description: An inherent impl was written on a dyn auto trait.
E0786
Error Description: A metadata file was invalid.
E0787
Error Description: An unsupported naked function definition.
E0788
Error Description: A #[no_coverage] attribute was applied to something which does not show up
in code coverage, or is too granular to be excluded from the coverage report.
E0789
Error Description: #### This error code is internal to the compiler and will not be emitted with normal Rust code.
E0790
Error Description: You need to specify a specific implementation of the trait in order to call the
method.
E0791
Error Description: Static variables with the #[linkage] attribute within external blocks
must have one of the following types, which are equivalent to a nullable
pointer in C:
E0792
Error Description: A type alias impl trait can only have its hidden type assigned
when used fully generically (and within their defining scope).
This means
E0793
Error Description: An unaligned references to a field of a [packed] struct got created.
E0794
Error Description: A lifetime parameter of a function definition is called late-bound if it both:
Enhancing errors messages:
Internal Compiler Errors:
Refactor Issues:
Here, is the detailed description of all the error codes which are emitted by emitted by rustc and their support in gccrs. See this
gistfor more detail.New ErrorCode Framework:
rich-loc&errorcodein parser & expansion errors #2542richlocto paser errors #2566rich_location *function #2574ErrorCodelocation after theerror:#2522List of ErrorCodes:
E0004one or more possible inputs to a match expression. Guaranteed matches are
required in order to assign values to match expressions, or alternatively,
determine the flow of execution.
E0005that a name will be extracted in all cases.
[E0005]#2508xin this scope #2509E0010for the entire lifetime of a program. Creating a boxed value allocates memory on
the heap at runtime, and therefore cannot be done at compile time.
E0013variable cannot refer to a static variable.
E0015constfunction was called in aconstcontext.E0023E0025E0026E0027struct's fields.
E0029E0030non-empty. Range patterns include both end-points, so this is equivalent to
requiring the start of the range to be less than or equal to the end of the
range.
E0033E0034has the same prototype.
E0038Traitthere may be a related type called the traitobject type which is typically written as
dyn Trait. In earlier editions ofRust, trait object types were written as plain
Trait(just the name of thetrait, written in type positions) but this was a bit too confusing, so we now
write
dyn Trait.E0040E0044E0045E0046E0049const parameters.
E0050parameters.
E0053and the trait definition.
E0054[E0054-E0604-E0620-E0606]TypeCasting ErrorCodes #2528E0055needed to make the value's type match the method's receiver. The catch is that
the compiler will only attempt to dereference a number of times up to the
recursion limit (which can be set via the
recursion_limitattribute).E0057E0059If one uses angle-bracket notation (
Fn<(T,), Output=U>) instead of parentheses(
Fn(T) -> U) to denote the function trait, the type parameter should be atuple. Otherwise function call notation cannot be used and the trait will not be
implemented by closures.
E0060takes a minimum number of arguments. For example, consider C's variadic
printffunction:
E0061E0062E0063E0067E0069return;statement butwhose return type is not
().E0070E0071or enum variant.
E0072E0075#[simd]attribute was applied to an empty tuple struct.E0076#[simd]attribute.
E0077#[simd]attribute.
E0080E0081E0084E0091E0092E0093E0094E0106inside a function signature, the problem may be with failing to adhere to the
lifetime elision rules (see below).
E0107E0109E0116E0117E0118enum, union, or trait object.
E0119E0120enums can implement Drop.
E0121_was used within a type on an item's signature.E0124xis already declared in struct #2397E0128E0130E0131mainfunction was defined with generic parameters.E0132startattribute was declared with type parameters.E0133E0138#[start]attribute.E0152E0158const,constparameter orstatichas been referencedin a pattern.
E0161E0164pattern.
E0170E0178+type operator was used in an ambiguous context.E0183Fn*trait.E0184Copytrait was implemented on a type with aDropimplementation.Copytrait was implemented onDrop implementation type- [E0184] #2510E0185implementation of the trait declared the same function to be a method (i.e., to
take a
selfparameter).E0186selfparameter), but an implementation of the trait declared the same functionto be static.
E0191E0195E0197E0198E0199E0200E0201etc.) were defined with the same identifier.
E0203E0204Copytrait was implemented on a type which contains a field that doesn'timplement the
Copytrait.E0206Copytrait was implemented on a type which is neither a struct, anenum, nor a union.
E0207implis notconstrained.
E0210implementations. The rule concerns the use of type parameters in an
implementation of a foreign trait (a trait defined in another crate), and
states that type parameters must be "covered" by a local type.
E0212a trait with uninferred generic parameters.
E0214E0220E0221E0222E0223E0224E0225E0226E0227exactly one unique region in the set of derived region bounds.
E0228be specified.
E0229and
whereclause.E0230#[rustc_on_unimplemented]attribute lets you specify a custom errormessage for when a particular trait isn't implemented on a type placed in a
position that needs that trait. For example, when the following code is
compiled:
E0231#[rustc_on_unimplemented]attribute lets you specify a custom errormessage for when a particular trait isn't implemented on a type placed in a
position that needs that trait. For example, when the following code is
compiled:
E0232#[rustc_on_unimplemented]attribute lets you specify a custom errormessage for when a particular trait isn't implemented on a type placed in a
position that needs that trait. For example, when the following code is
compiled:
E0252items under a new local name.
E0253to import a method from a trait.
E0254already been imported.
E0255module.
E0259that has been imported into the current module.
E0260E0261E0262E0264E0267breakorcontinue) was used inside a closure but outside ofany loop.
E0267#2454E0268breakorcontinue) was used outside of a loop.E0267#2454E0271E0275E0276E0277expected that trait.
E0282E0283E0284return type of a function or method which is generic on return type, such
as the
collectmethod forIterators.E0307selfparameter in a method has an invalid "receiver type".E0308ifcontains&strinstead ofbool#2495E0309enough.
E0310does not live long enough.
E0311elided region and a generic type parameter or associated type.
E0316whereclause contains a nested quantification over lifetimes.E0317ifexpression is missing anelseblock.E0320E0321or enum type.
E0322are provided automatically by the compiler.
E0323E0438#2481E0324unknown trait item#2478E0325E0326E0328Unsize are provided automatically by the compiler.
E0364attempted to
pub usea type or value that was not itself public.E0365attempted to
pub usea module that was not itself public.E0366Dropon a concrete specialization of ageneric type. An example is shown below:
E0367Dropon a specialization of a generic type.E0368+=or^=was applied to a type thatdoesn't support it.
E0369E0370set in the next enum value.
E0371E0373E0374CoerceUnsizedwas implemented on a struct which does not contain a field withan unsized type.
E0375CoerceUnsizedwas implemented on a struct which contains more than one fieldwith an unsized type.
E0376CoerceUnsizedwas implemented on something that isn't a struct.E0377CoerceUnsizedmay only be implemented for a coercion betweenstructures with the same definition.
E0378DispatchFromDyntrait was implemented on something which is not a pointeror a newtype wrapper around a pointer.
E0379E0380E0381E0382E0384E0390E0391E0392E0393Selfin its default value was not specified.E0399E0401they are embedded in.
E0403E0404or
impl.E0405E0407implementation.
E0408across patterns.
E0409across patterns.
E0411Selfkeyword was used outside an impl, trait, or type definition.E0412E0415E0416E0422E0423identifier exists but it belongs to a different namespace.
E0424selfkeyword was used inside of an associated function without a "selfreceiver" parameter.
E0425E0426E0428E0429selfkeyword cannot appear alone as the last segment in ausedeclaration.
E0430selfimport appears more than once in the list.E0431selfimport was made.selfimport was made #2501E0432E0433[E0005]#2508[E0001]warning #2511E0434E0435E0436E0437in the trait was used when implementing the trait.
E0438E0438#2481in the trait was used when implementing the trait.
E0445E0446E0449qualifiers are not permitted on enum variants, trait items, impl blocks, and
extern blocks, as they already share the visibility of the parent item.
E0451E0452E0453forbiddirective set as anattribute on an enclosing scope, or on the command line with the
-Foption.E0454E0455E0457..only found in rlib format, but must be available in dylib format.E0458E0459E0460..which..depends on.E0461..with expected target triple...E0462staticlib..instead ofrlibordylib.E0463E0464E0466E0468E0469E0472asm!) is not supported on this target.E0476E0478E0491E0492E0493Dropimplementation may be dropped during const-eval.E0496E0498pluginattribute was malformed.E0499E0500E0501E0502E0503E0505E0506E0507E0508E0509implements the
Droptrait.E0510E0511E0512E0514rustc.E0515E0516typeofkeyword is currently reserved but unimplemented.E0517#[repr(..)]attribute was placed on an unsupported item.E0518#[inline(..)]attribute was incorrectly placed on something other than afunction or method.
E0519of metadata.
E0520specialized further.
E0521E0522E0524at the same time.
E0525E0527elements in the array being matched.
E0528matched array.
E0529E0530E0531E0532E0533match pattern.
E0534inlineattribute was malformed.E0535inlineattribute.E0536notcfg-predicate was malformed.E0537cfgattribute.E0538E0539E0541E0542sincevalue is missing in a stability attribute.E0543notevalue is missing in a stability attribute.E0544E0545issuevalue is incorrect in a stability attribute.E0546featurevalue is missing in a stability attribute.E0547issuevalue is missing in a stability attribute.E0549deprecatedattribute wasn't paired with astable/unstableattribute with#![feature(staged_api)]enabled.E0550E0551E0552repr optionserror support #2517E0554beta compilers will not comply.
E0556featureattribute was badly formed.E0557E0559E0560E0561pointer type.
E0562impl Traitfor some traitTrait) are onlyallowed as function and inherent impl return types.
E0565E0566E0567E0568E0569#[may_dangle]attribute, thenthat impl must be declared as an
unsafe impl.E0570E0571breakstatement with an argument appeared in a non-looploop.E0572E0573Typegot something else #2479E0574expected.
E0575E0576E0577E0578E0579E0580mainfunction was incorrectly declared.E0581fntype, a lifetime appears only in the return typeand not in the arguments types.
E0582types to the trait.
E0583E0584E0585E0586E0587packedandalignrepresentation hints.E0588packedrepresentation hint has a field withalignrepresentation hint.
E0589Nthat was specified forrepr(align(N))was not a powerof two, or was greater than 2^29.
E0590breakorcontinuekeywords were used in a condition of awhileloopwithout a label.
E0591foo:E0592name.
E0593Fn-based type with an incorrect number of argumentsthan what was expected.
E0594E0596E0597E0599E0600E0601mainfunction was found in a binary crate.bincrate type with others -[E0601]#2512E0602E0603E0604charwas attempted on a type other thanu8.[E0054-E0604-E0620-E0606]TypeCasting ErrorCodes #2528E0605E0606[E0054-E0604-E0620-E0606]TypeCasting ErrorCodes #2528E0607E0608std::ops::Indextrait was performed.
E0609- GodBoltE0610E0614E0615E0616E0617variadicfunction #2627E0618E0620[E0054-E0604-E0620-E0606]TypeCasting ErrorCodes #2528E0621function signature (i.e., the parameter types and the return type) and the
data-flow found in the function body.
E0622E0623E0624E0625E0626yield point.
E0627E0628E0631E0634packedrepresentation hints.E0635#![feature]attribute specified an unknown feature.E0636#![feature]attribute was declared multiple times.E0637'_lifetime name or&Twithout an explicit lifetime name has been usedon illegal place.
E0638non-exhaustively as it has been marked as
non_exhaustive.E0639instantiated from outside of the defining crate as it has been marked
as
non_exhaustiveand as such more fields/variants may be added infuture that could cause adverse side effects for this code.
E0640E0641E0642E0643impl Trait parameters in a trait declaration versus its impl.
E0644E0646mainwith a where clause.E0647startfunction was defined with a where clause.E0648export_nameattribute contains null characters (\0).E0657E0658E0659E0666impl Traittypes cannot appear nested in the generic arguments of otherimpl Traittypes.E0667impl Traitis not allowed in path parameters.E0670async fn.E0689E0690repr(transparent)had two or more fieldsthat were not guaranteed to be zero-sized.
E0691repr(transparent)representation hintcontains a zero-sized field that requires non-trivial alignment.
E0692repr(transparent)type was also annotated with other, incompatiblerepresentation hints.
E0693alignrepresentation hint was incorrectly declared.E0695breakstatement without a label appeared inside a labeled block.E0696continuekeyword incorrectly.E0697static.E0698generator can be constructed.
E0699E0700impl Traitreturn type captures lifetime parameters that do notappear within the
impl Traititself.E0701#[non_exhaustive]attribute was incorrectly placedon something other than a struct or enum.
E0703E0704E0705#![feature]attribute was declared for a feature that is stable in thecurrent edition, but not in all editions.
E0706async fns are not yet supported in traits in Rust.E0708asyncnon-moveclosures with parameters are currently not supported.E0710E0711E0712the lifetime of the function.
E0713lifetime of a type that implements the
Droptrait.E0714#[marker]trait contained an associated item.E0715implfor a#[marker]trait tried to override an associated item.E0716E0717E0718#[lang = ".."]attribute was placed on the wrong item type.E0719E0720impl Traittype expands to a recursive type.impl Traittype expands to a recursive type[E0720]#2523E0722optimizeattribute was malformed.E0724#[ffi_returns_twice]was used on something other than a foreign functiondeclaration.
E0725command line flags.
E0726E0727yieldclause was used in anasynccontext.E0728await] has been used outside [async] function or [async] block.E0729E0730E0731repr(transparent)had zero or more thanone variants.
E0732enumwith a discriminant must specify a#[repr(inttype)].E0733async] function used recursion without boxing.E0734E0735Selfon structs, enums, or unions.E0736#[track_caller]and#[naked]cannot both be applied to the same function.E0737#[track_caller]requires functions to have the"Rust"ABI for implicitlyreceiving caller location. See [RFC 2091] for details on this and other
restrictions.
E0739#[track_caller]can not be applied on struct.E0740unionwas declared with fields with destructors.E0741E0742item.
E0743...has been nested inside another type.E0744E0745E0746E0747generic parameters are declared.
E0748#count doesn'tmatch its leading
#count.E0749E0750E0751E0752async.E0753E0754#[no_mangle]should not be applied to non-ASCII items #2548#[no_mangle]should not be applied to non-ASCII items #2552E0755ffi_pureattribute was used on a non-foreign function.E0756ffi_constattribute was used on something other than a foreign functiondeclaration.
E0757ffi_constandffi_pureattributes.E0758E0761E0762E0763E0764E0765") was not terminated.E0766b") was not terminated.E0767E0768E0769struct variant.
E0770E0771E0773E0774derivewas applied on something which is not a struct, a union or an enum.E0775#[cmse_nonsecure_entry]is only valid for targets with the TrustZone-Mextension.
E0776#[cmse_nonsecure_entry]functions require a C ABIE0777#[derive].E0778instruction_setattribute was malformed.E0779instruction_setattribute.E0780doc(inline)with anonymous importsE0781C-cmse-nonsecure-callABI can only be used with function pointers.E0782dynkeyword.E0783...is no longer allowed.E0784E0785implwas written on a dyn auto trait.E0786E0787E0788#[no_coverage]attribute was applied to something which does not show upin code coverage, or is too granular to be excluded from the coverage report.
E0789E0790method.
E0791#[linkage]attribute within external blocksmust have one of the following types, which are equivalent to a nullable
pointer in C:
E0792when used fully generically (and within their defining scope).
This means
E0793E0794Enhancing errors messages:
Internal Compiler Errors:
Refactor Issues:
redefined multiple timesError #2436