summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/fn-defined-using-def.rs
blob: 21da34c47c9fd698b5d72bbca75dad22172b3ed1 (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() {}