Skip to content

Commit

Permalink
Merge pull request #454 from luketpeterson/main
Browse files Browse the repository at this point in the history
Fixing build.  Mutable casts are now illegal in Rust 1.73.0
  • Loading branch information
vsbogd authored Oct 9, 2023
2 parents 85bedd2 + 922da80 commit ae422df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions c/src/metta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl From<Shared<Tokenizer>> for tokenizer_t {

impl tokenizer_t {
fn borrow_inner(&self) -> &mut Tokenizer {
let cell = unsafe{ &mut *(&(&*self.tokenizer).0 as *const std::cell::RefCell<Tokenizer>).cast_mut() };
let cell = unsafe{ &mut (&mut *self.tokenizer.cast_mut()).0 };
cell.get_mut()
}
fn clone_handle(&self) -> Shared<Tokenizer> {
Expand Down Expand Up @@ -162,7 +162,7 @@ impl From<Shared<SExprParser<'static>>> for sexpr_parser_t {

impl sexpr_parser_t {
fn borrow_inner(&self) -> &mut SExprParser<'static> {
let cell = unsafe{ &mut *(&(&*self.parser).0 as *const std::cell::RefCell<SExprParser>).cast_mut() };
let cell = unsafe{ &mut (&mut *self.parser.cast_mut()).0 };
cell.get_mut()
}
fn into_handle(self) -> Shared<SExprParser<'static>> {
Expand Down
2 changes: 1 addition & 1 deletion c/src/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ impl From<SpaceObserverRef<CObserver>> for space_observer_t {

impl space_observer_t {
fn borrow_inner(&self) -> &mut CObserver {
let cell = unsafe{ &mut *(&(&*self.observer).0 as *const std::cell::RefCell<CObserver>).cast_mut() };
let cell = unsafe{ &mut (&mut *self.observer.cast_mut()).0 };
cell.get_mut()
}
fn into_inner(self) -> SpaceObserverRef<CObserver> {
Expand Down

0 comments on commit ae422df

Please sign in to comment.