summary refs log tree commit diff
path: root/compiler/rustc_middle/src
AgeCommit message (Collapse)AuthorLines
2021-02-04Rollup merge of #81556 - nikomatsakis:forbidden-lint-groups-lint, r=pnkfelixMara Bos-3/+11
introduce future-compatibility warning for forbidden lint groups We used to ignore `forbid(group)` scenarios completely. This changed in #78864, but that led to a number of regressions (#80988, #81218). This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect. r? ``@Mark-Simulacrum``
2020-12-25Rollup merge of #80342 - pierwill:patch-1, r=lcnrDylan DPC-1/+1
Fix typo
2020-12-25Rollup merge of #80327 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomezDylan DPC-4/+1
Updated the match with the matches macro r?````@GuillaumeGomez````
2020-12-25Rollup merge of #80274 - pierwill:lintlevelsource, r=petrochenkovDylan DPC-18/+19
Rename rustc_middle::lint::LintSource Rename [`rustc_middle::lint::LintSource`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/lint/enum.LintSource.html) to `rustc_middle::lint::LintLevelSource`. This enum represents the source of a *lint level*, not a lint. This should improve code readability. Update: Also documents `rustc_middle::lint::LevelSource` to clarify.
2020-12-23Fix typopierwill-1/+1
2020-12-23Updated the match with the matches macroPankajChaudhary5-4/+1
2020-12-23Rollup merge of #80302 - pierwill:fix-80287, r=lcnrGuillaume Gomez-4/+2
docs: Update rustc_middle::middle::region::ScopeTree Correct return type in docs for [`yield_in_source`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/middle/region/struct.ScopeTree.html#method.yield_in_scope) method. Closes #80287.
2020-12-23Rollup merge of #80298 - PankajChaudhary5:PankajChaudhary, r=GuillaumeGomezGuillaume Gomez-8/+2
Improve the code quality by using matches macro Improved the code quality by using matches macro r? `@GuillaumeGomez`
2020-12-23Rollup merge of #80286 - pierwill:rustc-middle-privacy, r=petrochenkovGuillaume Gomez-4/+6
docs: Edit rustc_middle::middle::privacy Add descriptions of `AccessLevel` and `AccessLevels`. Add missing punctuation.
2020-12-23Rollup merge of #80241 - pierwill:patch-12, r=lcnrGuillaume Gomez-1/+1
Fix typo Fix typo in rustc_middle::ty::inhabitedness::DefIdForest docs.
2020-12-23Rollup merge of #80225 - pierwill:patch-11, r=lcnrGuillaume Gomez-0/+11
Add module-level docs to rustc_middle::ty I thought it would be nice to point out `Ty` and `TyCtxt` on the module page, and link out to the [rustc-dev-guide chapter](https://rustc-dev-guide.rust-lang.org/ty.html).
2020-12-23Rollup merge of #80223 - pierwill:patch-10, r=lcnrGuillaume Gomez-1/+1
docs: Fix outdated crate reference
2020-12-23Rollup merge of #80204 - pierwill:pierwill-rustcmiddle-ondisk, r=varkorGuillaume Gomez-2/+2
docs: Edit rustc_middle::ty::query::on_disk_cache Expand abbreviations for "incremental compliation". Also added the word "to" to the description of CacheEncoder.
2020-12-23Rollup merge of #80203 - pierwill:pierwill-rustcmiddle-lint, r=oli-obkGuillaume Gomez-2/+2
Edit rustc_middle::lint::LintSource docs Edit punctuation in doc comment for [rustc_middle::lint::LintSource::CommandLine](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/lint/enum.LintSource.html#variant.CommandLine).
2020-12-22Auto merge of #80177 - tgnottingham:foreign_defpathhash_registration, ↵bors-13/+31
r=Aaron1011 rustc_query_system: explicitly register reused dep nodes Register nodes that we've reused from the previous session explicitly with `OnDiskCache`. Previously, we relied on this happening as a side effect of accessing the nodes in the `PreviousDepGraph`. For the sake of performance and avoiding unintended side effects, register explictily.
2020-12-22docs: Update rustc_middle::middle::region::ScopeTreepierwill-4/+2
This corrects the return type in docs for yield_in_source method. Closes #80287.
2020-12-22Improve the code quality by using matches macroPankajChaudhary5-8/+2
2020-12-21docs: Edit rustc_middle::middle::privacypierwill-4/+6
Add descriptions of `AccessLevel` and `AccessLevels`. Add missing punctuation.
2020-12-21Document rustc_middle::lint::LevelSourcepierwill-0/+1
This is to clarify the difference between `LevelSource` and `LintLevelSource`. Appease x.py fmt.
2020-12-21Rename rustc_middle::lint::LintSourcepierwill-18/+18
Rename rustc_middle::lint::LintSource to rustc_middle::lint::LintLevelSource.
2020-12-21Rollup merge of #80171 - pierwill:pierwill-rustcmiddle-tykind, r=lcnrDylan DPC-3/+5
Edit rustc_middle::ty::TyKind docs - Add a definition for this enum. - Fix typo and missing punctuation. - Spell out "algebraic data type".
2020-12-21Rollup merge of #80166 - pierwill:pierwill-rustcmiddle-place, r=petrochenkovDylan DPC-10/+10
Edit rustc_middle docs Re-word doc comment for rustc_middle::hir::place::Projection. Also adds: - Missing end stop punctuation, and - Documentation links to `rustc_middle::mir::Place`.
2020-12-20Edit rustc_middle docspierwill-10/+10
Re-word doc comment for rustc_middle::hir::place::Projection. Also adds: - Missing end stop punctuation, and - Documentation links to `rustc_middle::mir::Place`.
2020-12-20Fix typopierwill-1/+1
Fix typo in rustc_middle::ty::inhabitedness::DefIdForest docs.
2020-12-20Edit rustc_middle::ty::TyKind docspierwill-3/+5
- Add a definition for this enum. - Fix typo and missing punctuation. - Spell out "algebraic data type".
2020-12-20Add module-level docs to rustc_middle::typierwill-0/+11
2020-12-19docs: Fix outdated crate referencepierwill-1/+1
2020-12-20Auto merge of #80163 - jackh726:binder-refactor-part-3, r=lcnrbors-76/+78
Make BoundRegion have a kind of BoungRegionKind Split from #76814 Also includes making `replace_escaping_bound_vars` only return `T` Going to r? `@lcnr` Feel free to reassign
2020-12-20Auto merge of #79635 - lcnr:const-eval-idk, r=oli-obkbors-1/+10
const_evaluatable_checked: fix occurs check fixes #79615 this is kind of a hack because we use `TypeRelation` for both the `Generalizer` and the `ConstInferUnifier` but i am not sure if there is a useful way to disentangle this without unnecessarily duplicating some code. The error in the added test is kind of unavoidable until we erase the unused substs of `ConstKind::Unevaluated`. We talked a bit about this in the cg lazy norm meeting (https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/lazy_normalization_consts)
2020-12-19docs: Edit rustc_middle::ty::query::on_disk_cachepierwill-2/+2
Expand abbreviations for "incremental compliation". Also added the word "to" to the description of CacheEncoder.
2020-12-19Edit rustc_middle::lint::LintSource docspierwill-2/+2
Edit punctuation in doc comment for rustc_middle::lint::LintSource::CommandLine.
2020-12-19More rebindsJack Huey-8/+15
2020-12-18OnDiskCache: avoid storing local def id hashes in foreign def id collectionTyson Nottingham-2/+4
2020-12-18rustc_query_system: explicitly register reused dep nodesTyson Nottingham-12/+28
Register nodes that we've reused from the previous session explicitly with `OnDiskCache`. Previously, we relied on this happening as a side effect of accessing the nodes in the `PreviousDepGraph`. For the sake of performance and avoiding unintended side effects, register explictily.
2020-12-18Change potentially_qualified to be defined on Binder<PredicateAtom>Jack Huey-10/+14
2020-12-18Make BoundRegion have a kind of BoungRegionKindJack Huey-76/+78
2020-12-17Auto merge of #79945 - jackh726:existential_trait_ref, r=nikomatsakisbors-137/+173
Move binder for dyn to each list item This essentially changes `ty::Binder<&'tcx List<ExistentialTraitRef>>` to `&'tcx List<ty::Binder<ExistentialTraitRef>>`. This is a first step in moving the `dyn Trait` representation closer to Chalk, which we've talked about in `@rust-lang/wg-traits.` r? `@nikomatsakis`
2020-12-17Auto merge of #79840 - dvtkrlbs:issue-79667, r=oli-obkbors-1/+0
Remove memoization leftovers from constant evaluation machine Closes #79667
2020-12-17Rollup merge of #80039 - LeSeulArtichaut:rm-tyencoder-tcx, r=matthewjasperYuki Okushi-4/+0
Remove unused `TyEncoder::tcx` required method Unsure if this is helpful or not... r? ``@ghost`` cc ``@matthewjasper`` ``@jackh726``
2020-12-16Allow `since="TBD"` for rustc_deprecatedbstrie-35/+40
2020-12-15Auto merge of #78068 - RalfJung:union-safe-assign, r=nikomatsakisbors-3/+27
consider assignments of union field of ManuallyDrop type safe Assigning to `Copy` union fields is safe because that assignment will never drop anything. However, with https://github.com/rust-lang/rust/pull/77547, unions may also have `ManuallyDrop` fields, and their assignments are currently still unsafe. That seems unnecessary though, as assigning `ManuallyDrop` does not drop anything either, and is thus safe even for union fields. I assume this will at least require FCP.
2020-12-15Auto merge of #73210 - wesleywiser:consts_in_debuginfo, r=oli-obkbors-9/+28
[mir-opt] Allow debuginfo to be generated for a constant or a Place Prior to this commit, debuginfo was always generated by mapping a name to a Place. This has the side-effect that `SimplifyLocals` cannot remove locals that are only used for debuginfo because their other uses have been const-propagated. To allow these locals to be removed, we now allow debuginfo to point to a constant value. The `ConstProp` pass detects when debuginfo points to a local with a known constant value and replaces it with the value. This allows the later `SimplifyLocals` pass to remove the local.
2020-12-15Auto merge of #79922 - tmiasko:lower-discriminant, r=nagisabors-4/+35
Lower `discriminant_value` intrinsic This allows const propagation to evaluate comparisons involving field-less enums using derived implementations of `PartialEq` (after inlining `eq`).
2020-12-14Remove unused `TyEncoder::tcx` required methodLeSeulArtichaut-4/+0
2020-12-14Add explanation for skip_binder in relateJack Huey-0/+1
2020-12-12Auto merge of #79169 - LeSeulArtichaut:ty-lib, r=nikomatsakisbors-194/+4
Create `rustc_type_ir` Decided to start small 😄 This PR creates a `rustc_type_ir` crate as part of the WG-Traits plan to create a shared type library. ~~There already exists a `rustc_ty` crate, so I named the new crate `rustc_ty_library`. However I think it would make sense to rename the current `rustc_ty` to something else (e.g. `rustc_ty_passes`) to free the name for this new crate.~~ r? `@jackh726`
2020-12-12Auto merge of #79553 - sexxi-goose:mir_min_cap_writeback, r=nikomatsakisbors-12/+78
Capture precise paths in THIR and MIR This PR allows THIR and MIR to use the result of the new capture analysis to actually capture precise paths To achieve we: - Writeback min capture results to TypeckResults - Move handling upvars to PlaceBuilder in mir_build - Lower precise paths in THIR build by reading min_captures - Search for ancestors in min_capture when trying to build a MIR place which starts off of an upvar Closes: https://github.com/rust-lang/project-rfc-2229/issues/10 Partly implements: rust-lang/project-rfc-2229#18 Work that remains (not in this PR): - [ ] [Known bugs when feature gate is enabled](https://github.com/rust-lang/project-rfc-2229/projects/1?card_filter_query=label%3Abug) - [ ] Use min_capure_map for - [ ] Liveness analysis - [ ] rustc_mir/interpret/validity.rs - [ ] regionck - [ ] rust-lang/project-rfc-2229#8 - [ ] remove closure_captures and upvar_capture_map r? `@ghost`
2020-12-11Move binder for dyn to each list itemJack Huey-137/+172
2020-12-11Lower `discriminant_value` intrinsicTomasz Miąsko-4/+35
This allows const propagation to evaluate comparisons involving field-less enums using derived implementations of `PartialEq` (after inlining `eq`).
2020-12-10Use `def_path_hash_to_def_id` when re-using a `RawDefId`Aaron Hill-4/+22
Fixes #79890 Previously, we just copied a `RawDefId` from the 'old' map to the 'new' map. However, the `RawDefId` for a given `DefPathHash` may be different in the current compilation session. Using `def_path_hash_to_def_id` ensures that the `RawDefId` we use is valid in the current session.