You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
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.
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).
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.
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:
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).
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).
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.
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.
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.
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:
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:
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:
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.
Error Description: This error occurs when there is an unsatisfied outlives bound involving an
elided region and a generic type parameter or associated type.
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.
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.
Error Description: An identifier was used like a function name or a value was expected and the
identifier exists but it belongs to a different namespace.
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.
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.
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.
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.
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.
Error Description: This error indicates that there is a mismatch between generic parameters and
impl Trait parameters in a trait declaration versus its impl.
Error Description: A struct, enum, or union with the repr(transparent) representation hint
contains a zero-sized field that requires non-trivial alignment.
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.
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.
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:
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
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:
rich-loc
&errorcode
in parser & expansion errors #2542richloc
to paser errors #2566rich_location *
function #2574ErrorCode
location after theerror:
#2522List of ErrorCodes:
E0004
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.
E0005
that a name will be extracted in all cases.
[E0005]
#2508x
in this scope #2509E0010
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
variable cannot refer to a static variable.
E0015
const
function was called in aconst
context.E0023
E0025
E0026
E0027
struct's fields.
E0029
E0030
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
E0034
has the same prototype.
E0038
Trait
there 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
.E0040
E0044
E0045
E0046
E0049
const parameters.
E0050
parameters.
E0053
and the trait definition.
E0054
[E0054-E0604-E0620-E0606]
TypeCasting ErrorCodes #2528E0055
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
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 atuple. Otherwise function call notation cannot be used and the trait will not be
implemented by closures.
E0060
takes a minimum number of arguments. For example, consider C's variadic
printf
function:
E0061
E0062
E0063
E0067
E0069
return;
statement butwhose return type is not
()
.E0070
E0071
or enum variant.
E0072
E0075
#[simd]
attribute was applied to an empty tuple struct.E0076
#[simd]
attribute.
E0077
#[simd]
attribute.
E0080
E0081
E0084
E0091
E0092
E0093
E0094
E0106
inside a function signature, the problem may be with failing to adhere to the
lifetime elision rules (see below).
E0107
E0109
E0116
E0117
E0118
enum, union, or trait object.
E0119
E0120
enums can implement Drop.
E0121
_
was used within a type on an item's signature.E0124
x
is already declared in struct #2397E0128
E0130
E0131
main
function was defined with generic parameters.E0132
start
attribute was declared with type parameters.E0133
E0138
#[start]
attribute.E0152
E0158
const
,const
parameter orstatic
has been referencedin a pattern.
E0161
E0164
pattern.
E0170
E0178
+
type operator was used in an ambiguous context.E0183
Fn*
trait.E0184
Copy
trait was implemented on a type with aDrop
implementation.Copy
trait was implemented onDrop implementation type
- [E0184] #2510E0185
implementation of the trait declared the same function to be a method (i.e., to
take a
self
parameter).E0186
self
parameter), but an implementation of the trait declared the same functionto be static.
E0191
E0195
E0197
E0198
E0199
E0200
E0201
etc.) were defined with the same identifier.
E0203
E0204
Copy
trait was implemented on a type which contains a field that doesn'timplement the
Copy
trait.E0206
Copy
trait was implemented on a type which is neither a struct, anenum, nor a union.
E0207
impl
is notconstrained.
E0210
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
a trait with uninferred generic parameters.
E0214
E0220
E0221
E0222
E0223
E0224
E0225
E0226
E0227
exactly one unique region in the set of derived region bounds.
E0228
be specified.
E0229
and
where
clause.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:
E0252
items under a new local name.
E0253
to import a method from a trait.
E0254
already been imported.
E0255
module.
E0259
that has been imported into the current module.
E0260
E0261
E0262
E0264
E0267
break
orcontinue
) was used inside a closure but outside ofany loop.
E0267
#2454E0268
break
orcontinue
) was used outside of a loop.E0267
#2454E0271
E0275
E0276
E0277
expected that trait.
E0282
E0283
E0284
return type of a function or method which is generic on return type, such
as the
collect
method forIterator
s.E0307
self
parameter in a method has an invalid "receiver type".E0308
if
contains&str
instead ofbool
#2495E0309
enough.
E0310
does not live long enough.
E0311
elided region and a generic type parameter or associated type.
E0316
where
clause contains a nested quantification over lifetimes.E0317
if
expression is missing anelse
block.E0320
E0321
or enum type.
E0322
are provided automatically by the compiler.
E0323
E0438
#2481E0324
unknown trait item
#2478E0325
E0326
E0328
Unsize are provided automatically by the compiler.
E0364
attempted to
pub use
a type or value that was not itself public.E0365
attempted to
pub use
a module that was not itself public.E0366
Drop
on a concrete specialization of ageneric type. An example is shown below:
E0367
Drop
on a specialization of a generic type.E0368
+=
or^=
was applied to a type thatdoesn't support it.
E0369
E0370
set in the next enum value.
E0371
E0373
E0374
CoerceUnsized
was implemented on a struct which does not contain a field withan unsized type.
E0375
CoerceUnsized
was implemented on a struct which contains more than one fieldwith an unsized type.
E0376
CoerceUnsized
was implemented on something that isn't a struct.E0377
CoerceUnsized
may only be implemented for a coercion betweenstructures with the same definition.
E0378
DispatchFromDyn
trait was implemented on something which is not a pointeror a newtype wrapper around a pointer.
E0379
E0380
E0381
E0382
E0384
E0390
E0391
E0392
E0393
Self
in its default value was not specified.E0399
E0401
they are embedded in.
E0403
E0404
or
impl
.E0405
E0407
implementation.
E0408
across patterns.
E0409
across patterns.
E0411
Self
keyword was used outside an impl, trait, or type definition.E0412
E0415
E0416
E0422
E0423
identifier exists but it belongs to a different namespace.
E0424
self
keyword was used inside of an associated function without a "self
receiver" parameter.
E0425
E0426
E0428
E0429
self
keyword cannot appear alone as the last segment in ause
declaration.
E0430
self
import appears more than once in the list.E0431
self
import was made.self
import was made #2501E0432
E0433
[E0005]
#2508[E0001]
warning #2511E0434
E0435
E0436
E0437
in the trait was used when implementing the trait.
E0438
E0438
#2481in the trait was used when implementing the trait.
E0445
E0446
E0449
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
E0452
E0453
forbid
directive set as anattribute on an enclosing scope, or on the command line with the
-F
option.E0454
E0455
E0457
..
only found in rlib format, but must be available in dylib format.E0458
E0459
E0460
..
which..
depends on.E0461
..
with expected target triple..
.E0462
staticlib
..
instead ofrlib
ordylib
.E0463
E0464
E0466
E0468
E0469
E0472
asm!
) is not supported on this target.E0476
E0478
E0491
E0492
E0493
Drop
implementation may be dropped during const-eval.E0496
E0498
plugin
attribute was malformed.E0499
E0500
E0501
E0502
E0503
E0505
E0506
E0507
E0508
E0509
implements the
Drop
trait.E0510
E0511
E0512
E0514
rustc
.E0515
E0516
typeof
keyword 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.
E0519
of metadata.
E0520
specialized further.
E0521
E0522
E0524
at the same time.
E0525
E0527
elements in the array being matched.
E0528
matched array.
E0529
E0530
E0531
E0532
E0533
match pattern.
E0534
inline
attribute was malformed.E0535
inline
attribute.E0536
not
cfg-predicate was malformed.E0537
cfg
attribute.E0538
E0539
E0541
E0542
since
value is missing in a stability attribute.E0543
note
value is missing in a stability attribute.E0544
E0545
issue
value is incorrect in a stability attribute.E0546
feature
value is missing in a stability attribute.E0547
issue
value is missing in a stability attribute.E0549
deprecated
attribute wasn't paired with astable
/unstable
attribute with#![feature(staged_api)]
enabled.E0550
E0551
E0552
repr options
error support #2517E0554
beta compilers will not comply.
E0556
feature
attribute was badly formed.E0557
E0559
E0560
E0561
pointer type.
E0562
impl Trait
for some traitTrait
) are onlyallowed as function and inherent impl return types.
E0565
E0566
E0567
E0568
E0569
#[may_dangle]
attribute, thenthat impl must be declared as an
unsafe impl
.E0570
E0571
break
statement with an argument appeared in a non-loop
loop.E0572
E0573
Type
got something else #2479E0574
expected.
E0575
E0576
E0577
E0578
E0579
E0580
main
function was incorrectly declared.E0581
fn
type, a lifetime appears only in the return typeand not in the arguments types.
E0582
types to the trait.
E0583
E0584
E0585
E0586
E0587
packed
andalign
representation hints.E0588
packed
representation hint has a field withalign
representation hint.
E0589
N
that was specified forrepr(align(N))
was not a powerof two, or was greater than 2^29.
E0590
break
orcontinue
keywords were used in a condition of awhile
loopwithout a label.
E0591
foo
:E0592
name.
E0593
Fn
-based type with an incorrect number of argumentsthan what was expected.
E0594
E0596
E0597
E0599
E0600
E0601
main
function was found in a binary crate.bin
crate type with others -[E0601]
#2512E0602
E0603
E0604
char
was attempted on a type other thanu8
.[E0054-E0604-E0620-E0606]
TypeCasting ErrorCodes #2528E0605
E0606
[E0054-E0604-E0620-E0606]
TypeCasting ErrorCodes #2528E0607
E0608
std::ops::Index
trait was performed.
E0609
- GodBoltE0610
E0614
E0615
E0616
E0617
variadic
function #2627E0618
E0620
[E0054-E0604-E0620-E0606]
TypeCasting ErrorCodes #2528E0621
function signature (i.e., the parameter types and the return type) and the
data-flow found in the function body.
E0622
E0623
E0624
E0625
E0626
yield point.
E0627
E0628
E0631
E0634
packed
representation hints.E0635
#![feature]
attribute specified an unknown feature.E0636
#![feature]
attribute was declared multiple times.E0637
'_
lifetime name or&T
without an explicit lifetime name has been usedon illegal place.
E0638
non-exhaustively as it has been marked as
non_exhaustive
.E0639
instantiated from outside of the defining crate as it has been marked
as
non_exhaustive
and as such more fields/variants may be added infuture that could cause adverse side effects for this code.
E0640
E0641
E0642
E0643
impl Trait parameters in a trait declaration versus its impl.
E0644
E0646
main
with a where clause.E0647
start
function was defined with a where clause.E0648
export_name
attribute contains null characters (\0
).E0657
E0658
E0659
E0666
impl Trait
types cannot appear nested in the generic arguments of otherimpl Trait
types.E0667
impl Trait
is not allowed in path parameters.E0670
async fn
.E0689
E0690
repr(transparent)
had two or more fieldsthat were not guaranteed to be zero-sized.
E0691
repr(transparent)
representation hintcontains a zero-sized field that requires non-trivial alignment.
E0692
repr(transparent)
type was also annotated with other, incompatiblerepresentation hints.
E0693
align
representation hint was incorrectly declared.E0695
break
statement without a label appeared inside a labeled block.E0696
continue
keyword incorrectly.E0697
static
.E0698
generator can be constructed.
E0699
E0700
impl Trait
return type captures lifetime parameters that do notappear within the
impl Trait
itself.E0701
#[non_exhaustive]
attribute was incorrectly placedon something other than a struct or enum.
E0703
E0704
E0705
#![feature]
attribute was declared for a feature that is stable in thecurrent edition, but not in all editions.
E0706
async fn
s are not yet supported in traits in Rust.E0708
async
non-move
closures with parameters are currently not supported.E0710
E0711
E0712
the lifetime of the function.
E0713
lifetime of a type that implements the
Drop
trait.E0714
#[marker]
trait contained an associated item.E0715
impl
for a#[marker]
trait tried to override an associated item.E0716
E0717
E0718
#[lang = ".."]
attribute was placed on the wrong item type.E0719
E0720
impl Trait
type expands to a recursive type.impl Trait
type expands to a recursive type[E0720]
#2523E0722
optimize
attribute was malformed.E0724
#[ffi_returns_twice]
was used on something other than a foreign functiondeclaration.
E0725
command line flags.
E0726
E0727
yield
clause was used in anasync
context.E0728
await
] has been used outside [async
] function or [async
] block.E0729
E0730
E0731
repr(transparent)
had zero or more thanone variants.
E0732
enum
with a discriminant must specify a#[repr(inttype)]
.E0733
async
] function used recursion without boxing.E0734
E0735
Self
on 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.E0740
union
was declared with fields with destructors.E0741
E0742
item.
E0743
...
has been nested inside another type.E0744
E0745
E0746
E0747
generic parameters are declared.
E0748
#
count doesn'tmatch its leading
#
count.E0749
E0750
E0751
E0752
async
.E0753
E0754
#[no_mangle]
should not be applied to non-ASCII items #2548#[no_mangle]
should not be applied to non-ASCII items #2552E0755
ffi_pure
attribute was used on a non-foreign function.E0756
ffi_const
attribute was used on something other than a foreign functiondeclaration.
E0757
ffi_const
andffi_pure
attributes.E0758
E0761
E0762
E0763
E0764
E0765
"
) was not terminated.E0766
b"
) was not terminated.E0767
E0768
E0769
struct variant.
E0770
E0771
E0773
E0774
derive
was 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]
.E0778
instruction_set
attribute was malformed.E0779
instruction_set
attribute.E0780
doc(inline)
with anonymous importsE0781
C-cmse-nonsecure-call
ABI can only be used with function pointers.E0782
dyn
keyword.E0783
...
is no longer allowed.E0784
E0785
impl
was written on a dyn auto trait.E0786
E0787
E0788
#[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.
E0789
E0790
method.
E0791
#[linkage]
attribute within external blocksmust have one of the following types, which are equivalent to a nullable
pointer in C:
E0792
when used fully generically (and within their defining scope).
This means
E0793
E0794
Enhancing errors messages:
Internal Compiler Errors:
Refactor Issues:
redefined multiple times
Error #2436The text was updated successfully, but these errors were encountered: