Use RefCell in needless_return tests
#9016
Merged
RefCell in needless_return tests
#9016