From e06136b1cd06d3d72dcc0ed7ccf5fbab5574f901 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Sat, 6 Jun 2020 09:39:16 -0700 Subject: [PATCH] Add some links to Disambiguating Function Calls. --- src/expressions/call-expr.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/expressions/call-expr.md b/src/expressions/call-expr.md index 9759abd46..d913ce712 100644 --- a/src/expressions/call-expr.md +++ b/src/expressions/call-expr.md @@ -25,8 +25,8 @@ let name: &'static str = (|| "Rust")(); ## Disambiguating Function Calls -Rust treats all function calls as sugar for a more explicit, fully-qualified -syntax. Upon compilation, Rust will desugar all function calls into the explicit +Rust treats all function calls as sugar for a more explicit, [fully-qualified +syntax]. Upon compilation, Rust will desugar all function calls into the explicit form. Rust may sometimes require you to qualify function calls with trait, depending on the ambiguity of a call in light of in-scope items. @@ -42,8 +42,8 @@ referent of method or associated function calls. These situations may include: * Multiple in-scope traits define methods with the same name for the same types * Auto-`deref` is undesirable; for example, distinguishing between methods on a smart pointer itself and the pointer's referent -* Methods which take no arguments, like `default()`, and return properties of a - type, like `size_of()` +* Methods which take no arguments, like [`default()`], and return properties of a + type, like [`size_of()`] To resolve the ambiguity, the programmer may refer to their desired method or function using more specific paths, types, or traits. @@ -93,9 +93,11 @@ fn main() { Refer to [RFC 132] for further details and motivations. -[`std::ops::Fn`]: ../../std/ops/trait.Fn.html -[`std::ops::FnMut`]: ../../std/ops/trait.FnMut.html -[`std::ops::FnOnce`]: ../../std/ops/trait.FnOnce.html [RFC 132]: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md - [_Expression_]: ../expressions.md +[`default()`]: ../../std/default/trait.Default.html#tymethod.default +[`size_of()`]: ../../std/mem/fn.size_of.html +[`std::ops::FnMut`]: ../../std/ops/trait.FnMut.html +[`std::ops::FnOnce`]: ../../std/ops/trait.FnOnce.html +[`std::ops::Fn`]: ../../std/ops/trait.Fn.html +[fully-qualified syntax]: ../paths.md#qualified-paths