]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoUpdate error_codes.rs
Dylan DPC [Wed, 13 Nov 2019 00:50:12 +0000 (01:50 +0100)]
Update error_codes.rs

4 years agoUpdate error_codes.rs
Dylan DPC [Wed, 13 Nov 2019 00:47:25 +0000 (01:47 +0100)]
Update error_codes.rs

4 years agoAuto merge of #66156 - Mark-Simulacrum:stage0-step, r=pietroalbini
bors [Wed, 13 Nov 2019 00:42:19 +0000 (00:42 +0000)]
Auto merge of #66156 - Mark-Simulacrum:stage0-step, r=pietroalbini

Stage0 step

r? @pietroalbini

4 years agoTweak non-char/numeric in range pattern diagnostic
Yuki Okushi [Tue, 12 Nov 2019 23:27:53 +0000 (08:27 +0900)]
Tweak non-char/numeric in range pattern diagnostic

4 years agoexpand source_util macros with def-site context
Andy Russell [Tue, 12 Nov 2019 22:48:33 +0000 (17:48 -0500)]
expand source_util macros with def-site context

4 years agoRemove no longer needed mutability
Mark Rousskov [Tue, 12 Nov 2019 21:37:22 +0000 (16:37 -0500)]
Remove no longer needed mutability

4 years agoCompiletest bump to stage0 bootstrap libtest
Mark Rousskov [Wed, 6 Nov 2019 20:17:02 +0000 (15:17 -0500)]
Compiletest bump to stage0 bootstrap libtest

4 years agoHopefully fix rustdoc build
Mark Rousskov [Tue, 5 Nov 2019 16:16:46 +0000 (11:16 -0500)]
Hopefully fix rustdoc build

It's super unclear why this broke when we switched to beta but not
previously -- but at least it's hopefully fixed now.

4 years agoSnap cfgs
Mark Rousskov [Wed, 6 Nov 2019 13:09:55 +0000 (08:09 -0500)]
Snap cfgs

4 years agoBump version to 1.41
Mark Rousskov [Wed, 6 Nov 2019 13:01:56 +0000 (08:01 -0500)]
Bump version to 1.41

4 years agoAuto merge of #60026 - Aaron1011:feature/miri-unwind, r=RalfJung,oli-obk
bors [Tue, 12 Nov 2019 21:27:04 +0000 (21:27 +0000)]
Auto merge of #60026 - Aaron1011:feature/miri-unwind, r=RalfJung,oli-obk

Add hooks for Miri panic unwinding

This commits adds in some additional hooks to allow Miri to properly
handle panic unwinding. None of this should have any impact on CTFE mode

This supports https://github.com/rust-lang/miri/pull/693

4 years agoBless mir-dump test.
Camille GILLOT [Tue, 12 Nov 2019 21:02:55 +0000 (22:02 +0100)]
Bless mir-dump test.

4 years agoBless symbol-names.
Camille GILLOT [Tue, 12 Nov 2019 19:09:31 +0000 (20:09 +0100)]
Bless symbol-names.

4 years agoCentril review.
Camille GILLOT [Sat, 9 Nov 2019 10:43:32 +0000 (11:43 +0100)]
Centril review.

4 years agoFix tidy.
Camille GILLOT [Sat, 9 Nov 2019 10:30:51 +0000 (11:30 +0100)]
Fix tidy.

4 years agoRemove cruft.
Camille GILLOT [Fri, 8 Nov 2019 23:06:37 +0000 (00:06 +0100)]
Remove cruft.

4 years agoRename in librustdoc.
Camille GILLOT [Fri, 8 Nov 2019 22:19:55 +0000 (23:19 +0100)]
Rename in librustdoc.

4 years agoRename in librustc_codegen_llvm.
Camille GILLOT [Fri, 8 Nov 2019 22:19:46 +0000 (23:19 +0100)]
Rename in librustc_codegen_llvm.

4 years agoRename in librustc_codegen_ssa.
Camille GILLOT [Fri, 8 Nov 2019 22:12:26 +0000 (23:12 +0100)]
Rename in librustc_codegen_ssa.

