E0308E0308 — Mismatched Types
The expected type does not match the actual type provided.
Просмотрите все 80 кодов ошибок Ошибки компилятора Rust с причинами, исправлениями и примерами.
E0308The expected type does not match the actual type provided.
E0382A value is used after it has been moved to another variable or function.
E0502A value cannot be mutably borrowed while an immutable borrow is still active.
E0597A reference outlives the data it points to.
E0277A type does not implement a required trait.
E0599The method does not exist on the given type, or the required trait is not in scope.
E0425An identifier is used but not defined in the current scope.
E0433The module path used in a use statement or type path cannot be resolved.
E0106A reference in a function signature or struct is missing a lifetime parameter.
E0015A non-const function is called in a constant expression context.
E0658A feature that is not yet stabilized in Rust is being used without the feature gate.
E0609The struct or union does not have a field with the given name.
E0614The dereference operator (*) is used on a type that does not implement Deref.
E0499A value is borrowed mutably more than once at the same time.
E0503A value cannot be used while it is mutably borrowed by another variable.
E0505A value is moved while it is still borrowed by a reference.
E0507You are trying to move a value out of a reference, which would leave the reference dangling.
E0515A function tries to return a reference to a value that is created inside the function.
E0432The module or item referenced in a use statement cannot be found.
E0412A type name is used but not defined or imported in the current scope.
E0423A type name is used where a value was expected.
E0424The self keyword is used outside of a method or associated function context.
E0369A binary operator is used with types that do not support it.
E0384A variable is being reassigned but was not declared as mutable.
E0061A function was called with the wrong number of arguments.
E0063A struct is being constructed without all required fields.
E0107A generic type or function is used with the wrong number of type parameters.
E0117You are implementing a foreign trait for a foreign type, violating the orphan rule.
E0119Two or more implementations of the same trait exist for the same type.
E0133An unsafe function or operation is used outside of an unsafe block.
E0152A language item (#[lang = ...]) is defined more than once.
E0200An unsafe trait must be implemented with an unsafe impl block.
E0252Two imports bring the same name into scope.
E0255A local definition conflicts with an imported name.
E0271An associated type in a trait implementation does not match the expected type.
E0282Rust cannot infer the type of a value and needs an explicit annotation.
E0283Multiple trait implementations could apply, and Rust cannot determine which one to use.
E0310A generic type parameter does not satisfy a required lifetime bound.
E0317An if expression used as a value is missing an else branch.
E0373A closure captures a reference to a variable that may not live long enough.
E0392A generic type or lifetime parameter is declared but not used in the struct or enum.
E0404A type was used where a trait was expected.
E0405A trait name is used but not defined or imported in the current scope.
E0428An item with the same name is defined more than once in the same scope.
E0463The specified crate cannot be found by the compiler.
E0520Trait implementation specialization requires a nightly compiler feature.
E0596You are trying to mutably borrow a value that is not declared as mutable.
E0600A unary operator is applied to a type that does not support it.
E0601The binary crate does not have a main function entry point.
E0603You are trying to access a private item from outside its module.
E0621A function parameter needs an explicit lifetime annotation to satisfy the borrow checker.
E0308Different match arms return incompatible types.
E0716A reference is held to a temporary value that is immediately dropped.
E0728The .await keyword is used in a function that is not declared async.
panic-unwrapThe program panicked because unwrap() was called on a None or Err value.
panic-index-out-of-boundsThe program panicked because an index was out of the valid range for a collection.
panic-integer-overflowThe program panicked because an arithmetic operation caused integer overflow in debug mode.
panic-stack-overflowThe program panicked due to excessive stack usage, typically from deep recursion.
clippy::needless_returnA return keyword is used unnecessarily at the end of a function.
clippy::let_and_returnA variable is declared and immediately returned on the next line.
clippy::unused_importsAn imported item is not used anywhere in the file.
clippy::clone_on_copyThe clone() method is called on a type that implements Copy.
clippy::unwrap_usedThe unwrap() method is used, which may panic at runtime.
dead_codeA function, struct, enum variant, or constant is defined but never used.
unused_variablesA variable is declared but never used in the code.
unused_mutA variable is declared as mutable but never actually mutated.
E0046Not all required methods of a trait are implemented.
E0053The method signature in an impl block does not match the trait's method signature.
E0277A type that does not implement Send is used in a context that requires thread-safety.
E0277A dynamically sized type (DST) is used where a Sized type is required.
E0277A type is used in a for loop or iterator context but does not implement Iterator.
E0308The closure returns a different type than expected by the context.
E0562The impl Trait syntax is used in a position where it is not allowed.
E0308The function returns a Result with the wrong Ok or Err type.
E0277A type is used as a callable but does not implement Fn, FnMut, or FnOnce.
panic-divide-by-zeroThe program panicked because of an integer division by zero.
panic-slice-index-out-of-rangeThe program panicked because a slice range is out of bounds.
clippy::map_unwrap_orUsing .map().unwrap_or() can be replaced with .map_or().
clippy::single_matchA match expression with only one meaningful arm can be simplified to an if let.
clippy::redundant_closureA closure that just calls a function can be replaced with the function itself.