Skip to content

Warning when compiling with rustc 1.61 (or later, probably) #146

Closed
@itamarst

Description

@itamarst
warning: cannot borrow `*self` as mutable because it is also borrowed as immutable
    --> src/validator/json.rs:1989:19
     |
1900 |         Value::Object(o) => match &self.occurrence {
     |                                   ---------------- immutable borrow occurs here
...
1989 | /                   self.add_error(format!(
1990 | |                     "object must contain no more than {} entries of key of type {}",
1991 | |                     upper, ident,
     | |                     ----- immutable borrow later used here
1992 | |                   ));
     | |____________________^ mutable borrow occurs here
     |
     = warning: this borrowing pattern was not meant to be accepted, and may become a hard error in the future
     = note: for more information, see issue #59159 <https://github.com/rust-lang/rust/issues/59159>

The same warning occurs multiple times for the same code pattern used elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions