<commit_before>#![feature(plugin)]
#![plugin(clippy)]

#![deny(drop_ref)]
#![allow(toplevel_ref_arg, similar_names)]

use std::mem::drop;

struct DroppableStruct;
impl Drop for DroppableStruct { fn drop(&mut self) {} }

fn main() {
    drop(&DroppableStruct); //~ERROR call to `std::mem::drop` with a reference argument

    let mut owned = DroppableStruct;
    drop(&owned); //~ERROR call to `std::mem::drop` with a reference argument
    drop(&&owned); //~ERROR call to `std::mem::drop` with a reference argument
    drop(&mut owned); //~ERROR call to `std::mem::drop` with a reference argument
    drop(owned); //OK

    let reference1 = &DroppableStruct;
    drop(reference1); //~ERROR call to `std::mem::drop` with a reference argument
    drop(&*reference1); //~ERROR call to `std::mem::drop` with a reference argument

    let reference2 = &mut DroppableStruct;
    drop(reference2); //~ERROR call to `std::mem::drop` with a reference argument

    let ref reference3 = DroppableStruct;
    drop(reference3); //~ERROR call to `std::mem::drop` with a reference argument
}

#[allow(dead_code)]
fn test_generic_fn<T>(val: T) {
    drop(&val); //~ERROR call to `std::mem::drop` with a reference argument
    drop(val); //OK
}

#[allow(dead_code)]
fn test_similarly_named_function() {
    fn drop<T>(_val: T) {}
    drop(&DroppableStruct); //OK; call to unrelated function which happens to have the same name
    std::mem::drop(&DroppableStruct); //~ERROR call to `std::mem::drop` with a reference argument
}<commit_msg>The drop_ref test does not require implementing the Drop trait.<commit_after>#![feature(plugin)]
#![plugin(clippy)]

#![deny(drop_ref)]
#![allow(toplevel_ref_arg, similar_names)]

use std::mem::drop;

struct SomeStruct;

fn main() {
    drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument

    let mut owned = SomeStruct;
    drop(&owned); //~ERROR call to `std::mem::drop` with a reference argument
    drop(&&owned); //~ERROR call to `std::mem::drop` with a reference argument
    drop(&mut owned); //~ERROR call to `std::mem::drop` with a reference argument
    drop(owned); //OK

    let reference1 = &SomeStruct;
    drop(reference1); //~ERROR call to `std::mem::drop` with a reference argument
    drop(&*reference1); //~ERROR call to `std::mem::drop` with a reference argument

    let reference2 = &mut SomeStruct;
    drop(reference2); //~ERROR call to `std::mem::drop` with a reference argument

    let ref reference3 = SomeStruct;
    drop(reference3); //~ERROR call to `std::mem::drop` with a reference argument
}

#[allow(dead_code)]
fn test_generic_fn<T>(val: T) {
    drop(&val); //~ERROR call to `std::mem::drop` with a reference argument
    drop(val); //OK
}

#[allow(dead_code)]
fn test_similarly_named_function() {
    fn drop<T>(_val: T) {}
    drop(&SomeStruct); //OK; call to unrelated function which happens to have the same name
    std::mem::drop(&SomeStruct); //~ERROR call to `std::mem::drop` with a reference argument
}
{'fraction_non_alphanumeric': 0.1534356237491661, 'fraction_numerical': 0.004669779853235491, 'mean_word_length': 4.502752293577982, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '101004', 'n_tokens_mistral': 954, 'n_tokens_neox': 941, 'n_words': 304}