about summary refs log tree commit diff
path: root/tests/ui/parser/fn-defined-using-def.rs
blob: 7a040d5de72cdd7e137991a6c814d0f743d964e6 (plain)
1
2
3
4
5
6
7
8
9
10
// Check what happens when `def` is used to define a function, instead of `fn`
//@ edition:2021

#![allow(dead_code)]

def foo() {}
//~^ ERROR expected one of `!` or `::`, found `foo`
//~^^ HELP write `fn` instead of `def` to declare a function

fn main() {}