]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #5188 : ben0x539/rust/doc-call-generic-fn, r=catamorphism
authorbors <bors@rust-lang.org>
Sat, 2 Mar 2013 09:00:41 +0000 (01:00 -0800)
committerbors <bors@rust-lang.org>
Sat, 2 Mar 2013 09:00:41 +0000 (01:00 -0800)
I have seen a few people confused on how to explicitly instantiate generic functions, since the syntax differs from C++'s and C#'s, which is probably where most people asking questions about generic functions are coming from. The only use of the `::<T>` syntax in the reference right now is in the section on paths, which is possibly not where someone trying to find out about generic functions is going to start looking. The tutorial doesn't mention it at all, but I think it's all right to make the reference a tiny bit more redundant and avoid stuffing the tutorial with syntax details.

----

The "Generic functions" subsection mentions that generic functions are instantiated based on context, so let's also mention right away (with a link to the #paths section) that an explicit form is available.

This also adds an example that explicitly instantiates a generic function to the function call expression section.

1  2 
doc/rust.md

diff --cc doc/rust.md
Simple merge