]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #47726 - pietroalbini:fix-nested-empty-groups-span, r=petrochenkov
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Thu, 25 Jan 2018 14:52:18 +0000 (15:52 +0100)
committerGitHub <noreply@github.com>
Thu, 25 Jan 2018 14:52:18 +0000 (15:52 +0100)
Fix spans in unused import lint for nested groups

This fixes an inconsistency for empty nested groups, and adds a test for all the possible cases of the lint.

```
warning: unused imports: `*`, `Foo`, `baz::{}`, `foobar::*`
  --> test.rs:16:11
   |
16 | use foo::{Foo, bar::{baz::{}, foobar::*}, *};
   |           ^^^        ^^^^^^^  ^^^^^^^^^   ^
   |
   = note: #[warn(unused_imports)] on by default

warning: unused import: `*`
  --> test.rs:17:24
   |
17 | use foo::bar::baz::{*, *};
   |                        ^

warning: unused import: `use foo::{};`
  --> test.rs:18:1
   |
18 | use foo::{};
   | ^^^^^^^^^^^^
```

cc #44494


Trivial merge