4 years agoRename in librustc_codegen_utils.
Camille GILLOT [Fri, 8 Nov 2019 22:12:17 +0000 (23:12 +0100)]
Rename in librustc_codegen_utils.

4 years agoRename in librustc_mir.
Camille GILLOT [Fri, 8 Nov 2019 22:11:51 +0000 (23:11 +0100)]
Rename in librustc_mir.

4 years agoRename in librustc_typecheck.
Camille GILLOT [Fri, 8 Nov 2019 22:11:43 +0000 (23:11 +0100)]
Rename in librustc_typecheck.

4 years agoRename in librustc_traits.
Camille GILLOT [Fri, 8 Nov 2019 22:11:31 +0000 (23:11 +0100)]
Rename in librustc_traits.

4 years agoRefactor pretty_print_const.
Camille GILLOT [Fri, 8 Nov 2019 20:55:19 +0000 (21:55 +0100)]
Refactor pretty_print_const.

4 years agoCreate intermediate enum ty::ConstKind.
Camille GILLOT [Fri, 8 Nov 2019 20:32:56 +0000 (21:32 +0100)]
Create intermediate enum ty::ConstKind.

4 years agoFix mdbook-linkcheck license checks.
Eric Huss [Tue, 12 Nov 2019 18:45:33 +0000 (10:45 -0800)]
Fix mdbook-linkcheck license checks.

4 years agoUpdate mdbook.
Eric Huss [Tue, 12 Nov 2019 18:14:48 +0000 (10:14 -0800)]
Update mdbook.

4 years agoRegister queries with self profiler in rustc_interface
Mark Rousskov [Tue, 12 Nov 2019 16:44:01 +0000 (11:44 -0500)]
Register queries with self profiler in rustc_interface

4 years agoRemove dead code for encoding/decoding lint IDs
Mark Rousskov [Tue, 12 Nov 2019 16:20:01 +0000 (11:20 -0500)]
Remove dead code for encoding/decoding lint IDs

This helps decouple the lint system from needing the implicit TLS TyCtxt
as well.

4 years agoAuto merge of #65608 - matthewjasper:mir-eval-order, r=pnkfelix
bors [Tue, 12 Nov 2019 18:02:54 +0000 (18:02 +0000)]
Auto merge of #65608 - matthewjasper:mir-eval-order, r=pnkfelix

Fix MIR lowering evaluation order and soundness bug

* Fixes a soundness issue with built-in index operations
* Ensures correct evaluation order of assignment expressions where the RHS is a FRU or is a use of a local of reference type.
* Removes an unnecessary symbol to string conversion

closes #65909
closes #65910

4 years agoMove self-profile infrastructure to data structures
Mark Rousskov [Mon, 11 Nov 2019 22:15:36 +0000 (17:15 -0500)]
Move self-profile infrastructure to data structures

The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).

4 years agoFallback to the unmodified path in bindir_relative
Josh Stone [Tue, 12 Nov 2019 17:42:46 +0000 (09:42 -0800)]
Fallback to the unmodified path in bindir_relative

4 years agoAdd test for issue-63279
Yuki Okushi [Tue, 12 Nov 2019 15:37:00 +0000 (00:37 +0900)]
Add test for issue-63279

4 years agoAdd test for issue-52432
Yuki Okushi [Tue, 12 Nov 2019 15:36:38 +0000 (00:36 +0900)]
Add test for issue-52432

4 years agoAdd test for issue-40231
Yuki Okushi [Tue, 12 Nov 2019 15:36:20 +0000 (00:36 +0900)]
Add test for issue-40231

4 years agoAdd test for issue-30904
Yuki Okushi [Tue, 12 Nov 2019 15:35:57 +0000 (00:35 +0900)]
Add test for issue-30904

4 years agoMove NonExhaustive checks to the relevant match branches
Nadrieril [Tue, 12 Nov 2019 14:51:59 +0000 (14:51 +0000)]
Move NonExhaustive checks to the relevant match branches

