about summary refs log tree commit diff
path: root/compiler/rustc_middle
AgeCommit message (Collapse)AuthorLines
2022-10-18`const_evaluatable_unchecked` to const evallcnr-1/+26
2022-10-18change `ConstEvaluatable` to use `ty::Const`lcnr-6/+34
2022-10-17Auto merge of #102355 - lcnr:bye-bye-type-traversal, r=oli-obkbors-185/+21
remove type traversal for mir constants r? `@oli-obk` cc `@b-naber`
2022-10-17add inline to `TrivialTypeTraversalImpls`lcnr-14/+17
2022-10-17rm `try_normalize_mir_const_after_erasing_regions`lcnr-8/+0
2022-10-17mir constants: type traversing bye byelcnr-169/+10
2022-10-17Duplicate comment in mod.rsSamuel Moelius-5/+0
2022-10-16Auto merge of #102026 - Bryanskiy:resolve_update, r=petrochenkovbors-32/+104
Populate effective visibilities in 'rustc_resolve' Next part of RFC https://github.com/rust-lang/rust/issues/48054. previous: https://github.com/rust-lang/rust/pull/101713 `@rustbot` author r? `@petrochenkov`
2022-10-16Populate effective visibilities in 'rustc_resolve'Bryanskiy-32/+104
2022-10-16Rollup merge of #102953 - WaffleLapkin:better_docs_for_decorate_param, ↵Matthias Krüger-0/+43
r=RalfJung Improve docs for `struct_lint_level` function. r? ``@RalfJung`` Does this answer your questions?
2022-10-16fix typoRalf Jung-1/+1
2022-10-15Fix subst issues with RPITITMichael Goulet-3/+16
2022-10-15Auto merge of #102895 - Nilstrieb:query-cleanups, r=cjgillotbors-2/+14
Get rid of `rustc_query_description!` **I am not entirely sure whether this is an improvement and would like to get your feedback on it.** Helps with #96524. Queries can provide an arbitrary expression for their description and their caching behavior. Before, these expressions where stored in a `rustc_query_description` macro emitted by the `rustc_queries` macro, and then used in `rustc_query_impl` to fill out the methods for the `QueryDescription` trait. Instead, we now emit two new modules from `rustc_queries` containing the functions with the expressions. `rustc_query_impl` calls these functions now instead of invoking the macro. Since we are now defining some of the functions in `rustc_middle::query`, we now need all the imports for the key types mthere as well. r? `@cjgillot`
2022-10-15Auto merge of #101832 - compiler-errors:dyn-star-plus, r=eholkbors-2/+5
Make `dyn*` casts into a coercion, allow `dyn*` upcasting I know that `dyn*` is likely not going to be a feature exposed to surface Rust, but this makes it slightly more ergonomic to write tests for these types anyways. ... and this was just fun to implement anyways. 1. Make `dyn*` into a coercion instead of a cast 2. Enable `dyn*` upcasting since we basically get it for free 3. Simplify some of the cast checking code since we're using the coercion path now r? `@eholk` but feel free to reassign cc `@nikomatsakis` and `@tmandry` who might care about making `dyn*` casts into a coercion
2022-10-14Fix line numbers for MIR inlined codeWesley Wiser-1/+3
`should_collapse_debuginfo` detects if the specified span is part of a macro expansion however it does this by checking if the span is anything other than a normal (non-expanded) kind, then the span sequence is walked backwards to the root span. This doesn't work when the MIR inliner inlines code as it creates spans with expansion information set to `ExprKind::Inlined` and results in the line number being attributed to the inline callsite rather than the normal line number of the inlined code.
2022-10-14Get rid of `rustc_query_description!`Nilstrieb-2/+14
Queries can provide an arbitrary expression for their description and their caching behavior. Before, these expressions where stored in a `rustc_query_description` macro emitted by the `rustc_queries` macro, and then used in `rustc_query_impl` to fill out the methods for the `QueryDescription` trait. Instead, we now emit two new modules from `rustc_queries` containing the functions with the expressions. `rustc_query_impl` calls these functions now instead of invoking the macro. Since we are now defining some of the functions in `rustc_middle::query`, we now need all the imports for the key types there as well.
2022-10-14Rollup merge of #103018 - Rageking8:more-dupe-word-typos, r=TaKO8KiDylan DPC-6/+4
More dupe word typos I only picked those changes (from the regex search) that I am pretty certain doesn't change meaning and is just a typo fix. Do correct me if any fix is undesirable and I can revert those. Thanks.
2022-10-14Require lifetime bounds for opaque types in order to allow hidden types to ↵Oli Scherer-2/+75
capture said lifetimes
2022-10-14Auto merge of #102695 - compiler-errors:int-and-float-trivial-copy, r=lcnrbors-1/+4
Int and float inference variables are trivially copy Fixes #102645
2022-10-14float and int vars are trivially copyMichael Goulet-1/+4
2022-10-14more dupe word typosRageking8-6/+4
2022-10-14Auto merge of #102684 - ↵bors-2/+1
JhonnyBillM:delete-target-data-layout-errors-wrapper, r=davidtwco Move `IntoDiagnostic` conformance for `TargetDataLayoutErrors` into `rustc_errors` Addressed this suggestion https://github.com/rust-lang/rust/pull/101558#issuecomment-1243830009. This way we comply with the Coherence rule given that `IntoDiagnostic` trait is defined in `rustc_errors`, and almost all other crates depend on it.
2022-10-14Make dyn* cast into a coercionMichael Goulet-2/+5
2022-10-13Auto merge of #102700 - oli-obk:0xDEAD_TAIT, r=compiler-errorsbors-5/+258
Check hidden types in dead code fixes #99490 r? `@compiler-errors` best reviewed commit by commit
2022-10-13Print RPITIT verbosely if -ZverboseMichael Goulet-1/+3
2022-10-12Auto merge of #101679 - compiler-errors:rpitit-default-body, r=nikomatsakisbors-0/+1
Support default-body trait functions with return-position `impl Trait` in traits Introduce a new `Trait` candidate kind for the `ImplTraitInTrait` projection candidate, which just projects an RPITIT down to its opaque type form. This is a hack until we lower RPITITs to regular associated types, after which we will need to rework how these default bodies are type-checked, so comments are left in a few places for us to clean up later. Fixes #101665
2022-10-12ADD - IntoDiagnostic conformance for TargetDataLayoutErrors in rustc_errorsJhonny Bill Mena-2/+1
This way we comply with the Coherence rule given that IntoDiagnostic trait is defined in rustc_errors, and almost all other crates depend on it.
2022-10-12link lint function with `decorate` function param to `struct_lint_level`Maybe Waffle-0/+10
2022-10-12Apply suggestions from code reviewWaffle Maybe-9/+4
Co-authored-by: Ralf Jung <post@ralfj.de>
2022-10-12Use `tidy-alphabetical` in the compilerNilstrieb-4/+8
2022-10-12Improve docs for `struct_lint_level` function.Maybe Waffle-0/+38
2022-10-12Rollup merge of #102890 - camsteffen:adt-sized-representability, r=cjgillotDylan DPC-27/+4
Check representability in adt_sized_constraint Now that representability is a query, we can use it to preemptively avoid a cycle in `adt_sized_constraint`. I moved the representability check into `check_mod_type_wf` to avoid a scenario where rustc quits before checking all the types for representability. This also removes the check from rustdoc, which is alright AFAIK. r? ``@cjgillot``
2022-10-12Rollup merge of #102110 - CleanCut:migrate_rustc_passes_diagnostics, r=davidtwcoDylan DPC-1/+20
Migrate rustc_passes diagnostics Picks up abandoned work from https://github.com/rust-lang/rust/pull/100870 I would like to do this collaboratively, as there is a lot of work! Here's the process: - Comment below that you are willing to help and I will add you as a collaborator to my `rust` fork (that gives you write access) - Indicate which file/task you would like to work on (so we don't duplicate work) from the list below - Do the work, push up a commit, comment that you're done with that file/task - Repeat until done 😄 ### Files to Migrate (in `compiler/rustc_passes/src/`) - [x] check_attr.rs ``@CleanCut`` - [x] check_const.rs ``@CleanCut`` - [x] dead.rs ``@CleanCut`` - [x] debugger_visualizer.rs ``@CleanCut`` - [x] diagnostic_items.rs ``@CleanCut`` - [x] entry.rs ``@CleanCut`` - [x] lang_items.rs ``@CleanCut`` - [x] layout_test.rs ``@CleanCut`` - [x] lib_features.rs ``@CleanCut`` - [x] ~liveness.rs~ ``@CleanCut`` Nothing to do - [x] loops.rs ``@CleanCut`` - [x] naked_functions.rs ``@CleanCut`` - [x] stability.rs ``@CleanCut`` - [x] weak_lang_items.rs ``@CleanCut`` ### Tasks - [x] Rebase on current `master` ``@CleanCut`` - [x] Review work from [the earlier PR](https://github.com/rust-lang/rust/pull/100870) and make sure it all looks good - [x] compiler/rustc_error_messages/locales/en-US/passes.ftl ``@CleanCut`` - [x] compiler/rustc_passes/src/check_attr.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/errors.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lang_items.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/lib.rs ``@CleanCut`` - [x] compiler/rustc_passes/src/weak_lang_items.rs ``@CleanCut``
2022-10-11Rollup merge of #101727 - est31:stabilize_map_first_last, r=m-ou-seMatthias Krüger-1/+0
Stabilize map_first_last Stabilizes the following functions: ```Rust impl<T> BTreeSet<T> { pub fn first(&self) -> Option<&T> where T: Ord; pub fn last(&self) -> Option<&T> where T: Ord; pub fn pop_first(&mut self) -> Option<T> where T: Ord; pub fn pop_last(&mut self) -> Option<T> where T: Ord; } impl<K, V> BTreeMap<K, V> { pub fn first_key_value(&self) -> Option<(&K, &V)> where K: Ord; pub fn last_key_value(&self) -> Option<(&K, &V)> where K: Ord; pub fn first_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord; pub fn last_entry(&mut self) -> Option<OccupiedEntry<'_, K, V>> where K: Ord; pub fn pop_first(&mut self) -> Option<(K, V)> where K: Ord; pub fn pop_last(&mut self) -> Option<(K, V)> where K: Ord; } ``` Closes #62924 ~~Blocked on the [FCP](https://github.com/rust-lang/rust/issues/62924#issuecomment-1179489929) finishing.~~ Edit: It finished!
2022-10-10Check representability in adt_sized_constraintCameron Steffen-27/+4
2022-10-10Fix compiler docsGuillaume Gomez-3/+3
2022-10-10Rollup merge of #102786 - compiler-errors:no-tuple-candidate, r=lcnrDylan DPC-14/+2
Remove tuple candidate, nothing special about it r? `@lcnr` you mentioned this during the talk you gave i think
2022-10-10Rollup merge of #102275 - Urgau:stabilize-half_open_range_patterns, r=cjgillotYuki Okushi-1/+1
Stabilize `half_open_range_patterns` This PR stabilize `feature(half_open_range_patterns)`: ``` Allows using `..=X` as a pattern. ``` And adds a new `feature(half_open_range_patterns_in_slices)` for the slice part, https://github.com/rust-lang/rust/pull/102275#issuecomment-1267422806. The FCP was completed in https://github.com/rust-lang/rust/issues/67264.
2022-10-10Rollup merge of #102829 - compiler-errors:rename-impl-item-kind, r=TaKO8KiYuki Okushi-2/+2
rename `ImplItemKind::TyAlias` to `ImplItemKind::Type` The naming of this variant seems inconsistent given that this is not really a "type alias", and the associated type variant for `TraitItemKind` is just called `Type`.
2022-10-09ImplItemKind::TyAlias => ImplItemKind::TypeMichael Goulet-2/+2
2022-10-08Rollup merge of #102514 - b-naber:binder-print-fixes, r=jackh726Michael Howell-12/+63
Don't repeat lifetime names from outer binder in print Fixes https://github.com/rust-lang/rust/issues/102392 Fixes https://github.com/rust-lang/rust/issues/102414 r? ```@lcnr```
2022-10-08handle late-bound vars from inner binders correctly and add testb-naber-1/+1
2022-10-08Auto merge of #102809 - matthiaskrgr:rollup-qq62vuv, r=matthiaskrgrbors-5/+42
Rollup of 8 pull requests Successful merges: - #101520 (Allow transmutes between the same types after erasing lifetimes) - #102675 (Remove `mir::CastKind::Misc`) - #102778 (Fix MIR inlining of asm_unwind) - #102785 (Remove `DefId` from some `SelectionCandidate` variants) - #102788 (Update rustc-dev-guide) - #102789 (Update browser UI test version) - #102797 (rustdoc: remove no-op CSS `.rightside { position: initial }`) - #102798 (rustdoc: add main-heading and example-wrap link CSS to big selector) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-08Rollup merge of #102785 - fee1-dead-contrib:rm_autoimpl_defid, r=compiler-errorsMatthias Krüger-2/+2
Remove `DefId` from some `SelectionCandidate` variants They are both from `obligation.predicate.def_id()`, which do not need to be on the `SelectionCandidate`. cc ````@lcnr```` ````@compiler-errors````
2022-10-08Rollup merge of #102675 - ouz-a:mir-technical-debt, r=oli-obkMatthias Krüger-3/+40
Remove `mir::CastKind::Misc` As discussed in #97649 `mir::CastKind::Misc` is not clear, this PR addresses that by creating a new enum variant for every valid cast. r? ````@oli-obk````
2022-10-08Auto merge of #100720 - camsteffen:representable, r=cjgillotbors-5/+200
Rewrite representability * Improve placement of `Box` in the suggestion * Multiple items in a cycle emit 1 error instead of an error for each item in the cycle * Introduce `representability` query to avoid traversing an item every time it is used. * Also introduce `params_in_repr` query to avoid traversing generic items every time it is used.
2022-10-08Stabilize half_open_range_patternsUrgau-1/+1
2022-10-07Check hidden types in dead codeOli Scherer-1/+1
2022-10-07Remap hidden types from typeck before storing them in the TypeckResultOli Scherer-16/+31
2022-10-07Move ReverseMapper logic onto OpaqueHiddenTypeOli Scherer-0/+240