Skip to content

Commit 5d40ba5

Browse files
authored
Merge pull request #829 from ehuss/fully-qualified-links
Add some links to Disambiguating Function Calls.
2 parents e47ed02 + e06136b commit 5d40ba5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/expressions/call-expr.md

+10-8
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ let name: &'static str = (|| "Rust")();
2525

2626
## Disambiguating Function Calls
2727

28-
Rust treats all function calls as sugar for a more explicit, fully-qualified
29-
syntax. Upon compilation, Rust will desugar all function calls into the explicit
28+
Rust treats all function calls as sugar for a more explicit, [fully-qualified
29+
syntax]. Upon compilation, Rust will desugar all function calls into the explicit
3030
form. Rust may sometimes require you to qualify function calls with trait,
3131
depending on the ambiguity of a call in light of in-scope items.
3232

@@ -42,8 +42,8 @@ referent of method or associated function calls. These situations may include:
4242
* Multiple in-scope traits define methods with the same name for the same types
4343
* Auto-`deref` is undesirable; for example, distinguishing between methods on a
4444
smart pointer itself and the pointer's referent
45-
* Methods which take no arguments, like `default()`, and return properties of a
46-
type, like `size_of()`
45+
* Methods which take no arguments, like [`default()`], and return properties of a
46+
type, like [`size_of()`]
4747

4848
To resolve the ambiguity, the programmer may refer to their desired method or
4949
function using more specific paths, types, or traits.
@@ -93,9 +93,11 @@ fn main() {
9393

9494
Refer to [RFC 132] for further details and motivations.
9595

96-
[`std::ops::Fn`]: ../../std/ops/trait.Fn.html
97-
[`std::ops::FnMut`]: ../../std/ops/trait.FnMut.html
98-
[`std::ops::FnOnce`]: ../../std/ops/trait.FnOnce.html
9996
[RFC 132]: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md
100-
10197
[_Expression_]: ../expressions.md
98+
[`default()`]: ../../std/default/trait.Default.html#tymethod.default
99+
[`size_of()`]: ../../std/mem/fn.size_of.html
100+
[`std::ops::FnMut`]: ../../std/ops/trait.FnMut.html
101+
[`std::ops::FnOnce`]: ../../std/ops/trait.FnOnce.html
102+
[`std::ops::Fn`]: ../../std/ops/trait.Fn.html
103+
[fully-qualified syntax]: ../paths.md#qualified-paths

0 commit comments

Comments
 (0)