4 years agoIntroduce Constructor::NonExhaustive
Nadrieril [Tue, 12 Nov 2019 12:44:00 +0000 (12:44 +0000)]
Introduce Constructor::NonExhaustive

It counts as an extra constructor for types that are not allowed to be
matched exhaustively.

4 years agoMatch constructor first in Constructor methods
Nadrieril [Tue, 12 Nov 2019 10:36:56 +0000 (10:36 +0000)]
Match constructor first in Constructor methods

This makes it easier to add new non-standard constructors, and this also
ensures that we don't forget cases when adding a new constructor.

4 years agoAuto merge of #66318 - mati865:llvm-update, r=matthewjasper
bors [Tue, 12 Nov 2019 12:55:02 +0000 (12:55 +0000)]
Auto merge of #66318 - mati865:llvm-update, r=matthewjasper

Update LLVM submodule

Fixes https://github.com/rust-lang/rust/issues/66315

4 years agocheck-consts remove cannot mutate statics in initializer of another static error
Santiago Pastorino [Tue, 12 Nov 2019 12:20:44 +0000 (13:20 +0100)]
check-consts remove cannot mutate statics in initializer of another static error

4 years agoqualify-const remove cannot mutate statics in initializer of another static error
Santiago Pastorino [Mon, 11 Nov 2019 18:11:24 +0000 (19:11 +0100)]
qualify-const remove cannot mutate statics in initializer of another static error

4 years agoUpdate llvm submodule
Mateusz Mikuła [Tue, 12 Nov 2019 10:02:17 +0000 (11:02 +0100)]
Update llvm submodule

4 years agoAuto merge of #66323 - JohnTitor:rollup-jl8xdk4, r=JohnTitor
bors [Tue, 12 Nov 2019 08:23:32 +0000 (08:23 +0000)]
Auto merge of #66323 - JohnTitor:rollup-jl8xdk4, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #65965 (Clean up librustc_typeck error_codes file)
 - #66230 (remove vestigial comments referring to defunct numeric trait hierarchy)
 - #66241 (bump openssl version)
 - #66257 (Drop long-section-names linker workaround for windows-gnu)
 - #66263 (make the error message more readable)
 - #66267 (Add rustdoc doc)
 - #66276 (Move lock into CodeStats)
 - #66278 (Fix error message about exported symbols from proc-macro crates)
 - #66280 (Fix HashSet::union performance)
 - #66299 (support issue = "none" in unstable attributes )
 - #66309 (Tiny cleanup to size assertions)

Failed merges:

r? @ghost

4 years agoRollup merge of #66309 - petrochenkov:annoying, r=Mark-Simulacrum
Yuki Okushi [Tue, 12 Nov 2019 07:36:18 +0000 (16:36 +0900)]
Rollup merge of #66309 - petrochenkov:annoying, r=Mark-Simulacrum

Tiny cleanup to size assertions

The need to write `#[cfg(target_arch = "x86_64")]` twice mildly annoys me, the full paths look better in comparison.

4 years agoRollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkor
Yuki Okushi [Tue, 12 Nov 2019 07:36:16 +0000 (16:36 +0900)]
Rollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkor

support issue = "none" in unstable attributes

This works towards fixing #41260.

This PR allows the use of `issue = "none"` in unstable attributes and makes changes to internally store the issue number as an `Option<NonZeroU32>`. For example:

```rust
#[unstable(feature = "unstable_test_feature", issue = "none")]
fn unstable_issue_none() {}
```

It was not made optional because feedback seen here #60860 suggested that people might forget the issue field if it was optional.

