How to enable feature `debug_refcell`

I try to add --features debug_refcell on run project, but it is invalid, i want to know how to display the location of last borrowed when the borrowed error happend.

Going off the runtime borrow error, it looks like either the feature is broken (i.e something is wrong internally in the code base defining the feature), or it works but is being used incorrectly (an issue external to the code base defining the feature).
Which is the case, I can't say based only on the presented information.

But in either case, if you're hell bent on using it, it would have to be fixed first.

the borrow_mut method need call at mutil position, now , I don't know which two call are conflict

(Assuming the feature works) you'd have to build your own std with the feature enabled.

1 Like

how to build std and link to my own project

I haven't done it myself,[1] but some starting points for documentation are

If you run into problems you could post questions (in this topic or another).

  1. and don't know if it's easy or difficult ↩ī¸Ž

you are right
I run that with feature=debug_refcell successful!

thank you!

note full command

cargo +nightly run --target=x86_64-apple-darwin -Zbuild-std -Zbuild-std-features="core/debug_refcell"
1 Like