Commit Graph

105247 Commits

Author SHA1 Message Date
Mazdak Farrokhzad
adaa521feb collector: extract upstream_crates 2020-01-08 21:58:41 +01:00
Mazdak Farrokhzad
bcb98bdc34 canonicalize imports in map::block 2020-01-08 21:58:41 +01:00
Yuki Okushi
4fce9c27fb Delay bug to prevent ICE in MIR borrowck 2020-01-09 05:57:28 +09:00
bors
caa231d998 Auto merge of #68011 - JohnTitor:rollup-44s8twu, r=JohnTitor
Rollup of 10 pull requests

Successful merges:

 - #67774 (Try statx for all linux-gnu target.)
 - #67781 (Move `is_min_const_fn` query to librustc_mir.)
 - #67798 (Remove wrong advice about spin locks from `spin_loop_hint` docs)
 - #67849 (Add a check for swapped words when we can't find an identifier)
 - #67875 (Distinguish between private items and hidden items in rustdoc)
 - #67887 (`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]`)
 - #67955 (rustdoc: Remove more `#[doc(cfg(..))]` duplicates)
 - #67977 (Updates for VxWorks)
 - #67985 (Remove insignificant notes from CStr documentation)
 - #68003 (ci: fix wrong shared.sh import for publish_toolstate)

Failed merges:

 - #67820 (Parse the syntax described in RFC 2632)
 - #67979 (Move `intravisit` => `rustc_hir` + misc cleanup)

r? @ghost
2020-01-08 19:46:58 +00:00
Vadim Petrochenkov
41a93cba38 Remove -Z continue-parse-after-error 2020-01-08 21:48:04 +03:00
Esteban Küber
b3b206f6bd move code to method outside of happy path 2020-01-08 10:10:51 -08:00
Josh Stone
51b7044347 Build compiletest with in-tree libtest 2020-01-08 10:04:18 -08:00
Josh Stone
7c52718ba2 Remove obsolete llvm_tools flag 2020-01-08 09:44:45 -08:00
Esteban Küber
ac3d4cccea Explain that associated types and consts can't be accessed directly on the trait's path 2020-01-08 09:41:51 -08:00
Esteban Küber
33ae3220b6 remove unnecessary Debug 2020-01-08 09:30:27 -08:00
Esteban Küber
705e0874de reduce code duplication 2020-01-08 09:30:27 -08:00
Esteban Küber
ffcdbad263 review comments 2020-01-08 09:30:27 -08:00
Esteban Küber
b522ba0237 review comments 2020-01-08 09:30:27 -08:00
Esteban Küber
542be6fb6c review comment: wording 2020-01-08 09:30:27 -08:00
Esteban Küber
0dcdbaec0b Point at the def span of trait refs E0277 2020-01-08 09:30:27 -08:00
Esteban Küber
c55615155d review comments 2020-01-08 09:29:47 -08:00
Esteban Küber
9c0000caca Point at opaque and closure type definitions in type errors 2020-01-08 09:29:47 -08:00
Esteban Küber
2c5766f2d4 Unify output of "variant not found" errors 2020-01-08 08:05:31 -08:00
Yuki Okushi
844530e317
Rollup merge of #68003 - pietroalbini:yet-another-toolstate-fix, r=Mark-Simulacrum
ci: fix wrong shared.sh import for publish_toolstate

r? @Mark-Simulacrum
2020-01-09 00:29:22 +09:00
Yuki Okushi
98a5c7dc04
Rollup merge of #67985 - dtolnay:cstr, r=Mark-Simulacrum
Remove insignificant notes from CStr documentation

The to_str and to_string_lossy methods contain a note about the behavior possibly changing in the future. But those notes are referring to a distinction that is not observable in the API. Whether or not the UTF-8 check knows the string length ahead of time, these methods require linear time.
2020-01-09 00:29:20 +09:00
Yuki Okushi
b687461073
Rollup merge of #67977 - Wind-River:master_2020, r=alexcrichton
Updates for VxWorks

r? @alexcrichton
2020-01-09 00:29:18 +09:00
Yuki Okushi
1f94425864
Rollup merge of #67955 - ollie27:rustdoc_cfg_dupes, r=GuillaumeGomez
rustdoc: Remove more `#[doc(cfg(..))]` duplicates

This is a follow up to #66959.

r? @GuillaumeGomez
2020-01-09 00:29:17 +09:00
Yuki Okushi
1c9b8036bf
Rollup merge of #67887 - anp:tracked-std-panics, r=nagisa
`Option::{expect,unwrap}` and `Result::{expect, expect_err, unwrap, unwrap_err}` have `#[track_caller]`

