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.
libstd: Limit Duration range to i64 milliseconds.

This enables `num_milliseconds` to return an `i64` again instead of
`Option<i64>`, because it is guaranteed not to overflow.

The Duration range is now rougly 300e6 years (positive and negative),
whereas it was 300e9 years previously. To put these numbers in
perspective, 300e9 years is about 21 times the age of the universe
(according to Wolfram|Alpha). 300e6 years is about 1/15 of the age of
the earth (according to Wolfram|Alpha).
win64: Add missing #[repr(C)]

Signed-off-by: Peter Atashian <retep998@gmail.com>
configure: Recognize i686 build on msys2
librustc: Properly tag upvars in proc's to stop misleading unused_mut warnings.
Add support for trailing commas in more places

This lets the parser understand trailing commas in method calls, method
definitions, enum variants, and type parameters.

Closes #14240.
Closes #15887.
auto merge of #16667 : retep998/rust/master, r=pcwalton
Improve TwoWaySearcher comments.
test: Convert Window path to MSYS path

When MSYS shell executes program, if its arguments look like MSYS paths,
MSYS automatically converts them into Windows paths.
For example, `/c/path:/d/path` becomes `C:\path;D:\path`.
However, if there is only one path e.g. `/c/path`, it becomes `C:/path`.

maketest.py reverts the behavior to reduce confusion between MSYS and
Windows, but it didn't handle the `/c/path` case. This patch fixes the
issue.

Fixes #15297
Fixes #15250
Add tests.
auto merge of #16675 : luqmana/rust/pmu, r=alexcrichton

Fixes #16671.
Fix intptr_t on win64
Remove stage0 attributes.
Complete renaming of win32 to windows
auto merge of #16692 : vadimcn/rust/fix-win64, r=luqmana

This fixes fallout from 2dc2ac1e6b382b8c658071f61c3f95ae444dcc16, which did not take into account win64.
Add test for #10618 and #16382

Closes #10618
Closes #16382
libunicode: optimize char functions for ascii characters
core: Separate failure formatting in str methods slice, slice_to, slice_from

Use a separate inline-never function to format failure message for
str::slice() errors.

Using strcat's idea, this makes sure no formatting code from failure is
inlined when str::slice() is inlined. The number of `unreachable` being
inlined when usingi `.slice()` drops from 5 to just 1.
Guide: Make add_three_times_four() public