Remove invalid lint when there is a generic argument in prefix path
This commit is contained in:
parent
fca59ab5f0
commit
c9be1a71b6
@ -3944,11 +3944,12 @@ fn resolve_qpath(
|
|||||||
|
|
||||||
if path.len() > 1
|
if path.len() > 1
|
||||||
&& let Some(res) = result.full_res()
|
&& let Some(res) = result.full_res()
|
||||||
|
&& let Some((&last_segment, prev_segs)) = path.split_last()
|
||||||
|
&& prev_segs.iter().all(|seg| !seg.has_generic_args)
|
||||||
&& res != Res::Err
|
&& res != Res::Err
|
||||||
&& path[0].ident.name != kw::PathRoot
|
&& path[0].ident.name != kw::PathRoot
|
||||||
&& path[0].ident.name != kw::DollarCrate
|
&& path[0].ident.name != kw::DollarCrate
|
||||||
{
|
{
|
||||||
let last_segment = *path.last().unwrap();
|
|
||||||
let unqualified_result = {
|
let unqualified_result = {
|
||||||
match self.resolve_path(&[last_segment], Some(ns), None) {
|
match self.resolve_path(&[last_segment], Some(ns), None) {
|
||||||
PathResult::NonModule(path_res) => path_res.expect_full_res(),
|
PathResult::NonModule(path_res) => path_res.expect_full_res(),
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
#![deny(unused_qualifications)]
|
||||||
|
// check-pass
|
||||||
|
fn bar() {
|
||||||
|
match Option::<Option<()>>::None {
|
||||||
|
Some(v) => {}
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Reference in New Issue
Block a user