StackOverflow Questions for Tag: borrow-checker

Anton
Anton

Reputation: 472

Convert enum to another enum in Rust while selectively moving contained values

Score: 0

Views: 178

Answers: 1

Read More
Skru
Skru

Reputation: 115

Lifetime issues with async closure in rust

Score: 0

Views: 162

Answers: 1

Read More
Mohamed Anwar
Mohamed Anwar

Reputation: 1

Rust borrow checker error in Observer pattern implementation

Score: 0

Views: 41

Answers: 0

Read More
Jan Holthuis
Jan Holthuis

Reputation: 181

Why can't I move out of a shared reference to an owned vec which is not used afterwards?

Score: 1

Views: 79

Answers: 1

Read More
Archie Mourad
Archie Mourad

Reputation: 61

Managing lifetime(s) in Rust: How do I ensure that variable(s) live 'long enough'?

Score: 1

Views: 76

Answers: 1

Read More
user3188445
user3188445

Reputation: 4784

When do you need references and trait objects to have different lifetimes?

Score: 0

Views: 67

Answers: 0

Read More
Nicholas Crothers
Nicholas Crothers

Reputation: 128

Function that returns a value in a HashMap using a parameter requires a lifetime for Struct<'a> but not for &str

Score: 0

Views: 58

Answers: 1

Read More
nicoty
nicoty

Reputation: 168

Why does mutation through a trait object fail but mutation through a function pointer work?

Score: 0

Views: 73

Answers: 1

Read More
genghiskhan
genghiskhan

Reputation: 1149

PyO3 pass mutable rust struct between Rust and Python callbacks

Score: 2

Views: 105

Answers: 0

Read More
theory
theory

Reputation: 9897

What's the best borrowing accessor pattern for Optional<String>?

Score: 4

Views: 98

Answers: 1

Read More
BallpointBen
BallpointBen

Reputation: 13867

E0503: cannot use `self.index` because it was mutably borrowed

Score: 0

Views: 46

Answers: 0

Read More
Nick Klavohn
Nick Klavohn

Reputation: 35

Why does the Rust borrow checker treat RefMut<T> differently than T or &mut T?

Score: 0

Views: 51

Answers: 0

Read More
RBF06
RBF06

Reputation: 2419

How do you get around "cannot return value referencing temporary value" generated in a closure?

Score: 0

Views: 70

Answers: 2

Read More
Jacob Birkett
Jacob Birkett

Reputation: 2135

Allow a future to store a pointer to a pinned value in its container

Score: 0

Views: 220

Answers: 1

Read More
ouuan
ouuan

Reputation: 511

Rust thinks argument is borrowed in the `impl Trait` return value and complains "borrowed value does not live long enough"

Score: 1

Views: 149

Answers: 2

Read More
ora
ora

Reputation: 1

Can't seem to figure out how to avoid using two mutable references when pattern matching in Rust

Score: 0

Views: 28

Answers: 0

Read More
spiritwalker
spiritwalker

Reputation: 11

How to organize blocking method and method with mutable &self in Rust?

Score: 0

Views: 50

Answers: 1

Read More
AndyMoose
AndyMoose

Reputation: 425

How can I hold ownership of something and call a method on it that moves the object?

Score: -1

Views: 59

Answers: 1

Read More
nbonniot
nbonniot

Reputation: 1136

Does a mutable reference means an ownership loss in Rust?

Score: 1

Views: 82

Answers: 1

Read More
nalzok
nalzok

Reputation: 16137

Semantics of lifetime parameters

Score: 9

Views: 1245

Answers: 4

Read More
PreviousPage 3Next