turn unused module into a warning

This commit is contained in:
Folkert 2020-12-13 22:18:39 +01:00
parent a5e93cc21b
commit 407f8b9321
2 changed files with 36 additions and 17 deletions

View file

@ -28,15 +28,22 @@ pub fn can_problem<'b>(
.append(alloc.reflow(line)),
])
}
Problem::UnusedImport(module_id, region) => alloc.concat(vec![
alloc.reflow("Nothing from "),
alloc.module(module_id),
alloc.reflow(" is used in this module."),
alloc.region(region),
alloc.reflow("Since "),
alloc.module(module_id),
alloc.reflow(" isn't used, you don't need to import it."),
]),
Problem::UnusedImport(module_id, region) => {
alloc.stack(vec![
alloc.concat(vec![
alloc.reflow("Nothing from "),
alloc.module(module_id),
alloc.reflow(" is used in this module."),
]),
alloc.region(region),
alloc.concat(vec![
alloc.reflow("Since "),
alloc.module(module_id),
alloc.reflow(" isn't used, you don't need to import it."),
])
])
}
Problem::ExposedButNotDefined(symbol) => {
alloc.stack(vec![
alloc