The annotated functions now produce panic messages pointing to the location where they were called, rather than `core`'s internals.
2020-01-09 00:29:15 +09:00
Yuki Okushi
03fe834a23
Rollup merge of #67875 - dtolnay:hidden, r=GuillaumeGomez
Distinguish between private items and hidden items in rustdoc

I believe rustdoc should not be conflating private items (visibility lower than `pub`) and hidden items (attribute `doc(hidden)`). This matters now that Cargo is passing --document-private-items by default for bin crates. In bin crates that rely on macros, intentionally hidden implementation details of the macros can overwhelm the actual useful internal API that one would want to document.

This PR restores the strip-hidden pass when documenting private items, and introduces a separate unstable --document-hidden-items option to skip the strip-hidden pass. The two options are orthogonal to one another.

Fixes #67851. Closes #60884.
2020-01-09 00:29:13 +09:00
Yuki Okushi
429a7e7522
Rollup merge of #67849 - cjkenn:check-sorted-words, r=estebank
Add a check for swapped words when we can't find an identifier

Fixes #66968

Couple things here:
1. The matches take the precedence of case insensitive match, then levenshtein match, then swapped words match. Doing this allows us to not even check for swapped words unless the other checks return `None`.
2. I've assumed that the swapped words check is not held to the limits of the max levenshtein distance threshold (ie. we want to try and find a match even if the levenshtein distance is very high). This means that we cannot perform this check in the `fold` that occurs after the `filter_map` call, because the candidate will be filtered out. So, I've split this into two separate `fold` calls, and had to collect the original iterator into a vec so it can be copied (I don't think we want to change the function signature to take a vec or require the `Copy` trait). An alternative implemenation may be to remove the `filter_map`, `fold` over the entire iterator, and do a check against `max_dist` inside the relevant cases there.

r? @estebank
2020-01-09 00:29:12 +09:00
Yuki Okushi
256f401b85
Rollup merge of #67798 - matklad:spin-thouse-docs, r=Amanieu
Remove wrong advice about spin locks from `spin_loop_hint` docs

Using a pure spin lock for a critical section in a preemptable thread
is always wrong, however short the critical section may be. The thread
might be preempted, which will cause all other threads to hammer
busily at the core for the whole quant. Moreover, if threads have
different priorities, this might lead to a priority inversion problem
and a deadlock. More generally, a spinlock is not more efficient than
a well-written mutex, which typically does several spin iterations at
the start anyway.

The advise about UP vs SMP is also irrelevant in the context of
preemptive threads.

See also accompanying piece: https://matklad.github.io/2020/01/02/spinlocs-considered-harmful.html

And another, independent piece: https://probablydance.com/2019/12/30/measuring-mutexes-spinlocks-and-how-bad-the-linux-scheduler-really-is

EDIT: obligatory disclosure that I am not an expert in these things, and might be terribly wrong :)
2020-01-09 00:29:09 +09:00
Yuki Okushi
b85b1dd465
Rollup merge of #67781 - cjgillot:passes-const, r=oli-obk
Move `is_min_const_fn` query to librustc_mir.

The only two uses of the associated methods are in `librustc_mir` and
`librustdoc`. Please tell me if there is a better choice.

cc #65031
2020-01-09 00:29:08 +09:00
Yuki Okushi
9f8f97b88b
Rollup merge of #67774 - oxalica:more-statx, r=alexcrichton
Try statx for all linux-gnu target.

After https://github.com/rust-lang/libc/pull/1577, which is contained in `libc` 0.2.66,  provides `SYS_statx` for all Linux platform, so we can try to use `statx` for ~all Linux target~ all linux-gnu targets.

Unfortunately, `struct statx` and `fn statx` is not a part of public interface of musl (currently), ~we still need to invoke it through `syscall`~ we does **not** support statx for musl or other libc impls currently.

Previous PR: #65094

cc @alexcrichton
2020-01-09 00:29:06 +09:00
wcampbell
c9a55fe3db
Spell check librustc_error_codes
Found one wrongly spelled error message and decided to check all the
error messages for wrongly spelled statements.

Signed-off-by: wcampbell <wcampbell1995@gmail.com>
2020-01-08 10:12:29 -05:00
Ximin Luo
e3f3cb9761 Recognise riscv64 in compiletest 2020-01-08 13:48:05 +00:00
Guillaume Gomez
326994dfe6 Improve E0184 explanation 2020-01-08 14:24:25 +01:00
bors
ed6468da16 Auto merge of #67770 - Centril:reduce-diversity-2, r=petrochenkov
More reductions in error handling diversity

In this follow up to https://github.com/rust-lang/rust/pull/67744, we:

