about summary refs log tree commit diff
path: root/compiler
AgeCommit message (Collapse)AuthorLines
2022-11-25Fix mk_const_listkadmin-1/+1
2022-11-25only emit "enable gce" error if it would fix compile errorBoxy-8/+17
2022-11-25Make `expand_abstract_consts` infallibleBoxy-105/+52
2022-11-25`super_relate_consts` do not spurriously fail on assoc constsBoxy-16/+9
2022-11-25add FIXME'sBoxy-0/+11
2022-11-25correctly intern `List<Const<'tcx>>`Boxy-1/+4
2022-11-25dont skip const evalautable of non unevaluatedsBoxy-6/+1
2022-11-25add FIXME for things that I couldn't find ways to triggerBoxy-3/+5
2022-11-25fmtBoxy-6/+7
2022-11-25reduce duplicated argument logicBoxy-64/+40
2022-11-25also handle it in evaluateBoxy-24/+51
2022-11-25handle assoc consts in fulfill `ConstEquate`Boxy-23/+27
2022-11-25fmtBoxy-16/+18
2022-11-25handle nested obligations in `satisfied_from_param_env`Boxy-37/+47
2022-11-25Add expand_abstract_constkadmin-151/+121
Adds the ability to directly expand a const to an expr without having to deal with intermediate steps.
2022-11-25Add empty ConstKind::Abstractkadmin-743/+674
Initial pass at expr/abstract const/s Address comments Switch to using a list instead of &[ty::Const], rm `AbstractConst` Remove try_unify_abstract_consts Update comments Add edits Recurse more More edits Prevent equating associated consts Move failing test to ui Changes this test from incremental to ui, and mark it as failing and a known bug. Does not cause the compiler to ICE, so should be ok.
2022-11-25Auto merge of #104602 - petrochenkov:effvisperf5, r=oli-obkbors-95/+128
privacy: Fix more (potential) issues with effective visibilities Continuation of https://github.com/rust-lang/rust/pull/103965. See individual commits for more detailed description of the changes. The shortcuts removed in https://github.com/rust-lang/rust/pull/104602/commits/4eb63f618e601efee657d24cd4e8833fb03fac4c and https://github.com/rust-lang/rust/pull/104602/commits/c7c7d1672739e38c8d39ae861b284486aefd5b48 could actually be correct (or correct after some tweaks), but they used global reasoning like "we can skip this update because if the code compiles then some other update should do the same thing eventually". I have some expertise in this area, but I still have doubt whether such global reasoning was correct or not, especially in presence of all possible exotic cases with imports. After this PR all table changes should be "locally correct" after every update, even if it may be overcautious. If similar optimizations are introduced again they will need detailed comments explaining why it's legal to do what they do and providing proofs. Fixes https://github.com/rust-lang/rust/issues/104249. Fixes https://github.com/rust-lang/rust/issues/104539.
2022-11-24Auto merge of #104845 - matthiaskrgr:rollup-tckj956, r=matthiaskrgrbors-120/+72
Rollup of 11 pull requests Successful merges: - #104514 (Use node_ty_opt to avoid ICE in visit_ty) - #104704 (Allow power10-vector feature in PowerPC) - #104747 (resolve: Don't use constructor def ids in the map for field names) - #104773 (OpaqueCast projections are always overlapping, they can't possibly be disjoint) - #104774 (Document split{_ascii,}_whitespace() for empty strings) - #104780 (make `error_reported` check for delayed bugs) - #104782 (Bump the const eval step limit) - #104792 (rustdoc: simplify `.search-results-title` CSS) - #104796 (lint: do not warn unused parens around higher-ranked function pointers) - #104820 (Remove normalize_projection_type) - #104822 (with_query_mode -> new) Failed merges: - #104716 (move 2 candidates into builtin candidate) - #104841 (Assert that we don't capture escaping bound vars in `Fn` trait selection) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-24Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query_mode, ↵Matthias Krüger-8/+3
r=lcnr with_query_mode -> new r? ```@lcnr```
2022-11-24Rollup merge of #104820 - spastorino:remove-normalize_projection_type, ↵Matthias Krüger-68/+13
r=jackh726 Remove normalize_projection_type r? ``@lcnr``
2022-11-24Rollup merge of #104796 - notriddle:notriddle/unused-issue-104397, r=oli-obkMatthias Krüger-0/+1
lint: do not warn unused parens around higher-ranked function pointers Fixes #104397
2022-11-24Rollup merge of #104782 - oli-obk:const_eval_limit_bump, r=pnkfelixMatthias Krüger-1/+1
Bump the const eval step limit fixes https://github.com/rust-lang/rust/issues/103814 https://github.com/rust-lang/rust/pull/103877 has too much of an impact to beta backport. So let's just increase the limit, avoiding the immediate breakage. r? ``@pnkfelix``
2022-11-24Rollup merge of #104780 - BoxyUwU:error_reported_not_be_bad, r=oli-obkMatthias Krüger-10/+28
make `error_reported` check for delayed bugs Fixes #104768 `error_reported()` was only checking if there were errors emitted, not for `delay_bug`s which can also be a source of `ErrorGuaranteed`. I assume the same is true of `lint_err_count` but i dont know
2022-11-24Rollup merge of #104773 - oli-obk:overlap, r=lcnrMatthias Krüger-10/+4
OpaqueCast projections are always overlapping, they can't possibly be disjoint r? ``@lcnr``
2022-11-24Rollup merge of #104747 - petrochenkov:ctorfields, r=cjgillotMatthias Krüger-20/+15
resolve: Don't use constructor def ids in the map for field names Also do some minor cleanup to insertion of those field names. Addresses a FIXME left in https://github.com/rust-lang/rust/pull/103578.
2022-11-24Rollup merge of #104704 - ecnelises:p10vec, r=jackh726Matthias Krüger-0/+1
Allow power10-vector feature in PowerPC Note that we don't have `power10-altivec`: https://github.com/llvm/llvm-project/blob/57fd7ffefffae313de800fecdd9f095a17bfd4ea/llvm/lib/Target/PowerPC/PPC.td#L277-L280
2022-11-24Rollup merge of #104514 - chenyukang:yukang/fix-104513-ice, r=petrochenkovMatthias Krüger-3/+6
Use node_ty_opt to avoid ICE in visit_ty Fixes #104513
2022-11-24Auto merge of #103693 - HKalbasi:master, r=oli-obkbors-2526/+2701
Make rustc_target usable outside of rustc I'm working on showing type size in rust-analyzer (https://github.com/rust-lang/rust-analyzer/pull/13490) and I currently copied rustc code inside rust-analyzer, which works, but is bad. With this change, I would become able to use `rustc_target` and `rustc_index` directly in r-a, reducing the amount of copy needed. This PR contains some feature flag to put nightly features behind them to make crates buildable on the stable compiler + makes layout related types generic over index type + removes interning of nested layouts.
2022-11-24Auto merge of #104321 - Swatinem:async-gen, r=oli-obkbors-126/+358
Avoid `GenFuture` shim when compiling async constructs Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through. --- Given this demo code: ```rust pub async fn a(arg: u32) -> Backtrace { let bt = b().await; let _arg = arg; bt } pub async fn b() -> Backtrace { Backtrace::force_capture() } ``` I would get the following with the latest stable compiler (on Windows): ``` 4: async_codegen::b::async_fn$0 at .\src\lib.rs:10 5: core::future::from_generator::impl$1::poll<enum2$<async_codegen::b::async_fn_env$0> > at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\future\mod.rs:91 6: async_codegen::a::async_fn$0 at .\src\lib.rs:4 7: core::future::from_generator::impl$1::poll<enum2$<async_codegen::a::async_fn_env$0> > at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\future\mod.rs:91 ``` whereas now I get a much cleaner stack trace: ``` 3: async_codegen::b::async_fn$0 at .\src\lib.rs:10 4: async_codegen::a::async_fn$0 at .\src\lib.rs:4 ```
2022-11-24move things from rustc_target::abi to rustc_abihkalbasi-1667/+1683
2022-11-24move some layout logic to rustc_target::abi::layouthkalbasi-1153/+1226
2022-11-24make rustc_target usable outside of rustchkalbasi-73/+159
2022-11-24with_query_mode -> newSantiago Pastorino-8/+3
2022-11-24Remove normalize_projection_typeSantiago Pastorino-68/+13
2022-11-24make `error_reported` check for delayed bugsBoxy-10/+28
2022-11-24Auto merge of #104809 - matthiaskrgr:rollup-8abjdwh, r=matthiaskrgrbors-186/+427
Rollup of 9 pull requests Successful merges: - #103908 (Suggest `.clone()` or `ref binding` on E0382) - #104517 (Throw error on failure in loading llvm-plugin) - #104594 (Properly handle `Pin<&mut dyn* Trait>` receiver in codegen) - #104742 (Make `deref_into_dyn_supertrait` lint the impl and not the usage) - #104753 (Pass `InferCtxt` to `DropRangeVisitor` so we can resolve vars) - #104771 (Add regression test for issue #99938) - #104772 (Small accessibility improvements) - #104775 (Use ObligationCtxt::normalize) - #104778 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-24Avoid `GenFuture` shim when compiling async constructsArpad Borsos-126/+358
Previously, async constructs would be lowered to "normal" generators, with an additional `from_generator` / `GenFuture` shim in between to convert from `Generator` to `Future`. The compiler will now special-case these generators internally so that async constructs will *directly* implement `Future` without the need to go through the `from_generator` / `GenFuture` shim. The primary motivation for this change was hiding this implementation detail in stack traces and debuginfo, but it can in theory also help the optimizer as there is less abstractions to see through.
2022-11-24Rollup merge of #104775 - spastorino:use-obligation-ctxt-normalize, r=lcnrMatthias Krüger-17/+4
Use ObligationCtxt::normalize r? ```@lcnr```
2022-11-24Rollup merge of #104753 - compiler-errors:drop-tracking-var-ice, r=oli-obkMatthias Krüger-24/+43
Pass `InferCtxt` to `DropRangeVisitor` so we can resolve vars The types that we encounter in the `TypeckResults` that we pass to the `DropRangeVisitor` are not yet fully resolved, since that only happens in writeback after type checking is complete. Instead, pass down the whole `InferCtxt` so that we can resolve any inference vars that have been constrained since they were written into the results. This is similar to how the `MemCategorizationContext` in the `ExprUseVisitor` also needs to pass down both typeck results _and_ the inference context. Fixes an ICE mentioned in this comment: https://github.com/rust-lang/rust/issues/104382#issuecomment-1324410781
2022-11-24Rollup merge of #104742 - WaffleLapkin:forbidden-SUPER-deref, r=compiler-errorsMatthias Krüger-58/+112
Make `deref_into_dyn_supertrait` lint the impl and not the usage Proposed by ``@compiler-errors`` in https://github.com/rust-lang/rust/issues/89460#issuecomment-1320806785 r? ``@crlf0710``
2022-11-24Rollup merge of #104594 - compiler-errors:dyn-star-rcvr, r=eholk,estebankMatthias Krüger-39/+42
Properly handle `Pin<&mut dyn* Trait>` receiver in codegen This ensures we can actually await a `dyn* Future`, which seems important for async fn in dyn trait. Also, disable `dyn*` trait upcasting. It's not exactly complete right now, and can cause strange ICEs for no reason -- nobody's using it either. I thought it was cute to implement when I did it, but I didn't think about how it interacts structurally with `CoerceUnsized` correctly. Fixes #104794, presumably removing `dyn*` upcasting and its `CoerceUnsized` issues does the trick.
2022-11-24Rollup merge of #104517 - dfordivam:patch-1, r=cuviperMatthias Krüger-1/+1
Throw error on failure in loading llvm-plugin The following code silently ignores the error as the `LLVMRustSetLastError` only tracks one error at a time. At all other places where `LLVMRustSetLastError` is used the code immediately returns. https://github.com/rust-lang/rust/blob/251831ece9601d64172127b6caae9087358c2386/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp#L801-L804
2022-11-24Rollup merge of #103908 - estebank:consider-cloning, r=compiler-errorsMatthias Krüger-47/+225
Suggest `.clone()` or `ref binding` on E0382
2022-11-24Auto merge of #103808 - cjgillot:vec-cache, r=TaKO8Kibors-25/+232
Use an IndexVec to cache queries with index-like key Revival of an old idea. Let's see if it has more effect. r? `@ghost`
2022-11-24fix #104513, Use node_ty_opt to avoid ICE in visit_tyyukang-3/+6
2022-11-24Auto merge of #104610 - ouz-a:revert-overflow, r=compiler-errorsbors-16/+0
Reverts check done by #100757 As my `fix` caused more issues than it resolved it's better to revert it. ( #103274 #104322 https://github.com/rust-lang/rust/issues/104606) r? `@compiler-errors` Reopens #95134
2022-11-24Properly handle `Pin<&mut dyn* Trait>` receiver in codegenMichael Goulet-6/+24
2022-11-24Disable dyn* upcastingMichael Goulet-33/+18
2022-11-23lint: do not warn unused parens around higher-ranked function pointersMichael Howell-0/+1
Fixes #104397
2022-11-24Auto merge of #104507 - WaffleLapkin:asderefsyou, r=wesleywiserbors-63/+45
Use `as_deref` in compiler (but only where it makes sense) This simplifies some code :3 (there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")