Skip to content

Warn or error on path statements #400

@brson

Description

@brson
Contributor

This is pretty useless and error prone:

fn do_something_important() {
}

fn main() {
  do_something_important;
}

It's just mentioning a function, when the user probably wanted to call it. Note that it's not useless when leaving off the semi.

Activity

brson

brson commented on May 24, 2011

@brson
ContributorAuthor

Looks like compile-fail/does-nothing.rs is testing this or something similar

catamorphism

catamorphism commented on Mar 15, 2012

@catamorphism
Contributor

does_nothing tests the case where do_something_important is unresolved. This is a different situation.

added a commit that references this issue on Dec 12, 2017
added a commit that references this issue on Nov 29, 2018
added a commit that references this issue on May 2, 2020
ceea3c6
added a commit that references this issue on Mar 22, 2024
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.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @graydon@brson@catamorphism

        Issue actions

          Warn or error on path statements · Issue #400 · rust-lang/rust