- Remove all fatal / error / warning macros in `syntax` except for `struct_span_err`, which is moved to `rustc_errors`.

- Lintify some hard-coded warnings which used warning macros.

- Defatalize some errors.

In general, the goal here is to make it painful to use fatal or unstructured errors and so we hopefully won't see many of these creep in.

Fixes https://github.com/rust-lang/rust/issues/67933.
2020-01-08 12:12:08 +00:00
Pietro Albini
aabc73631e
ci: fix wrong shared.sh import for publish_toolstate 2020-01-08 12:24:01 +01:00
Camille GILLOT
c1c09bee29 Move is_min_const_fn query to librustc_mir.
The only two uses of the associated methods are in librustc_mir and
librustdoc. Please tell me if there is a better choice.
2020-01-08 10:37:37 +01:00
Camille GILLOT
588296adfe Move constness.rs to librustc_mir. 2020-01-08 10:22:04 +01:00
maik
f1fb384cd6 Check for the entry kind 2020-01-08 10:05:44 +01:00
bors
87540bd3bc Auto merge of #67760 - Mark-Simulacrum:rustc-dirty, r=alexcrichton
Clear out target directory if compiler has changed

Previously, we relied fully on Cargo to detect that the compiler had changed and
it needed to rebuild the standard library (or later "components"). This used to
not quite be the case prior to moving to LLVM be a separate cargo invocation;
subsequent compiles would recompile std and friends if LLVM had changed
(#67077 is the PR that changes things here).

This PR moves us to clearing out libstd when it is being compiled if the rustc
we're using has changed. We fairly harshly limit the cases in which we do this
(e.g., ignoring dry run mode, and so forth, as well as rustdoc invocations).
This is primarily because when we're not using the compiler directly, so
clearing out in other cases is likely to lead to bugs, particularly as our
deletion scheme is pretty blunt today (basically removing more than is needed,
i.e., not just the rustc artifacts).

In practice, this targeted fix does fix the known bug, though it may not fully
resolve the problem here. It's also not clear that there is a full fix hiding
here that doesn't involve a more major change (like -Zbinary-dep-depinfo was).

As a drive-by fix, don't delete the compiler before calling Build::copy, as that
also deletes the compiler.
2020-01-08 09:03:46 +00:00
maik
b81ab44a8f Remove unnecessary global counting 2020-01-08 09:53:33 +01:00
Yuki Okushi
c524f3ca98 Display more informative ICE 2020-01-08 17:12:19 +09:00
oxalica
f5baa03af0
Try statx for all linux-gnu targets 2020-01-08 14:21:27 +08:00
bors
f48e576756 Auto merge of #67733 - pietroalbini:gha-2, r=alexcrichton
GitHub Actions: preparations, part 2

This PR adds the second batch of commits in preparation for GitHub Actions:

* Removed hardcoded Azure Pipelines variables from `publish_toolstate.sh`
* Fixed a bug in `shared.sh`'s GitHub Actions support
* Fixed binutils missing from MSYS2 on Windows 2019 (GitHub Actions-specific)
* Fixed wrong sysroot in macOS 10.15 onwards (GitHub Actions-specific)

This PR does **not** yet add any builders on GitHub Actions.

r? @alexcrichton
2020-01-08 05:05:06 +00:00
Igor Aleksanov
f720469fd0 Use matches macro in libcore and libstd 2020-01-08 07:10:28 +03:00
Mazdak Farrokhzad
20ebb807d5 span_to_lines: account for DUMMY_SP 2020-01-08 04:25:33 +01:00
Mazdak Farrokhzad
2c3e5d3de0 - remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
2020-01-08 04:25:33 +01:00
Mazdak Farrokhzad
0a6cdc231e slice patterns: harden match-based borrowck tests 2020-01-08 00:42:53 +01:00
bors
7e393b5b3b Auto merge of #67970 - cjgillot:inherent, r=Centril
Minimize dependencies on trait and infer inside librustc

Split from #67953

All commits should pass check on their own.

r? @Centril
2020-01-07 21:23:19 +00:00
David Tolnay
48add5453b
Remove insignificant notes from CStr documentation
These notes are about a distinction that is not going to be observable
in the API. Whether or not the UTF-8 check knows the string length ahead
of time, these methods require linear time.
2020-01-07 12:03:28 -08:00
Maik Klein
eddb3f0668 Fix indentation 2020-01-07 19:42:35 +01:00
Maik Klein
a526c8d7fd Add tests for static variables 2020-01-07 19:37:24 +01:00
Camille GILLOT
700ac84eae Rename traits::drop -> traits::misc. 2020-01-07 19:36:50 +01:00