about summary refs log tree commit diff
path: root/tests/ui/parser/ty-path-followed-by-single-colon.rs
blob: a9082ea317a7845851a085d2a0f55b9e3f99116f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Paths in type contexts may be followed by single colons.
// This means we can't generally assume that the user typo'ed a double colon.
// issue: <https://github.com/rust-lang/rust/issues/140227>
//@ check-pass
#![crate_type = "lib"]
#![expect(non_camel_case_types)]

#[rustfmt::skip]
mod garden {

    fn f<path>() where path:to::somewhere {} // OK!

    fn g(_: impl Take<path:to::somewhere>) {} // OK!

    #[cfg(any())] fn h() where a::path:to::nowhere {} // OK!

    fn i(_: impl Take<path::<>:to::somewhere>) {} // OK!

    mod to { pub(super) trait somewhere {} }
    trait Take { type path; }

}