StackOverflow Questions for Tag: borrow-checker

Loaf
Loaf

Reputation: 61

How a function borrows a value as mutable but still be able to pass that value as a immutable borrow to another function?

Score: 0

Views: 25

Answers: 0

Read More
btilly
btilly

Reputation: 46497

How to specify lifetime for referencing a value from an iterator in order to peek its contents?

Score: 2

Views: 65

Answers: 1

Read More
Andy Galvez
Andy Galvez

Reputation: 31

Call Box<dyn FnMut> as struct field

Score: 2

Views: 69

Answers: 1

Read More
Matteo Monti
Matteo Monti

Reputation: 8970

Counter-intuitive double-borrow

Score: 1

Views: 31

Answers: 0

Read More
Omega500
Omega500

Reputation: 97

Cannot borrow `*self` as mutable more than once at a time

Score: 0

Views: 42

Answers: 0

Read More
user29771584
user29771584

Reputation: 1

Please tell us why the callbacks object is not released in this rust code

Score: 0

Views: 46

Answers: 0

Read More
user1939915
user1939915

Reputation: 1

Lifetime of `Ref<'a, &mut [u8]>` is not actualy 'a

Score: 0

Views: 71

Answers: 2

Read More
Lucas Lange
Lucas Lange

Reputation: 41

Why does the borrow checker seem to keep a reference borrowed in a match statement even after the end of the block?

Score: 4

Views: 61

Answers: 0

Read More
Johan
Johan

Reputation: 397

Best practice for self vs. static struct function to avoid duplicate borrow issue

Score: 0

Views: 61

Answers: 1

Read More
dspyz
dspyz

Reputation: 5514

How do I encapsulate waiting for a `tokio::sync::watch::Receiver` to be `Some`?

Score: 0

Views: 53

Answers: 1

Read More
Zebrafish
Zebrafish

Reputation: 14300

Why do I have to borrow the reference if the return value is already a reference?

Score: 0

Views: 38

Answers: 0

Read More
Paperino
Paperino

Reputation: 1019

How to invoke multiple methods on a mutable borrow in Rust

Score: 0

Views: 33

Answers: 0

Read More
Silvio Mayolo
Silvio Mayolo

Reputation: 70357

Why is "the temporary is part of an expression at the end of a block" an error?

Score: 10

Views: 807

Answers: 1

Read More
Adam
Adam

Reputation: 1009

What lifetime does this function have when not annotated?

Score: 0

Views: 48

Answers: 0

Read More
Ron Slosberg
Ron Slosberg

Reputation: 5

How can I remove all of the outgoing edges for a given node in a GraphMap?

Score: 0

Views: 35

Answers: 1

Read More
xm lian
xm lian

Reputation: 107

Can't understand how did the unique immutable borrows in captures work

Score: 0

Views: 109

Answers: 2

Read More
Unlikus
Unlikus

Reputation: 1858

How can I tell the compiler to release a borrow in a struct without dropping the entire struct?

Score: -1

Views: 268

Answers: 2

Read More
Phthalo Johnson
Phthalo Johnson

Reputation: 11

How to get access to the keys of a hash map as an iterator while also having a mutable reference to the hash map in Rust?

Score: 1

Views: 43

Answers: 1

Read More
pnadeau
pnadeau

Reputation: 613

Why do recent versions of Rust allow a `match` expression to return a reference to a temporary?

Score: 13

Views: 778

Answers: 1

Read More
Iris
Iris

Reputation: 28

Weird compile-time borrow error when using `RefCell<T>`

Score: 0

Views: 64

Answers: 2

Read More
PreviousPage 1Next