Collect instead of print warnings in 'warnUnnecessarySourceImports'.