Hi ... This question is not asking why I shouldn't use a global variable or asking what is a much better way to do this besides using globals, I just want to first understand this exercise. Specifically I have two related questions on the topic:
First, how would I modify the syntax on lines 21 and or 28 here: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=c6923e21b43dcdf636b7900b2d8713ed In order to get this code to compile. What I am attempting to have here is a reference to an object that implements the trait FooInterface. Moreover, I want the global to be a mutable reference and I want the the object being pointed to to also be mutable. Is this possible with minor changes to my syntax at the playground.
The second question is about the lack of an error message about "statics require immutable values". I can not even include &mut DefaultFoo on my system which is running 1.40 nightly but the playground lets me write this syntax with out error. Is this syntax that was allowed before but now isn't?
I hope I've asked a question that makes sense and in a way that makes sense. Thanks.