]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoMinor changes to tests.sh
bjorn3 [Wed, 27 Apr 2022 14:54:35 +0000 (16:54 +0200)]
Minor changes to tests.sh

2 years agoFix running the rustc test suite
bjorn3 [Wed, 27 Apr 2022 12:09:41 +0000 (14:09 +0200)]
Fix running the rustc test suite

2 years agoRustup to rustc 1.62.0-nightly (082e4ca49 2022-04-26)
bjorn3 [Wed, 27 Apr 2022 10:32:20 +0000 (12:32 +0200)]
Rustup to rustc 1.62.0-nightly (082e4ca49 2022-04-26)

2 years agoMerge branch 'sync_from_rust'
bjorn3 [Fri, 22 Apr 2022 19:12:23 +0000 (21:12 +0200)]
Merge branch 'sync_from_rust'

2 years agoMerge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22
bjorn3 [Fri, 22 Apr 2022 19:11:38 +0000 (21:11 +0200)]
Merge commit 'f2cdd4a78d89c009342197cf5844a21f8aa813df' into sync_cg_clif-2022-04-22

2 years agoRustup to rustc 1.62.0-nightly (879aff385 2022-04-20)
bjorn3 [Thu, 21 Apr 2022 18:54:50 +0000 (20:54 +0200)]
Rustup to rustc 1.62.0-nightly (879aff385 2022-04-20)

2 years agoSync from rust 1dec35a1b0df406da5d7cae55a7fa8d186a2b028
bjorn3 [Thu, 21 Apr 2022 18:23:21 +0000 (20:23 +0200)]
Sync from rust 1dec35a1b0df406da5d7cae55a7fa8d186a2b028

2 years agoUpdate Cranelift to 0.83.0
bjorn3 [Thu, 21 Apr 2022 17:22:12 +0000 (19:22 +0200)]
Update Cranelift to 0.83.0

2 years agoRemove option to select regalloc algorithm
bjorn3 [Sun, 17 Apr 2022 17:41:24 +0000 (19:41 +0200)]
Remove option to select regalloc algorithm

The main branch of Cranelift has switched to a new register allocator.
This register allocator doesn't have any alternative regalloc algorithms
unlike the old register allocator.

2 years agoDon't assume /bin/bash is available on every system. (#1223)
MikaelUrankar [Thu, 14 Apr 2022 12:18:13 +0000 (14:18 +0200)]
Don't assume /bin/bash is available on every system. (#1223)

Co-authored-by: MikaelUrankar <mikael.urankar@gmail.com>
2 years agoAdd new `Deinit` statement kind
Jakob Degen [Tue, 5 Apr 2022 21:14:59 +0000 (17:14 -0400)]
Add new `Deinit` statement kind

2 years agocheck_doc_keyword: don't alloc string for emptiness check
klensy [Tue, 5 Apr 2022 12:52:53 +0000 (15:52 +0300)]
check_doc_keyword: don't alloc string for emptiness check

check_doc_alias_value: get argument as Symbol to prevent needless string convertions

check_doc_attrs: don't alloc vec, iterate over slice. Vec introduced in #83149, but no perf run posted on merge

replace as_str() check with symbol check

get_single_str_from_tts: don't prealloc string

trivial string to str replace

LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String>

AssertModuleSource use BTreeSet<Symbol> instead of BTreeSet<String>

CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>

2 years agoMark scalar layout unions so that backends that do not support partially initialized...
Oli Scherer [Thu, 3 Mar 2022 12:02:12 +0000 (12:02 +0000)]
Mark scalar layout unions so that backends that do not support partially initialized scalars can special case them.

2 years agoIgnore broken rustc test
bjorn3 [Tue, 5 Apr 2022 10:46:56 +0000 (12:46 +0200)]
Ignore broken rustc test

2 years agoRustup to rustc 1.62.0-nightly (60e50fc1c 2022-04-04)
bjorn3 [Tue, 5 Apr 2022 09:44:41 +0000 (11:44 +0200)]
Rustup to rustc 1.62.0-nightly (60e50fc1c 2022-04-04)

2 years agoSync from rust 949b98cab8a186b98bf87e64374b8d0848c55271
bjorn3 [Tue, 5 Apr 2022 09:31:42 +0000 (11:31 +0200)]
Sync from rust 949b98cab8a186b98bf87e64374b8d0848c55271

2 years agoCleanup after some refactoring in rustc_target
Loïc BRANSTETT [Sun, 3 Apr 2022 16:42:39 +0000 (18:42 +0200)]
Cleanup after some refactoring in rustc_target

2 years agoAddressed comments by @compiler-errors and @bjorn3
Yuri Astrakhan [Wed, 30 Mar 2022 21:04:46 +0000 (17:04 -0400)]
Addressed comments by @compiler-errors and @bjorn3

2 years agoSpellchecking compiler comments
Yuri Astrakhan [Wed, 30 Mar 2022 19:14:15 +0000 (15:14 -0400)]
Spellchecking compiler comments

This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.

2 years agoRollup merge of #95461 - nyurik:spelling, r=lcnr
Dylan DPC [Wed, 30 Mar 2022 07:10:07 +0000 (09:10 +0200)]
Rollup merge of #95461 - nyurik:spelling, r=lcnr

Spellchecking some comments

This PR attempts to clean up some minor spelling mistakes in comments

2 years agoSpellchecking compiler code
Yuri Astrakhan [Wed, 30 Mar 2022 05:42:10 +0000 (01:42 -0400)]
Spellchecking compiler code

Address some spelling mistakes in strings, private function names, and function params.

2 years agoSpellchecking some comments
Yuri Astrakhan [Wed, 30 Mar 2022 05:39:38 +0000 (01:39 -0400)]
Spellchecking some comments

This PR attempts to clean up some minor spelling mistakes in comments

2 years agoUse fma(f) libm function for simd_fma intrinsic
bjorn3 [Fri, 25 Mar 2022 19:42:58 +0000 (20:42 +0100)]
Use fma(f) libm function for simd_fma intrinsic

2 years agoFix NaN handling of simd float min and max operations
bjorn3 [Fri, 25 Mar 2022 19:24:47 +0000 (20:24 +0100)]
Fix NaN handling of simd float min and max operations

2 years agoFix saturating float casts test
bjorn3 [Fri, 25 Mar 2022 18:17:19 +0000 (19:17 +0100)]
Fix saturating float casts test

Fixes #737

2 years agoRustup to rustc 1.61.0-nightly (63b8f01bb 2022-03-24)
bjorn3 [Fri, 25 Mar 2022 16:28:39 +0000 (17:28 +0100)]
Rustup to rustc 1.61.0-nightly (63b8f01bb 2022-03-24)

2 years agoSync from rust 903427b2e807cb1292388940b3f44f3b061cfebf
bjorn3 [Fri, 25 Mar 2022 16:19:19 +0000 (17:19 +0100)]
Sync from rust 903427b2e807cb1292388940b3f44f3b061cfebf

2 years agoUpdate list of ignored rustc tests
bjorn3 [Tue, 22 Mar 2022 11:35:49 +0000 (12:35 +0100)]
Update list of ignored rustc tests

2 years agoRustup to rustc 1.61.0-nightly (3c17c84a3 2022-03-21)
bjorn3 [Tue, 22 Mar 2022 11:02:50 +0000 (12:02 +0100)]
Rustup to rustc 1.61.0-nightly (3c17c84a3 2022-03-21)

2 years agoDon't declare test_variadic_fnptr with two conflicting signatures
bjorn3 [Fri, 18 Mar 2022 19:34:27 +0000 (20:34 +0100)]
Don't declare test_variadic_fnptr with two conflicting signatures

It is UB for LLVM and results in a compile error for Cranelift

2 years agoMerge branch 'sync_from_rust'
bjorn3 [Sun, 20 Mar 2022 15:56:00 +0000 (16:56 +0100)]
Merge branch 'sync_from_rust'

2 years agoMerge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20
bjorn3 [Sun, 20 Mar 2022 15:55:21 +0000 (16:55 +0100)]
Merge commit '370c397ec9169809e5ad270079712e0043514240' into sync_cg_clif-2022-03-20

2 years agoRun part of the simd test suite
bjorn3 [Sat, 19 Mar 2022 15:32:07 +0000 (16:32 +0100)]
Run part of the simd test suite

2 years agoIgnore rustc tests with needs-unwind directive
bjorn3 [Sat, 19 Mar 2022 15:11:53 +0000 (16:11 +0100)]
Ignore rustc tests with needs-unwind directive

2 years agoMove test and clarify problem of some other tests
bjorn3 [Sat, 19 Mar 2022 14:48:19 +0000 (15:48 +0100)]
Move test and clarify problem of some other tests

2 years agoWrap write_mir_fn call in with_no_trimmed_paths!()
bjorn3 [Sat, 19 Mar 2022 15:54:51 +0000 (16:54 +0100)]
Wrap write_mir_fn call in with_no_trimmed_paths!()

2 years agoRustup to rustc 1.61.0-nightly (1bfe40d11 2022-03-18)
bjorn3 [Sat, 19 Mar 2022 12:36:25 +0000 (13:36 +0100)]
Rustup to rustc 1.61.0-nightly (1bfe40d11 2022-03-18)

2 years agoSync from rust 31535841701e0bf7ef33998024376f2cedd8b3e3
bjorn3 [Sat, 19 Mar 2022 12:28:22 +0000 (13:28 +0100)]
Sync from rust 31535841701e0bf7ef33998024376f2cedd8b3e3

2 years agoCodegen 128bit atomic loads and stores for compiler builtins as trap
bjorn3 [Sat, 19 Mar 2022 09:44:56 +0000 (10:44 +0100)]
Codegen 128bit atomic loads and stores for compiler builtins as trap

128bit atomics are unstable and only enabled on AArch64 and x86_64 macOS.
Cranelift doesn't support 128bit atomics yet.

2 years agoEnable rand based libcore tests
bjorn3 [Fri, 18 Mar 2022 20:19:37 +0000 (21:19 +0100)]
Enable rand based libcore tests

Part of #806

2 years agoCleanup rand test disable patch
bjorn3 [Fri, 18 Mar 2022 19:59:51 +0000 (20:59 +0100)]
Cleanup rand test disable patch

2 years agoRemove no longer necessary rand patch
bjorn3 [Fri, 18 Mar 2022 19:51:53 +0000 (20:51 +0100)]
Remove no longer necessary rand patch

2 years agoMerge pull request #1221 from bjorn3/run_more_rustc_tests
bjorn3 [Fri, 18 Mar 2022 18:32:45 +0000 (19:32 +0100)]
Merge pull request #1221 from bjorn3/run_more_rustc_tests

Run more rustc tests

2 years agoReorganize test list
bjorn3 [Fri, 18 Mar 2022 15:38:28 +0000 (16:38 +0100)]
Reorganize test list

2 years agoRun tests with warnings
bjorn3 [Fri, 18 Mar 2022 14:38:58 +0000 (15:38 +0100)]
Run tests with warnings

2 years agoRe-enable fixed tests
bjorn3 [Thu, 17 Mar 2022 20:16:26 +0000 (21:16 +0100)]
Re-enable fixed tests

2 years agoAuto merge of #88098 - Amanieu:oom_panic, r=nagisa
bors [Fri, 18 Mar 2022 03:01:46 +0000 (03:01 +0000)]
Auto merge of #88098 - Amanieu:oom_panic, r=nagisa

Implement -Z oom=panic

This PR removes the `#[rustc_allocator_nounwind]` attribute on `alloc_error_handler` which allows it to unwind with a panic instead of always aborting. This is then used to implement `-Z oom=panic` as per RFC 2116 (tracking issue #43596).

Perf and binary size tests show negligible impact.

2 years agoFix and re-enable some rustc tests
bjorn3 [Thu, 17 Mar 2022 19:59:39 +0000 (20:59 +0100)]
Fix and re-enable some rustc tests

* Set `config.opts.trimmed_def_paths` to `GoodPath` to trim def paths in
  error messages as expected by the rustc test suite
* Fix `$SRC_DIR` normalization for out of tree compiled standard library

2 years agoSlightly speed up building of y.rs
bjorn3 [Wed, 16 Mar 2022 18:21:24 +0000 (19:21 +0100)]
Slightly speed up building of y.rs

2 years agorustc_error: make ErrorReported impossible to construct
mark [Sun, 23 Jan 2022 00:49:12 +0000 (18:49 -0600)]
rustc_error: make ErrorReported impossible to construct

There are a few places were we have to construct it, though, and a few
places that are more invasive to change. To do this, we create a
constructor with a long obvious name.

2 years agoSilence warning
bjorn3 [Wed, 16 Mar 2022 11:05:02 +0000 (12:05 +0100)]
Silence warning

2 years agoTrim down alloc_system.rs
bjorn3 [Tue, 15 Mar 2022 18:11:05 +0000 (19:11 +0100)]
Trim down alloc_system.rs

It is used only by a single test. Also remove the dependency on the libc
crate.

2 years agoRemove some unused feature gates
bjorn3 [Tue, 15 Mar 2022 18:10:25 +0000 (19:10 +0100)]
Remove some unused feature gates

2 years agoAvoid once_cell unstable feature in cg_clif.rs
bjorn3 [Tue, 15 Mar 2022 16:42:51 +0000 (17:42 +0100)]
Avoid once_cell unstable feature in cg_clif.rs

2 years agoDownload tarballs from github instead of cloning full repos
bjorn3 [Tue, 15 Mar 2022 11:06:51 +0000 (12:06 +0100)]
Download tarballs from github instead of cloning full repos

This saves 40-50s on CI as the repo history can be skipped

2 years agoRustup to rustc 1.61.0-nightly (285fa7ecd 2022-03-14)
bjorn3 [Tue, 15 Mar 2022 10:21:42 +0000 (11:21 +0100)]
Rustup to rustc 1.61.0-nightly (285fa7ecd 2022-03-14)

2 years agoMerge pull request #1220 from bjorn3/dont_print_on_trap
bjorn3 [Mon, 14 Mar 2022 11:51:47 +0000 (12:51 +0100)]
Merge pull request #1220 from bjorn3/dont_print_on_trap

Replace a lot of print+trap with plain trap

2 years agoReplace a lot of print+trap with plain trap
bjorn3 [Sun, 13 Mar 2022 16:29:25 +0000 (17:29 +0100)]
Replace a lot of print+trap with plain trap

This reduces binary sizes by a decent amount:

libstd.so: 17% reduction
mini_core_hello_world: 27% reduction
simple-raytracer: 27% reduction

This also improves compile time of simple-raytracer by 0.5s (4% +- 2%)
In addition it is also a pre-requisite for building standalone binaries.

2 years agoMark cold blocks
bjorn3 [Sun, 13 Mar 2022 14:51:39 +0000 (15:51 +0100)]
Mark cold blocks

2 years agoUpdate list of ignores rustc tests
bjorn3 [Sun, 13 Mar 2022 17:22:25 +0000 (18:22 +0100)]
Update list of ignores rustc tests

2 years agoAdd and remove some fixmes
bjorn3 [Sun, 13 Mar 2022 14:46:25 +0000 (15:46 +0100)]
Add and remove some fixmes

2 years agoRemove almost all remaining feature gates
bjorn3 [Sun, 13 Mar 2022 14:31:34 +0000 (15:31 +0100)]
Remove almost all remaining feature gates

Only rustc_private is still enabled as cg_clif by definition needs to
use internal rustc api's.

2 years agoRemove decl_macro usage
bjorn3 [Sun, 13 Mar 2022 14:19:48 +0000 (15:19 +0100)]
Remove decl_macro usage

This reduces the amount of unstable features used by cg_clif

2 years agoRustup to rustc 1.61.0-nightly (f103b2969 2022-03-12)
bjorn3 [Sun, 13 Mar 2022 14:04:33 +0000 (15:04 +0100)]
Rustup to rustc 1.61.0-nightly (f103b2969 2022-03-12)

2 years agoSync from rust 4800c7816ee1937d028407066d229f74b4673c92
bjorn3 [Sun, 13 Mar 2022 13:39:10 +0000 (14:39 +0100)]
Sync from rust 4800c7816ee1937d028407066d229f74b4673c92

2 years agoImprove `AdtDef` interning.
Nicholas Nethercote [Fri, 4 Mar 2022 20:28:41 +0000 (07:28 +1100)]
Improve `AdtDef` interning.

This commit makes `AdtDef` use `Interned`. Much the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.

2 years agoUpdate Cranelift to 0.82.1
bjorn3 [Thu, 10 Mar 2022 13:50:09 +0000 (14:50 +0100)]
Update Cranelift to 0.82.1

This fixes a miscompilation

2 years agoAdd missing clif ir comment
bjorn3 [Wed, 9 Mar 2022 18:33:55 +0000 (19:33 +0100)]
Add missing clif ir comment

2 years agoUpdate dependencies
bjorn3 [Tue, 8 Mar 2022 19:08:50 +0000 (20:08 +0100)]
Update dependencies

2 years agoUpdate Cranelift to 0.82.0
bjorn3 [Tue, 8 Mar 2022 19:01:48 +0000 (20:01 +0100)]
Update Cranelift to 0.82.0

2 years agoFix Box deref for non-ZST allocators
bjorn3 [Tue, 8 Mar 2022 19:00:11 +0000 (20:00 +0100)]
Fix Box deref for non-ZST allocators

2 years agoFix compiletest compilation
bjorn3 [Tue, 8 Mar 2022 11:13:33 +0000 (12:13 +0100)]
Fix compiletest compilation

2 years agoRustup to rustc 1.61.0-nightly (03918badd 2022-03-07)
bjorn3 [Tue, 8 Mar 2022 10:29:17 +0000 (11:29 +0100)]
Rustup to rustc 1.61.0-nightly (03918badd 2022-03-07)

2 years agoSync from rust 67b3e8183830c7af4e06a9aa91de4d1be3c860f7
bjorn3 [Tue, 8 Mar 2022 10:11:51 +0000 (11:11 +0100)]
Sync from rust 67b3e8183830c7af4e06a9aa91de4d1be3c860f7

2 years agoClarify `Layout` interning.
Nicholas Nethercote [Fri, 4 Mar 2022 02:46:56 +0000 (13:46 +1100)]
Clarify `Layout` interning.

`Layout` is another type that is sometimes interned, sometimes not, and
we always use references to refer to it so we can't take any advantage
of the uniqueness properties for hashing or equality checks.

This commit renames `Layout` as `LayoutS`, and then introduces a new
`Layout` that is a newtype around an `Interned<LayoutS>`. It also
interns more layouts than before. Previously layouts within layouts
(via the `variants` field) were never interned, but now they are. Hence
the lifetime on the new `Layout` type.

Unlike other interned types, these ones are in `rustc_target` instead of
`rustc_middle`. This reflects the existing structure of the code, which
does layout-specific stuff in `rustc_target` while `TyAndLayout` is
generic over the `Ty`, allowing the type-specific stuff to occur in
`rustc_middle`.

The commit also adds a `HashStable` impl for `Interned`, which was
needed. It hashes the contents, unlike the `Hash` impl which hashes the
pointer.

2 years agoIntroduce `ConstAllocation`.
Nicholas Nethercote [Tue, 1 Mar 2022 20:15:04 +0000 (07:15 +1100)]
Introduce `ConstAllocation`.

Currently some `Allocation`s are interned, some are not, and it's very
hard to tell at a use point which is which.

This commit introduces `ConstAllocation` for the known-interned ones,
which makes the division much clearer. `ConstAllocation::inner()` is
used to get the underlying `Allocation`.

In some places it's natural to use an `Allocation`, in some it's natural
to use a `ConstAllocation`, and in some places there's no clear choice.
I've tried to make things look as nice as possible, while generally
favouring `ConstAllocation`, which is the type that embodies more
information. This does require quite a few calls to `inner()`.

The commit also tweaks how `PartialOrd` works for `Interned`. The
previous code was too clever by half, building on `T: Ord` to make the
code shorter. That caused problems with deriving `PartialOrd` and `Ord`
for `ConstAllocation`, so I changed it to build on `T: PartialOrd`,
which is slightly more verbose but much more standard and avoided the
problems.

2 years agoFix typo
bjorn3 [Fri, 4 Mar 2022 19:45:04 +0000 (20:45 +0100)]
Fix typo

2 years agoAdd -Z oom={panic,abort} command-line option
Amanieu d'Antras [Wed, 6 Oct 2021 14:52:54 +0000 (15:52 +0100)]
Add -Z oom={panic,abort} command-line option

2 years agorename ErrorReported -> ErrorGuaranteed
mark [Sun, 23 Jan 2022 18:34:26 +0000 (12:34 -0600)]
rename ErrorReported -> ErrorGuaranteed

2 years agoNormalize main return type during mono item collection & codegen
Tomasz Miąsko [Wed, 23 Feb 2022 00:00:00 +0000 (00:00 +0000)]
Normalize main return type during mono item collection & codegen

2 years agoMerge branch 'sync_from_rust'
bjorn3 [Wed, 23 Feb 2022 10:51:21 +0000 (11:51 +0100)]
Merge branch 'sync_from_rust'

2 years agoMerge commit '35d9c6bf256968e1b40e0d554607928bdf9cebea' into sync_cg_clif-2022-02-23
bjorn3 [Wed, 23 Feb 2022 10:49:34 +0000 (11:49 +0100)]
Merge commit '35d9c6bf256968e1b40e0d554607928bdf9cebea' into sync_cg_clif-2022-02-23

2 years agoRustup to rustc 1.61.0-nightly (68369a041 2022-02-22)
bjorn3 [Wed, 23 Feb 2022 10:45:41 +0000 (11:45 +0100)]
Rustup to rustc 1.61.0-nightly (68369a041 2022-02-22)

2 years agoSync from rust bafe8d06e015eb00724d3d497516191d6681943f
bjorn3 [Wed, 23 Feb 2022 10:38:28 +0000 (11:38 +0100)]
Sync from rust bafe8d06e015eb00724d3d497516191d6681943f

2 years agoRustup to rustc 1.61.0-nightly (03a8cc7df 2022-02-21)
bjorn3 [Tue, 22 Feb 2022 19:37:22 +0000 (20:37 +0100)]
Rustup to rustc 1.61.0-nightly (03a8cc7df 2022-02-21)

2 years agoSync from rust 03a8cc7df1d65554a4d40825b0490c93ac0f0236
bjorn3 [Tue, 22 Feb 2022 18:55:24 +0000 (19:55 +0100)]
Sync from rust 03a8cc7df1d65554a4d40825b0490c93ac0f0236

2 years agoRollup merge of #94169 - Amanieu:asm_stuff, r=nagisa
Matthias Krüger [Tue, 22 Feb 2022 11:16:28 +0000 (12:16 +0100)]
Rollup merge of #94169 - Amanieu:asm_stuff, r=nagisa

Fix several asm! related issues

This is a combination of several fixes, each split into a separate commit. Splitting these into PRs is not practical since they conflict with each other.

Fixes #92378
Fixes #85247

r? ``@nagisa``

2 years agoTake CodegenFnAttrs into account when validating asm! register operands
Amanieu d'Antras [Thu, 17 Feb 2022 18:16:04 +0000 (18:16 +0000)]
Take CodegenFnAttrs into account when validating asm! register operands

Checking of asm! register operands now properly takes function
attributes such as #[target_feature] and #[instruction_set] into
account.

2 years agoOn ARM, use relocation_model to detect whether r9 should be reserved
Amanieu d'Antras [Thu, 17 Feb 2022 14:16:52 +0000 (14:16 +0000)]
On ARM, use relocation_model to detect whether r9 should be reserved

The previous approach of checking for the reserve-r9 target feature
didn't actually work because LLVM only sets this feature very late when
initializing the per-function subtarget.

2 years agouse `List<Ty<'tcx>>` for tuples
lcnr [Mon, 7 Feb 2022 15:06:31 +0000 (16:06 +0100)]
use `List<Ty<'tcx>>` for tuples

2 years agoUpdate ignored rustc tests list
bjorn3 [Sun, 20 Feb 2022 16:03:47 +0000 (17:03 +0100)]
Update ignored rustc tests list

2 years agoRustup to rustc 1.61.0-nightly (3b348d932 2022-02-19)
bjorn3 [Sun, 20 Feb 2022 15:28:22 +0000 (16:28 +0100)]
Rustup to rustc 1.61.0-nightly (3b348d932 2022-02-19)

2 years agoMove ty::print methods to Drop-based scope guards
Mark Rousskov [Wed, 16 Feb 2022 18:04:48 +0000 (13:04 -0500)]
Move ty::print methods to Drop-based scope guards

2 years agoRustup to rustc 1.60.0-nightly (09cb29c64 2022-02-15)
bjorn3 [Wed, 16 Feb 2022 11:43:07 +0000 (12:43 +0100)]
Rustup to rustc 1.60.0-nightly (09cb29c64 2022-02-15)

2 years agoSync from rust a240ccd81c74c105b6f5fe84c46f8d36edb7e306
bjorn3 [Wed, 16 Feb 2022 11:14:53 +0000 (12:14 +0100)]
Sync from rust a240ccd81c74c105b6f5fe84c46f8d36edb7e306

2 years agoOverhaul `Const`.
Nicholas Nethercote [Wed, 2 Feb 2022 03:24:45 +0000 (14:24 +1100)]
Overhaul `Const`.

Specifically, rename the `Const` struct as `ConstS` and re-introduce `Const` as
this:
```
pub struct Const<'tcx>(&'tcx Interned<ConstS>);
```
This now matches `Ty` and `Predicate` more closely, including using
pointer-based `eq` and `hash`.

Notable changes:
- `mk_const` now takes a `ConstS`.
- `Const` was copy, despite being 48 bytes. Now `ConstS` is not, so need a
  we need separate arena for it, because we can't use the `Dropless` one any
  more.
- Many `&'tcx Const<'tcx>`/`&Const<'tcx>` to `Const<'tcx>` changes
- Many `ct.ty` to `ct.ty()` and `ct.val` to `ct.val()` changes.
- Lots of tedious sigil fiddling.

2 years agoOverhaul `RegionKind` and `Region`.
Nicholas Nethercote [Fri, 28 Jan 2022 00:25:15 +0000 (11:25 +1100)]
Overhaul `RegionKind` and `Region`.

Specifically, change `Region` from this:
```
pub type Region<'tcx> = &'tcx RegionKind;
```
to this:
```
pub struct Region<'tcx>(&'tcx Interned<RegionKind>);
```

This now matches `Ty` and `Predicate` more closely.

Things to note
- Regions have always been interned, but we haven't been using pointer-based
  `Eq` and `Hash`. This is now happening.
- I chose to impl `Deref` for `Region` because it makes pattern matching a lot
  nicer, and `Region` can be viewed as just a smart wrapper for `RegionKind`.
- Various methods are moved from `RegionKind` to `Region`.
- There is a lot of tedious sigil changes.
- A couple of types like `HighlightBuilder`, `RegionHighlightMode` now have a
  `'tcx` lifetime because they hold a `Ty<'tcx>`, so they can call `mk_region`.
- A couple of test outputs change slightly, I'm not sure why, but the new
  outputs are a little better.

2 years agoOverhaul `TyS` and `Ty`.
Nicholas Nethercote [Tue, 25 Jan 2022 03:13:38 +0000 (14:13 +1100)]
Overhaul `TyS` and `Ty`.

Specifically, change `Ty` from this:
```
pub type Ty<'tcx> = &'tcx TyS<'tcx>;
```
to this
```
pub struct Ty<'tcx>(Interned<'tcx, TyS<'tcx>>);
```
There are two benefits to this.
- It's now a first class type, so we can define methods on it. This
  means we can move a lot of methods away from `TyS`, leaving `TyS` as a
  barely-used type, which is appropriate given that it's not meant to
  be used directly.
- The uniqueness requirement is now explicit, via the `Interned` type.
  E.g. the pointer-based `Eq` and `Hash` comes from `Interned`, rather
  than via `TyS`, which wasn't obvious at all.

Much of this commit is boring churn. The interesting changes are in
these files:
- compiler/rustc_middle/src/arena.rs
- compiler/rustc_middle/src/mir/visit.rs
- compiler/rustc_middle/src/ty/context.rs
- compiler/rustc_middle/src/ty/mod.rs

Specifically:
- Most mentions of `TyS` are removed. It's very much a dumb struct now;
  `Ty` has all the smarts.
- `TyS` now has `crate` visibility instead of `pub`.
- `TyS::make_for_test` is removed in favour of the static `BOOL_TY`,
  which just works better with the new structure.
- The `Eq`/`Ord`/`Hash` impls are removed from `TyS`. `Interned`s impls
  of `Eq`/`Hash` now suffice. `Ord` is now partly on `Interned`
  (pointer-based, for the `Equal` case) and partly on `TyS`
  (contents-based, for the other cases).
- There are many tedious sigil adjustments, i.e. adding or removing `*`
  or `&`. They seem to be unavoidable.

2 years agoRustup to rustc 1.60.0-nightly (5d8767cb2 2022-02-12)
bjorn3 [Sun, 13 Feb 2022 11:24:02 +0000 (12:24 +0100)]
Rustup to rustc 1.60.0-nightly (5d8767cb2 2022-02-12)

2 years agoSync from rust 9a60099cc43c8a07abb280be323d1ed9afc27f2c
bjorn3 [Sun, 13 Feb 2022 10:57:51 +0000 (11:57 +0100)]
Sync from rust 9a60099cc43c8a07abb280be323d1ed9afc27f2c