libglob: allow "." and ".." to be matched

... also don't read the whole directory if the glob for that path
component doesn't contain any metacharacters.

Patterns like `../*.jpg` will work now, and `.*` will match both `.` and
`..` to be consistent with shell expansion.

As before: Just `*` still won't match `.` and `..`, while it will still
match dotfiles like `.git` by default.
libglob: only return dirs for globs ending in /

`foo.txt/` should not return `foo.txt` if `foo.txt` is in fact a text
file and not a directory.
Update an obsolete comment about conditions
auto merge of #13399 : SimonSapin/rust/patch-8, r=cmr
rustc: Prevent repeated moves out of proc upvars

This fixes the categorization of the upvars of procs (represented internally
as once fns) to consider usage to require a loan. In doing so, upvars are no
longer allowed to be moved out of repeatedly in loops and such.

Closes #10398
Closes #12041
Closes #12127
auto merge of #13383 : ben0x539/rust/glob-dots, r=brson

Fixes #12930.
auto merge of #13413 : alexcrichton/rust/once-fn-move, r=brson

This fixes the categorization of the upvars of procs (represented internally
as once fns) to consider usage to require a loan. In doing so, upvars are no
longer allowed to be moved out of repeatedly in loops and such.

Closes #10398
Closes #12041
Closes #12127
_match.rs: improve `enter_opt`

The `enter_opt` needs to know whether an arm has guard function or not.
Passes in additional argument so that it can make more precise
judgement.