Add example of estimating pi using Monte Carlo simulation to std::rand
Remove the dist function; it is more efficient to compare squared distances
Guide: patterns.

Fixes #4417.
Guide: iterators
Guide: array subscript notation
libcore: Get rid of useless mem::forget wrapper.
Change how libgetopts handles options grouped together

As soon as an option is found that takes an argument, consume the rest
of the string and store it into i_arg. Previously this would only happen
if the character after the option was not a recognized option.

Addresses issue #16348
Guide: ownership
Include import name in import shadowing error messages.

This partially alleviates the confusing behavior in issue #16597
Update compile-fail tests due to changed diagnostics
Add compile-fail test for missing import shadowing case
Cargo begins version number at 0.0.1 instead of 0.1.0
Cargo generates "Hello, world!" instead of "Hello world!"
`input_num` is used is used instead of `guess` further in the guide
Use new Cargo file syntax
Use new Cargo starting version number
Remove repeated section and make file path generic
doc: grammar fixes
Fix TwoWaySearcher to work when used with periodic needles.

There is a check in TwoWaySearcher::new to determine whether the needle
is periodic. This is needed because during searching when a match fails,
we cannot advance the position by the entire length of the needle when
it is periodic, but can only advance by the length of the period.

The reason "bananas".contains("nana") (and similar searches) were
returning false was because the periodicity check was wrong.

Closes #16589
libstd: Refactor Duration.

This changes the internal representation of `Duration` from

    days: i32,
    secs: i32,
    nanos: u32

to

    secs: i64,
    nanos: i32

This resolves #16466. Some methods now take `i64` instead of `i32` due
to the increased range. Some methods, like `num_milliseconds`, now
return an `Option<i64>` instead of `i64`, because the range of
`Duration` is now larger than e.g. 2^63 milliseconds.