I could not remove the current uses of `issue = "0"` (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of `"0"` with `"none"` and no longer allow `"0"`. This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated.

r? @varkor

4 years agoRollup merge of #66280 - stepancheg:union, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:15 +0000 (16:36 +0900)]
Rollup merge of #66280 - stepancheg:union, r=alexcrichton

Fix HashSet::union performance

Consider this example: small_set = 0..2, large_set = 0..1000.

To efficiently compute the union of these sets, we should
* take all elements of the larger set
* for each element of the smaller set check it is not in the larger set

This is exactly what this commit does.

This particular optimization was implemented a year ago, but the
author mistaken `<` and `>`.

4 years agoRollup merge of #66278 - LukasKalbertodt:fix-proc-macro-error, r=Centril
Yuki Okushi [Tue, 12 Nov 2019 07:36:13 +0000 (16:36 +0900)]
Rollup merge of #66278 - LukasKalbertodt:fix-proc-macro-error, r=Centril

Fix error message about exported symbols from proc-macro crates

Someone forgot to update the error message after `#[proc_macro]` and
`#[proc_macro_attribute]` were stabilized.

4 years agoRollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakis
Yuki Okushi [Tue, 12 Nov 2019 07:36:12 +0000 (16:36 +0900)]
Rollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakis

Move lock into CodeStats

Prevent (theoretical) accidental too-long borrows by ensuring only encapsulated locking.

4 years agoRollup merge of #66267 - GuillaumeGomez:add-rustdoc-doc, r=kinnison
Yuki Okushi [Tue, 12 Nov 2019 07:36:10 +0000 (16:36 +0900)]
Rollup merge of #66267 - GuillaumeGomez:add-rustdoc-doc, r=kinnison

Add rustdoc doc

r? @kinnison

4 years agoRollup merge of #66263 - guanqun:make-error-explicit, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:08 +0000 (16:36 +0900)]
Rollup merge of #66263 - guanqun:make-error-explicit, r=alexcrichton

make the error message more readable

When I type it wrong e.g. `--stage --bless`, missing a number here, this change would make it more explicit what's going wrong here.

4 years agoRollup merge of #66257 - mati865:long-section-names-no-more, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:07 +0000 (16:36 +0900)]
Rollup merge of #66257 - mati865:long-section-names-no-more, r=alexcrichton

Drop long-section-names linker workaround for windows-gnu

If we can trust objdump Rust doesn't emit sections loaded at runtime longer than 8 characters on windows-gnu (but still does on linux-gnu), debug sections are not affected by that limit.
I've ran tests and built few crates using exactly the same mingw-w64 version as Rusts CI just fine using **x86_64** toolchain.

The motivation for this change is making LLD work (it doesn't support `--enable-long-section-names`) with this target without hacks.

Bit of history:
The behaviour of LD changed in Binutils 2.20 released on 2009-10-16 and `--enable-long-section-names` was added to return to the old non conformant behaviour. Looking at the comment I can only guess there was a bug fixed in newer versions.

This workaround was added in https://github.com/rust-lang/rust/pull/13315 half a decade ago.

4 years agoRollup merge of #66241 - lzutao:ssl, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:05 +0000 (16:36 +0900)]
Rollup merge of #66241 - lzutao:ssl, r=alexcrichton

bump openssl version

Fixes #65808

This PR updates `openssl` and `openssl-sys` to support newer versions of `libressl` in `rust` builds.

4 years agoRollup merge of #66230 - Axelderan:remove-vestigial-comments, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:03 +0000 (16:36 +0900)]
Rollup merge of #66230 - Axelderan:remove-vestigial-comments, r=alexcrichton

remove vestigial comments referring to defunct numeric trait hierarchy

I've been poking around the numeric trait hierarchy and also some of the actual numeric type implementations.

This is a small change but a matter of effective communication.  I looked for other related references and saw none.

4 years agoRollup merge of #65965 - GuillaumeGomez:clean-up-librustc_typeck-error-codes, r=Mark...
Yuki Okushi [Tue, 12 Nov 2019 07:36:01 +0000 (16:36 +0900)]
Rollup merge of #65965 - GuillaumeGomez:clean-up-librustc_typeck-error-codes, r=Mark-Simulacrum

Clean up librustc_typeck error_codes file

r? @Dylan-DPC

4 years agoAuto merge of #66129 - Nadrieril:refactor-slice-pat-usefulness, r=varkor
bors [Tue, 12 Nov 2019 04:44:30 +0000 (04:44 +0000)]
Auto merge of #66129 - Nadrieril:refactor-slice-pat-usefulness, r=varkor

Refactor slice pattern usefulness checking

As a follow up to https://github.com/rust-lang/rust/pull/65874, this PR changes how variable-length slice patterns are handled in usefulness checking. The objectives are: cleaning up that code to make it easier to understand, and paving the way to handling fixed-length slices more cleverly too, for https://github.com/rust-lang/rust/issues/53820.

Before this, variable-length slice patterns were eagerly expanded into a union of fixed-length slices. Now they have their own special constructor, which allows expanding them a bit more lazily.
As a nice side-effect, this improves diagnostics.

This PR shows a slight performance improvement, mostly due to https://github.com/rust-lang/rust/pull/66129/commits/149792b6080f40875c0072aae378a0eb31d23df0. This will probably have to be reverted in some way when we implement or-patterns.

4 years agoadd Result::map_or
Lzu Tao [Mon, 11 Nov 2019 13:25:19 +0000 (13:25 +0000)]
add Result::map_or

4 years agoAuto merge of #66310 - Manishearth:clippyup, r=Manishearth
bors [Mon, 11 Nov 2019 22:33:10 +0000 (22:33 +0000)]
Auto merge of #66310 - Manishearth:clippyup, r=Manishearth

Update clippy

Fixes #66300

r? @ghost

4 years agoUse a relative bindir for rustdoc to find rustc
Josh Stone [Mon, 11 Nov 2019 22:22:23 +0000 (14:22 -0800)]
Use a relative bindir for rustdoc to find rustc

In bootstrap, we set `RUSTC_INSTALL_BINDIR` to `config.bindir`, so
rustdoc can find rustc relative to the toolchain sysroot. However, if a
distro script like Fedora's `%configure` sets an absolute path, then
rustdoc's `sysroot.join(bin_path)` ignores that sysroot altogether.

That would be OK once the toolchain is actually installed, but it breaks
the in-tree doc tests during the build, since `/usr/bin/rustc` is still
the old version. So now we try to make `RUSTC_INSTALL_BINDIR` relative
to the sysroot prefix in the first place.

4 years agoEvaluate borrow and struct expressions in `into`
Matthew Jasper [Sat, 19 Oct 2019 20:01:36 +0000 (21:01 +0100)]
Evaluate borrow and struct expressions in `into`

This fixes some ordering problems around assignment expressions.

4 years agoFix soundness issue with index bounds checks
Matthew Jasper [Sat, 19 Oct 2019 20:00:21 +0000 (21:00 +0100)]
Fix soundness issue with index bounds checks

An expression like `x[1][{ x = y; 2}]` would perform the bounds check
for the inner index operation before evaluating the outer index. This
would allow out of bounds memory accesses.

4 years agoAvoid a string comparison in MIR construction
Matthew Jasper [Sun, 26 May 2019 09:00:34 +0000 (10:00 +0100)]
Avoid a string comparison in MIR construction

4 years agoUpdate
Aaron Hill [Sat, 9 Nov 2019 16:02:15 +0000 (11:02 -0500)]
Update

4 years agoReturn Ok(false) instead of throwing when handling a diverging intrinsic
Aaron Hill [Wed, 6 Nov 2019 19:13:57 +0000 (14:13 -0500)]
Return Ok(false) instead of throwing when handling a diverging intrinsic

4 years agoFix rebase fallout
Aaron Hill [Wed, 6 Nov 2019 18:47:40 +0000 (13:47 -0500)]
Fix rebase fallout

4 years agoRename to
Aaron Hill [Wed, 6 Nov 2019 18:20:08 +0000 (13:20 -0500)]
Rename  to

4 years agoFix debug assertion
Aaron Hill [Tue, 5 Nov 2019 05:22:49 +0000 (00:22 -0500)]
Fix debug assertion

4 years agoRemove trampoline, pass `ret` and `unwind` when handling intrinsics
Aaron Hill [Tue, 5 Nov 2019 05:06:05 +0000 (00:06 -0500)]
Remove trampoline, pass `ret` and `unwind` when handling intrinsics

4 years agoFix tidy
Aaron Hill [Mon, 4 Nov 2019 21:10:35 +0000 (16:10 -0500)]
Fix tidy

4 years agoAdd more detailed codegen comment
Aaron Hill [Mon, 4 Nov 2019 21:10:02 +0000 (16:10 -0500)]
Add more detailed codegen comment

4 years agoMove to miri.rs and re-export it
Aaron Hill [Mon, 4 Nov 2019 20:34:19 +0000 (15:34 -0500)]
Move  to miri.rs and re-export it

4 years agoSome code cleanup
Aaron Hill [Mon, 4 Nov 2019 20:00:41 +0000 (15:00 -0500)]
Some code cleanup

4 years agoMake doc comment more accurate
Aaron Hill [Mon, 4 Nov 2019 18:49:50 +0000 (13:49 -0500)]
Make doc comment more accurate

4 years agoChange TODO to FIXME
Aaron Hill [Wed, 30 Oct 2019 18:40:21 +0000 (14:40 -0400)]
Change TODO to FIXME

4 years agoAdd comment
Aaron Hill [Wed, 30 Oct 2019 01:09:51 +0000 (21:09 -0400)]
Add comment

4 years agoAdd miri trampoline, fix handling of intrinsic return
Aaron Hill [Wed, 30 Oct 2019 01:03:30 +0000 (21:03 -0400)]
Add miri trampoline, fix handling of intrinsic return

4 years agoUse proper intrinsic type
Aaron Hill [Tue, 29 Oct 2019 22:48:29 +0000 (18:48 -0400)]
Use proper intrinsic type

4 years agoMore work on miri_start_panic
Aaron Hill [Tue, 29 Oct 2019 22:23:36 +0000 (18:23 -0400)]
More work on miri_start_panic

4 years agoFix up intrinsic implementation
Aaron Hill [Tue, 29 Oct 2019 21:31:54 +0000 (17:31 -0400)]
Fix up intrinsic implementation

4 years agoAdd explicit Miri support to libpanic_unwind
Aaron Hill [Tue, 29 Oct 2019 02:44:30 +0000 (22:44 -0400)]
Add explicit Miri support to libpanic_unwind

4 years agoDon't attempt to get cwd when printing backtrace under Miri
Aaron Hill [Tue, 29 Oct 2019 02:23:41 +0000 (22:23 -0400)]
Don't attempt to get cwd when printing backtrace under Miri

This allows Miri to print backtraces in isolation mode

4 years agoFix unwinding logic
Aaron Hill [Tue, 29 Oct 2019 01:37:58 +0000 (21:37 -0400)]
Fix unwinding logic

4 years agoSome cleanup
Aaron Hill [Mon, 28 Oct 2019 23:09:54 +0000 (19:09 -0400)]
Some cleanup

4 years agoAdd doc comment
Aaron Hill [Mon, 21 Oct 2019 01:40:38 +0000 (21:40 -0400)]
Add doc comment

4 years agoA few minor tweaks
Aaron Hill [Mon, 21 Oct 2019 01:31:43 +0000 (21:31 -0400)]
A few minor tweaks

4 years agoavoid the loop in unwinding stack popping
Ralf Jung [Sun, 20 Oct 2019 16:51:25 +0000 (18:51 +0200)]
avoid the loop in unwinding stack popping

4 years agoMore fixes for rustc changes
Aaron Hill [Wed, 9 Oct 2019 21:33:41 +0000 (17:33 -0400)]
More fixes for rustc changes

4 years agoRemove old intrinsic check
Aaron Hill [Thu, 26 Sep 2019 17:45:26 +0000 (13:45 -0400)]
Remove old intrinsic check

4 years agoFix incorrect unwrap of dest
Aaron Hill [Thu, 26 Sep 2019 17:11:56 +0000 (13:11 -0400)]
Fix incorrect unwrap of dest

4 years agoFormatting improvements
Aaron Hill [Thu, 19 Sep 2019 17:47:59 +0000 (13:47 -0400)]
Formatting improvements

Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
4 years agoAdd hooks for Miri panic unwinding
Aaron Hill [Wed, 17 Apr 2019 01:04:54 +0000 (21:04 -0400)]
Add hooks for Miri panic unwinding

This commits adds in some additional hooks to allow Miri to properly
handle panic unwinding. None of this should have any impact on CTFE mode

4 years agoMove allocator_kind to CrateStore
Mark Rousskov [Mon, 11 Nov 2019 19:57:34 +0000 (14:57 -0500)]
Move allocator_kind to CrateStore

Similarly to the previous commit, there's no need for this to be in
Session and have a Once around it.

4 years agoMove injected_panic_runtime to CrateStore
Mark Rousskov [Mon, 11 Nov 2019 19:50:26 +0000 (14:50 -0500)]
Move injected_panic_runtime to CrateStore

This was essentially a "query" previously (with no key, just always run
once when resolving the crate dependencies), and remains so, just now in
a way that isn't on Session. This removes the need for the `Once` as
well.

4 years agoUpdate clippy
Manish Goregaokar [Mon, 11 Nov 2019 19:41:10 +0000 (11:41 -0800)]
Update clippy

4 years agoTiny cleanup to size assertions
Vadim Petrochenkov [Mon, 11 Nov 2019 19:18:35 +0000 (22:18 +0300)]
Tiny cleanup to size assertions

4 years agoAuto merge of #65933 - crgl:vec-deque-truncate, r=alexcrichton
bors [Mon, 11 Nov 2019 19:20:54 +0000 (19:20 +0000)]
Auto merge of #65933 - crgl:vec-deque-truncate, r=alexcrichton

Use ptr::drop_in_place for VecDeque::truncate and VecDeque::clear

This commit allows `VecDeque::truncate` to take advantage of its (largely) contiguous memory layout and is consistent with the change in #64432 for `Vec`. As with the change to `Vec::truncate`, this changes both:

- the drop order, from back-to-front to front-to-back
- the behavior when dropping an element panics

For consistency, it also changes the behavior when dropping an element panics for `VecDeque::clear`.

These changes in behavior can be observed. This example ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d0b1f2edc123437a2f704cbe8d93d828))
```rust
use std::collections::VecDeque;

fn main() {
    struct Bomb(usize);
    impl Drop for Bomb {
        fn drop(&mut self) {
            panic!(format!("{}", self.0));
        }
    }
    let mut v = VecDeque::from(vec![Bomb(0), Bomb(1)]);
    std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
        v.truncate(0);
    }));
    std::mem::forget(v);
}
```
panics printing `1` today and succeeds. `v.clear()` panics printing `0` today and succeeds. With the change, `v.clear()`, `v.truncate(0)`, and dropping the `VecDeque` all panic printing `0` first and then abort with a double-panic printing `1`.

The motivation for this was making `VecDeque::truncate` more efficient since it was used in the implementation of `VecDeque::clone_from` (#65069), but it also makes behavior more consistent within the `VecDeque` and with `Vec` if that change is accepted (this probably doesn't make sense to merge if not).

This might need a crater run and an FCP as well.

4 years agoAdd a callback that allows compiler consumers to override queries.
Vytautas Astrauskas [Mon, 11 Nov 2019 15:09:03 +0000 (16:09 +0100)]
Add a callback that allows compiler consumers to override queries.

4 years agosupport issue = "none" in unstable attributes
Ross MacArthur [Mon, 11 Nov 2019 17:33:30 +0000 (19:33 +0200)]
support issue = "none" in unstable attributes

- Use `Option<NonZeroU32>` to represent issue numbers.

4 years agobootstrap: don't call support_xz in hot-path
Guanqun Lu [Mon, 11 Nov 2019 16:16:05 +0000 (00:16 +0800)]
bootstrap: don't call support_xz in hot-path

4 years agofix an ICE in macro's diagnostic message
Guanqun Lu [Sun, 10 Nov 2019 07:38:09 +0000 (15:38 +0800)]
fix an ICE in macro's diagnostic message