105346 Commits

Author SHA1 Message Date
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
Nikita Popov
c9e996f05c Remove support for datalayout upgrade
Only keep the downgrade code
2020-01-07 21:28:22 +01:00
Nikita Popov
8b199222cc Update data layouts to include new X86 address spaces 2020-01-07 21:28:22 +01:00
Nikita Popov
c6a7751fa7 Handle changed InstrProfilingRuntime path 2020-01-07 21:28:22 +01:00
Nikita Popov
3db0015499 Add include path when compiling profiler runtime
InstrProfData.inc has been moved to include/
2020-01-07 21:28:22 +01:00
Nikita Popov
b27b1d8efc Remove legacy debuginfo tests
These are no longer relevant, as our minimum supported version
is LLVM 7.
2020-01-07 21:28:22 +01:00
Nikita Popov
00daf2dabc Account for pointer type suffix in prefetch test 2020-01-07 21:28:22 +01:00
Nikita Popov
f2ad997921 Handle extra attributes in repeat-trusted-len.rs test 2020-01-07 21:28:22 +01:00
Nikita Popov
e365bc7435 Update codegen tests with unnamed arguments 2020-01-07 21:28:22 +01:00
Nikita Popov
3d8f454cd0 Update bool-cmp.rs codegen 2020-01-07 21:28:22 +01:00
Nikita Popov
31aecccbcd Auto-upgrade data layouts for X86 address spaces
This is similar to the autoupdate LLVM performs internally.
2020-01-07 21:28:22 +01:00
Nikita Popov
c3ab84bb4f Switch to using MaybeAlign APIs
The integer versions are deprecated
2020-01-07 21:28:22 +01:00
Nikita Popov
6d59017132 Handle switch to Expected<StringRef> for section name 2020-01-07 21:28:22 +01:00
Nikita Popov
aa9d02ea53 Pass isDefined parameter to createGlobalVariableExpression() 2020-01-07 21:28:22 +01:00
Nikita Popov
f77f338151 Don't handle removed FlagBlockByrefStruct 2020-01-07 21:28:22 +01:00
Nikita Popov
8010f4037a Update thinLTOInternalizeAndPromoteInIndex() usage 2020-01-07 21:28:22 +01:00
Nikita Popov
30ec68a545 Handle removal of llvm::make_unique() 2020-01-07 21:28:22 +01:00
Nikita Popov
3ec3aa72d4 CodeGenFileType moved outside TargetMachine 2020-01-07 21:28:21 +01:00
Nikita Popov
2fd4e76d88 Explicitly include InitializePasses.h 2020-01-07 21:28:21 +01: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
bors
8597644255 Auto merge of #67312 - cuviper:clone-box-slice, r=SimonSapin
Simplify Clone for Box<[T]>

The bespoke `BoxBuilder` was basically a very simple `Vec`. Instead,
let's clone to a real `Vec`, with all of its specialization for the
task, then convert back to `Box<[T]>`.
2020-01-07 18:10:56 +00:00
Camille GILLOT
f629baf96c Move magic traits queries to rustc::traits::drop. 2020-01-07 18:14:32 +01:00
Camille GILLOT
86ec4b5f85 Move required_region_bounds to rustc::infer::opaque_types. 2020-01-07 18:08:47 +01:00
Camille GILLOT
24d09c7c1b Move free_region_map to rustc::ty. 2020-01-07 18:07:36 +01:00
Camille GILLOT
e905d5da93 Move structural_match to rustc::traits. 2020-01-07 18:07:08 +01:00
Camille GILLOT
73667af444 Move ty::wf to traits. 2020-01-07 18:03:53 +01:00
Camille GILLOT
787cd5493a Make traits::util::* free functions. 2020-01-07 17:48:41 +01:00
Camille GILLOT
56a0aec07f Move subst_and_normalize_erasing_regionsto rustc::ty. 2020-01-07 17:47:49 +01:00