about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2022-06-21Address review comments from #98259Joshua Nelson-1/+15
It got merged so fast I didn't have time to make changes xD
2022-06-22Rollup merge of #98099 - RalfJung:convert_tag_add_extra, r=oli-obkYuki Okushi-6/+6
interpret: convert_tag_add_extra: allow tagger to raise errors Needed for https://github.com/rust-lang/miri/issues/2234 r? `@oli-obk`
2022-06-21Perform wf checking per module.Camille GILLOT-0/+4
2022-06-21Only keep a single well-formed query.Camille GILLOT-24/+5
2022-06-21Remove unecessary references to TypeFolder::ErrorAlan Egerton-21/+15
2022-06-21Reverse folder hierarchyAlan Egerton-34/+21
#91318 introduced a trait for infallible folders distinct from the fallible version. For some reason (completely unfathomable to me now that I look at it with fresh eyes), the infallible trait was a supertrait of the fallible one: that is, all fallible folders were required to also be infallible. Moreover the `Error` associated type was defined on the infallible trait! It's so absurd that it has me questioning whether I was entirely sane. This trait reverses the hierarchy, so that the fallible trait is a supertrait of the infallible one: all infallible folders are required to also be fallible (which is a trivial blanket implementation). This of course makes much more sense! It also enables the `Error` associated type to sit on the fallible trait, where it sensibly belongs. There is one downside however: folders expose a `tcx` accessor method. Since the blanket fallible implementation for infallible folders only has access to a generic `F: TypeFolder`, we need that trait to expose such an accessor to which we can delegate. Alternatively it's possible to extract that accessor into a separate `HasTcx` trait (or similar) that would then be a supertrait of both the fallible and infallible folder traits: this would ensure that there's only one unambiguous `tcx` method, at the cost of a little additional boilerplate. If desired, I can submit that as a separate PR. r? @jackh726
2022-06-21Auto merge of #98335 - JohnTitor:rollup-j2zudxv, r=JohnTitorbors-0/+7
Rollup of 11 pull requests Successful merges: - #94033 (Improve docs for `is_running` to explain use case) - #97269 (adjust transmute const stabilization version) - #97805 (Add proper tracing spans to rustc_trait_selection::traits::error_reporting) - #98022 (Fix erroneous span for borrowck error) - #98124 (Improve loading of crates.js and sidebar-items.js) - #98278 (Some token stream cleanups) - #98306 (`try_fold_unevaluated` for infallible folders) - #98313 (Remove lies in comments.) - #98323 (:arrow_up: rust-analyzer) - #98329 (Avoid an ICE and instead let the compiler report a useful error) - #98330 (update ioslice docs to use shared slices) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-21Rollup merge of #98306 - ↵Yuki Okushi-0/+7
eggyal:add-unevaluated-to-blanket-fallibletypefolder, r=nnethercote `try_fold_unevaluated` for infallible folders #97447 added folding of unevaluated constants, but did not include an override of the default (fallible) operation in the blanket impl of `FallibleTypeFolder` for infallible folders. Here we provide that missing override. r? ```@nnethercote```
2022-06-21Auto merge of #95576 - DrMeepster:box_erasure, r=oli-obkbors-0/+1
Remove dereferencing of Box from codegen Through #94043, #94414, #94873, and #95328, I've been fixing issues caused by Box being treated like a pointer when it is not a pointer. However, these PRs just introduced special cases for Box. This PR removes those special cases and instead transforms a deref of Box into a deref of the pointer it contains. Hopefully, this is the end of the Box<T, A> ICEs.
2022-06-20Rollup merge of #98267 - compiler-errors:suggest-wildcard-arm, r=oli-obkMatthias Krüger-1/+1
Don't omit comma when suggesting wildcard arm after macro expr * Also adds `Span::eq_ctxt` to consolidate the various usages of `span.ctxt() == other.ctxt()` * Also fixes an unhygenic usage of spans which caused the suggestion to render weirdly when we had one arm match in a macro * Also always suggests a comma (i.e. even after a block) if we're rendering a wildcard arm in a single-line match (looks prettier :rose:) Fixes #94866
2022-06-20`try_fold_unevaluated` for infallible foldersAlan Egerton-0/+7
#97447 added folding of unevaluated constants, but did not include an override of the default (fallible) operation in the blanket impl of `FallibleTypeFolder` for infallible folders. Here we provide that missing override. r? @nnethercote
2022-06-19Use `Span::eq_ctxt` method instead of `.ctxt() == .ctxt()`Michael Goulet-1/+1
2022-06-19Auto merge of #98247 - jackh726:regionkind-rustc-type-ir, r=compiler-errorsbors-311/+40
Move RegionKind to rustc_type_ir (Also UniverseIndex) r? rust-lang/types
2022-06-19Auto merge of #98255 - Dylan-DPC:rollup-hr129rg, r=Dylan-DPCbors-5/+5
Rollup of 5 pull requests Successful merges: - #98105 (rustdoc: remove tuple link on round braces) - #98136 (Rename `impl_constness` to `constness`) - #98146 (Remove --memory-init-file flag when linking with Emscripten) - #98219 (Skip late bound regions in GATSubstCollector) - #98233 (Remove accidental uses of `&A: Allocator`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-06-19Rollup merge of #98136 - fee1-dead-contrib:rename_impl_constness, r=oli-obkDylan DPC-5/+5
Rename `impl_constness` to `constness` The current code is a basis for `is_const_fn_raw`, and `impl_constness` is no longer a valid name, which is previously used for determining the constness of impls, and not items in general. r? `@oli-obk`
2022-06-19Use `ensure` for `UnusedBrokenConst`.Camille GILLOT-1/+34
2022-06-19Move RegionKind to rustc_type_irJack Huey-311/+40
2022-06-18Auto merge of #98153 - nnethercote:fix-MissingDoc-quadratic-behaviour, ↵bors-4/+3
r=cjgillot Fix `MissingDoc` quadratic behaviour Best reviewed one commit at a time. r? `@cjgillot`
2022-06-18Remove `likely!` and `unlikely!` macro from compilerGary Guo-1/+1
2022-06-17Auto merge of #98097 - lqd:const-alloc-hash, r=oli-obkbors-2/+75
ctfe: limit hashing of big const allocations when interning Const allocations are only hashed for interning. However, they can be large, making the hashing expensive especially since it uses `FxHash`: it's better suited to short keys, not potentially big buffers like the actual bytes of allocation and the associated 1/8th sized `InitMask`. We can partially hash these fields when they're large, hashing the length, and head and tail of these buffers, to limit possible collisions while avoiding most of the hashing work. r? `@ghost`
2022-06-17Auto merge of #98106 - cjgillot:split-definitions, r=michaelwoeristerbors-59/+122
Split up `Definitions` and `ResolverAstLowering`. Split off https://github.com/rust-lang/rust/pull/95573 r? `@michaelwoerister`
2022-06-16adjust const alloc interning partial hash commentsRémy Rakic-4/+8
2022-06-16ctfe: limit hashing of big const allocations when interningRémy Rakic-2/+71
Big const allocations hash a large amount of data for interning: the whole bytes buffer, and the 1/8th sized initmask, with FxHash. This hash function is made for shorter keys. This only hashes the length, and head and tail of these buffers, to limit possible collisions while avoiding most of the hashing work.
2022-06-16interpret: convert_tag_add_extra, init_allocation_extra: allow tagger to ↵Ralf Jung-6/+6
raise errors
2022-06-16Rollup merge of #97757 - xFrednet:rfc-2383-expect-with-force-warn, ↵Matthias Krüger-5/+11
r=wesleywiser,flip1995 Support lint expectations for `--force-warn` lints (RFC 2383) Rustc has a `--force-warn` flag, which overrides lint level attributes and forces the diagnostics to always be warn. This means, that for lint expectations, the diagnostic can't be suppressed as usual. This also means that the expectation would not be fulfilled, even if a lint had been triggered in the expected scope. This PR now also tracks the expectation ID in the `ForceWarn` level. I've also made some minor adjustments, to possibly catch more bugs and make the whole implementation more robust. This will probably conflict with https://github.com/rust-lang/rust/pull/97718. That PR should ideally be reviewed and merged first. The conflict itself will be trivial to fix. --- r? `@wesleywiser` cc: `@flip1995` since you've helped with the initial review and also discussed this topic with me. :upside_down_face: Follow-up of: https://github.com/rust-lang/rust/pull/87835 Issue: https://github.com/rust-lang/rust/issues/85549 Yeah, and that's it.
2022-06-16Support lint expectations for `--force-warn` lints (RFC 2383)xFrednet-5/+11
2022-06-15correct mirphase docsDrMeepster-2/+2
2022-06-15remove box derefs from codgenDrMeepster-1/+2
2022-06-16Remove unused `hir_id` arg from `visit_attribute`.Nicholas Nethercote-4/+3
2022-06-15Consume resolutions for lowering separately.Camille GILLOT-0/+5
2022-06-15Remove unused item_generics_num_lifetimes.Camille GILLOT-1/+0
2022-06-15Rename `impl_constness` to `constness`Deadbeef-5/+5
The current code is a basis for `is_const_fn_raw`, and `impl_constness` is no longer a valid name, which is previously used for determining the constness of impls, and not items in general.
2022-06-15Rollup merge of #98110 - cjgillot:closure-brace, r=Aaron1011Yuki Okushi-6/+6
Make `ExprKind::Closure` a struct variant. Simple refactor since we both need it to introduce additional fields in `ExprKind::Closure`. r? ``@Aaron1011``
2022-06-15Rollup merge of #98083 - nnethercote:rename-Encoder, r=bjorn3Yuki Okushi-14/+14
Rename rustc_serialize::opaque::Encoder as MemEncoder. This avoids the name clash with `rustc_serialize::Encoder` (a trait), and allows lots qualifiers to be removed and imports to be simplified (e.g. fewer `as` imports). (This was previously merged as commit 5 in #94732 and then was reverted in #97905 because of a perf regression caused by commit 4 in #94732.) r? ```@bjorn3```
2022-06-14Separate `source_span` and `expn_that_defined` from `Definitions`.Camille GILLOT-15/+56
2022-06-14Make ResolverAstLowering a struct.Camille GILLOT-1/+28
2022-06-14Separate Definitions and CrateStore from ResolverOutputs.Camille GILLOT-58/+49
2022-06-14rebaseb-naber-72/+30
2022-06-14rebaseb-naber-1/+1
2022-06-14address reviewb-naber-32/+9
2022-06-14address reviewb-naber-12/+17
2022-06-14fix clippy test failuresb-naber-0/+8
2022-06-14implement valtrees as the type-system representation for constant valuesb-naber-260/+600
2022-06-14Rename rustc_serialize::opaque::Encoder as MemEncoder.Nicholas Nethercote-14/+14
This avoids the name clash with `rustc_serialize::Encoder` (a trait), and allows lots qualifiers to be removed and imports to be simplified (e.g. fewer `as` imports). (This was previously merged as commit 5 in #94732 and then was reverted in #97905 because of a perf regression caused by commit 4 in #94732.)
2022-06-14Rename the `ConstS::val` field as `kind`.Nicholas Nethercote-63/+66
And likewise for the `Const::val` method. Because its type is called `ConstKind`. Also `val` is a confusing name because `ConstKind` is an enum with seven variants, one of which is called `Value`. Also, this gives consistency with `TyS` and `PredicateS` which have `kind` fields. The commit also renames a few `Const` variables from `val` to `c`, to avoid confusion with the `ConstKind::Value` variant.
2022-06-13Rollup merge of #98043 - TaKO8Ki:remove-unnecessary-to-string, r=davidtwcoMatthias Krüger-3/+3
Remove unnecessary `to_string` and `String::new` https://github.com/rust-lang/rust/pull/96468/commits/73fa217bc11fbac76f730223f6766c8e03513b5e changed the type of the `suggestion` argument to `impl ToString`. This patch removes unnecessary `to_string` and `String::new`. cc: `````@davidtwco`````
2022-06-13Rollup merge of #97709 - compiler-errors:normalize-const-param-ty, r=oli-obkMatthias Krüger-4/+9
Normalize consts' tys when relating with `adt_const_params` Fixes #97007
2022-06-13remove unnecessary `to_string` and `String::new`Takayuki Maeda-3/+3
2022-06-11Try out `yeet` in the MIR interpreterScott McMurray-5/+6
2022-06-11Address commentsMichael Goulet-17/+24