Skip to content

Tracking issue for super_or_self_in_global_path compatibility lint #36888

Closed

Description

@petrochenkov

What is this lint about

Paths starting with self or super 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:

mod m {
    struct S;

    use ::self::S as Z; // <- was accepted, the path was still interpreted as relative despite `::`
}

#32403 fixed this oversight.

How to fix this warning/error

Remove :: from the path starting with ::self or ::super.

Current status

Activity

  1. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Oct 7, 2016
  2. added
    B-unstableBlocker: Implemented in the nightly compiler and unstable.
    on Mar 1, 2017
  3. added a commit that references this issue on Jun 1, 2017
  4. added a commit that references this issue on Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.B-unstableBlocker: Implemented in the nightly compiler and unstable.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions