Fix trait solver overflow with non_local_definitions lint
#123594
Merged
non_local_definitions lint
#123594