]> git.lizzy.rs Git - rust.git/blob - tests/ui/parser/bastion-of-the-turbofish.rs
incremental: migrate diagnostics
[rust.git] / tests / ui / parser / bastion-of-the-turbofish.rs
1 // check-pass
2
3 // Bastion of the Turbofish
4 // ------------------------
5 // Beware travellers, lest you venture into waters callous and unforgiving,
6 // where hope must be abandoned, ere it is cruelly torn from you. For here
7 // stands the bastion of the Turbofish: an impenetrable fortress holding
8 // unshaking against those who would dare suggest the supererogation of the
9 // Turbofish.
10 //
11 // Once I was young and foolish and had the impudence to imagine that I could
12 // shake free from the coils by which that creature had us tightly bound. I
13 // dared to suggest that there was a better way: a brighter future, in which
14 // Rustaceans both new and old could be rid of that vile beast. But alas! In
15 // my foolhardiness my ignorance was unveiled and my dreams were dashed
16 // unforgivingly against the rock of syntactic ambiguity.
17 //
18 // This humble program, small and insignificant though it might seem,
19 // demonstrates that to which we had previously cast a blind eye: an ambiguity
20 // in permitting generic arguments to be provided without the consent of the
21 // Great Turbofish. Should you be so naïve as to try to revolt against its
22 // mighty clutches, here shall its wrath be indomitably displayed. This
23 // program must pass for all eternity: forever watched by the guardian angel
24 // which gave this beast its name, and stands fundamentally at odds with the
25 // impetuous rebellion against the Turbofish.
26 //
27 // My heart aches in sorrow, for I know I am defeated. Let this be a warning
28 // to all those who come after: for they too must overcome the impassible
29 // hurdle of defeating the great beast, championed by a resolute winged
30 // guardian.
31 //
32 // Here stands the Bastion of the Turbofish, a memorial to Anna Harren,
33 // Guardian Angel of these Hallowed Grounds. <3
34
35 // See https://github.com/rust-lang/rust/pull/53562
36 // and https://github.com/rust-lang/rfcs/pull/2527
37 // and https://twitter.com/garblefart/status/1393236602856611843
38 // for context.
39
40 fn main() {
41     let (the, guardian, stands, resolute) = ("the", "Turbofish", "remains", "undefeated");
42     let _: (bool, bool) = (the<guardian, stands>(resolute));
43 }