Tracking issue for super_or_self_in_global_path
compatibility lint
#36888
Labels
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
B-unstable
Blocker: Implemented in the nightly compiler and unstable.
What is this lint about
Paths starting with
self
orsuper
are relative by definition, "global" prefix::
used to indicate absolute paths doesn't make sense on them.However, older versions of the compiler sometimes (e.g. in imports) accepted and ignored such prefixes:
#32403 fixed this oversight.
How to fix this warning/error
Remove
::
from the path starting with::self
or::super
.Current status
use
directives can begin withsuper
orself
#32225 #32403 introduces thesuper_or_self_in_global_path
lint as warn-by-defaultsuper_or_self_in_global_path
lint deny-by-defaultsuper_or_self_in_global_path
lint a hard errorThe text was updated successfully, but these errors were encountered: