23fb026
M Nordrhein-Westfalen, M Borace, M GetSpeed, M run_as_a_pro - ddnet-mapslet b = 2;
{
let b = &b;
}
struct A { r: Rc<...> }
struct B { r: Rc<..>, a: A } // same rc as above
impl A { fn func() {r.borrow_mut().dosmth}}
impl B { fn func() {let borrowered = r.borrow_mut();
a.func(); // panic bcs a and b will borrow_mut at same time
}}
let b = B::...;
b.func();
(edited)struct A { r: Rc<...> }
struct B { r: Rc<..>, a: A } // same rc as above
impl A { fn func() {r.borrow_mut().dosmth}}
impl B { fn func() {let borrowered = r.borrow_mut();
a.func(); // panic bcs a and b will borrow_mut at same time
}}
let b = B::...;
b.func();
(edited)Eof
we can reduce to a CommaNoTrailing<"identifier">
but we can also reduce to a SemiColonNoTrailing<RecordSection>
a.func()
is happening you are already holding a mut ref outside it so it panics, but technically it's sane. The second mut borrow is the only one in scopestruct A { r: Rc<...> }
struct B { r: Rc<..>, a: A } // same rc as above
impl A { fn func() {r.borrow_mut().dosmth}}
impl B { fn func() {let borrowered = r.borrow_mut();
a.func(); // panic bcs a and b will borrow_mut at same time
}}
let b = B::...;
b.func();
(edited)struct A { r: Rc<...> }
struct B { r: Rc<..>, a: A } // same rc as above
impl A { fn func() {r.borrow_mut().dosmth}}
impl B { fn func() {let borrowered = r.borrow_mut();
a.func(); // panic bcs a and b will borrow_mut at same time
}}
let b = B::...;
b.func();
(edited)use std::{cell::RefCell, rc::Rc};
struct A {
r: Rc<RefCell<String>>,
}
struct B {
r: Rc<RefCell<String>>,
a: A,
}
impl A {
pub fn funca(&self) {
let _ = self.r.borrow_mut();
}
}
impl B {
pub fn funcb(&self) {
let borrowed = self.r.borrow_mut();
self.a.funca();
}
}
fn main() {
let r: Rc<RefCell<String>> = Default::default();
let x = B {
r: r.clone(),
a: A { r },
};
x.funcb();
}
use std::{cell::RefCell, rc::Rc};
struct A {
}
struct B {
r: Rc<RefCell<String>>,
a: A,
}
impl A {
pub fn funca(&self, r: &mut String) {
r.push('a');
}
}
impl B {
pub fn funcb(&self) {
let mut borrowed = self.r.borrow_mut();
self.a.funca(&mut borrowed);
}
}
fn main() {
let r: Rc<RefCell<String>> = Default::default();
let x = B {
r: r.clone(),
a: A{},
};
x.funcb();
}
A
s that maybe nested far deeper in hierarchy than in hereCComponent
and CGraphics
key
/index
to that storage can be invalidexport
of sorts. With visibility only within that chain of calls until the function who initially exported it returns%
and _
git submodule update --init --recursive
export
of sorts. With visibility only within that chain of calls until the function who initially exported it returns Option<>
to me%
?Stream
is kinda close but it still lacks the ability to yield to a specific destinationStream
is kinda close but it still lacks the ability to yield to a specific destination yield 5
you get something like yield coro_b 5