Commit Graph

19475 Commits

Author SHA1 Message Date
Matthias Krüger
4733312e09
Rollup merge of #104121 - Lokathor:mir-opt-when-instruction-set-missing-on-callee, r=tmiasko
Refine `instruction_set` MIR inline rules

Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller.

cc ``@oli-obk``

[Edit] Zulip Context: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/What.20exactly.20does.20the.20MIR.20optimizer.20do.3F
2022-11-26 10:39:10 +01:00
Ralf Jung
77071f7e3a interpret: remove PartialOrd from a bunch of types that do not have or need a sensible order 2022-11-26 10:10:34 +01:00
bors
8841bee954 Auto merge of #103556 - clubby789:specialize-option-partial-eq, r=scottmcm
Manually implement PartialEq for Option<T> and specialize non-nullable types

This PR manually implements `PartialEq` and `StructuralPartialEq` for `Option`, which seems to produce slightly better codegen than the automatically derived implementation.

It also allows specializing on the `core::num::NonZero*` and `core::ptr::NonNull` types, taking advantage of the niche optimization by transmuting the `Option<T>` to `T` to be compared directly, which can be done in just two instructions.

A comparison of the original, new and specialized code generation is available [here](https://godbolt.org/z/dE4jxdYsa).
2022-11-26 08:56:20 +00:00
bors
f8a2e491eb Auto merge of #104730 - petrochenkov:modchild5, r=cjgillot
rustc_metadata: Switch module children decoding to an iterator

Previously https://github.com/rust-lang/rust/pull/103578, https://github.com/rust-lang/rust/pull/103524 and previous PRs simplified it as much as possible.

A couple of cleanup commits is also added.
r? `@cjgillot`
2022-11-26 05:41:34 +00:00
Michael Goulet
6210812494 Do not record unresolved const vars in generator interior 2022-11-26 05:38:43 +00:00
Michael Goulet
1472b38039 Remove unnecessary binder from get_impl_future_output_ty 2022-11-26 05:22:52 +00:00
Michael Goulet
61e185b5d0 simplify some binder shifting logic 2022-11-26 05:11:06 +00:00
Michael Goulet
6436c348db Remove SelectionContext::infcx() in favor of field access 2022-11-25 23:31:37 +00:00
bors
aff003becd Auto merge of #99798 - JulianKnodt:ac1, r=BoxyUwU
Add `ConstKind::Expr`

Starting to implement `ty::ConstKind::Abstract`, most of the match cases are stubbed out, some I was unsure what to add, others I didn't want to add until a more complete implementation was ready.

r? `@lcnr`
2022-11-25 22:56:59 +00:00
Lokathor
ea47943212 Refine instruction_set inline rules
Previously an exact match of the `instruction_set` attribute was required for an MIR inline to be considered. This change checks for an exact match *only* if the callee sets an `instruction_set` in the first place. When the callee does not declare an instruction set then it is considered to be platform agnostic code and it's allowed to be inline'd into the caller.
2022-11-25 15:19:16 -07:00
Michael Goulet
6b63d6c918 Rename normalize_opaque_types to reveal_opaque_types_in_bounds 2022-11-25 19:39:46 +00:00
bors
8681d4cffc Auto merge of #104902 - matthiaskrgr:rollup-oo27a4u, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #104716 (move 2 candidates into builtin candidate)
 - #104760 (Clarify `SyntaxExtensionKind::LegacyDerive`.)
 - #104797 (rustc_codegen_ssa: write `.dwp` in a streaming fashion)
 - #104835 (Use infcx.partially_normalize_associated_types_in)
 - #104853 (Fix typo in miri sysroot)
 - #104879 (jsondoclint: Recognise Typedef as valid kind for Type::ResolvedPath)
 - #104887 (rustbuild: Don't build doc::SharedAssets when building JSON docs.)
 - #104896 (rustdoc: fix broken tooltip CSS)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-25 19:09:30 +00:00
Santiago Pastorino
3c9b30e658
Define all clauses as dummy_with_span as the usages are all equivalent 2022-11-25 16:00:08 -03:00
Santiago Pastorino
aaa1db63ce
Remove AscribeUserTypeCx 2022-11-25 15:25:00 -03:00
Matthias Krüger
7fac5048c4
Rollup merge of #104835 - spastorino:use-partially_normalize_associated_types_in, r=lcnr
Use infcx.partially_normalize_associated_types_in

r? ``@lcnr``
2022-11-25 18:35:41 +01:00
Matthias Krüger
aec60c6b7c
Rollup merge of #104797 - weihanglo:stream-write-dwp, r=jackh726
rustc_codegen_ssa: write `.dwp` in a streaming fashion

When writing a `.dwp` file, rustc writes to a Vec first then to a BufWriter-wrapped file. It seems very likely that we can write in a streaming fashion to avoid double buffering in an intermediate Vec.

On my Linux machine, `.dwp` from the latest rust-lang/cargo is 113MiB. It may worth a stream writer, though I didn't do any benchmark 🙇🏾‍♂️.
2022-11-25 18:35:40 +01:00
Matthias Krüger
8f3f4980b4
Rollup merge of #104760 - nnethercote:rm-LegacyDerive, r=petrochenkov
Clarify `SyntaxExtensionKind::LegacyDerive`.

It's always treated the same as `SyntaxExtensionKind::Derive`.
2022-11-25 18:35:39 +01:00
Matthias Krüger
9c7dc3e30b
Rollup merge of #104716 - lcnr:selection-candidate, r=jackh726
move 2 candidates into builtin candidate

having separate candidates for these isn't too helpful i think

r? types
2022-11-25 18:35:39 +01:00
bors
051cab2b84 Auto merge of #104846 - spastorino:santa-clauses-make-goals-early-christmas-🎄, r=oli-obk
Branch Clause from Predicate

r? `@oli-obk`

This is part of what's proposed in https://github.com/rust-lang/compiler-team/issues/531
2022-11-25 15:59:31 +00:00
lcnr
4f07008419 remove confusing comment
`?0: CoerceUnsized<SomeTy>` can definitely apply because
`?0` matches any type, same for `SomeTy: CoerceUnsized<?0>`
2022-11-25 16:39:23 +01:00
lcnr
a215b7b4df remove TypeError::ObjectUnsafeCoercion 2022-11-25 16:39:23 +01:00
Deadbeef
815d370346 Add documentation for has_escaping_bound_vars 2022-11-25 15:02:53 +00:00
lcnr
40a053361a small method code cleanup 2022-11-25 15:52:58 +01:00
Krasimir Georgiev
e5ccd27e67 [llvm-wrapper] adapt for LLVM API change
Adapt for the LLVM API changes from
721f975d35 (diff-5a347903b8412ed1b1b1948c3fce47f9a6ff05dc70bfaeedb6d06b622e399d91).
2022-11-25 11:29:00 +00:00
lcnr
84e97907c6 add comment 2022-11-25 11:59:08 +01:00
lcnr
31431ccda9 move 2 candidates into builtin candidate 2022-11-25 11:59:08 +01:00
Matthias Krüger
34f1de8395
Rollup merge of #104841 - compiler-errors:fishy-bound-var, r=jackh726
Assert that we don't capture escaping bound vars in `Fn` trait selection

Fixes #104825
2022-11-25 10:44:39 +01:00
kadmin
d0209db157 Fix mk_const_list 2022-11-25 09:35:37 +00:00
Boxy
677bdcb8a9 only emit "enable gce" error if it would fix compile error 2022-11-25 09:28:44 +00:00
Boxy
2ac5d91d63 Make expand_abstract_consts infallible 2022-11-25 09:28:44 +00:00
Boxy
4085e94ece super_relate_consts do not spurriously fail on assoc consts 2022-11-25 09:28:44 +00:00
Boxy
430f7d16e6 add FIXME's 2022-11-25 09:28:44 +00:00
Boxy
95e1a39c04 correctly intern List<Const<'tcx>> 2022-11-25 09:28:44 +00:00
Boxy
5a496aab03 dont skip const evalautable of non unevaluateds 2022-11-25 09:28:44 +00:00
Boxy
e58b932daf add FIXME for things that I couldn't find ways to trigger 2022-11-25 09:28:44 +00:00
Boxy
4833ce8673 fmt 2022-11-25 09:28:43 +00:00
Boxy
f59b91e8a0 reduce duplicated argument logic 2022-11-25 09:28:43 +00:00
Boxy
fd271ffe28 also handle it in evaluate 2022-11-25 09:28:43 +00:00
Boxy
0ae3c5c609 handle assoc consts in fulfill ConstEquate 2022-11-25 09:28:43 +00:00
Boxy
d75cd5c051 fmt 2022-11-25 09:28:43 +00:00
Boxy
8c729bd0f3 handle nested obligations in satisfied_from_param_env 2022-11-25 09:28:43 +00:00
kadmin
5bb1a9febc Add expand_abstract_const
Adds the ability to directly expand a const to an expr without having to deal with intermediate
steps.
2022-11-25 09:28:43 +00:00
kadmin
f9750c1554 Add empty ConstKind::Abstract
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-25 09:28:43 +00:00
Oli Scherer
208bb933e7 Use "must be init" instead of "must not be uninit" everywhere 2022-11-25 08:40:27 +00:00
Oli Scherer
5446a52b4b Add a because to errors derived from fields 2022-11-25 08:40:03 +00:00
Oli Scherer
d7f5d784d7 Simplify and document range layout computation 2022-11-25 08:39:11 +00:00
Oli Scherer
fcb1f1874f Don't show fields from other crates 2022-11-25 08:12:16 +00:00
Oli Scherer
2e79f5f9f8 Move a comment to the right place 2022-11-25 08:11:53 +00:00
Oli Scherer
98c550ecc8 Reinstate the previous compact form of "in this field" errors 2022-11-25 08:11:29 +00:00
Oli Scherer
ccaa28bf69 Don't try to compute the layout of generic types. 2022-11-25 08:10:52 +00:00
Oli Scherer
2bed079103 Compute layout instead of manually procesisng the layout restriction attributes 2022-11-25 08:10:29 +00:00
Oli Scherer
5cbf172909 Print a trace through types to show how to get to the problematic type 2022-11-25 08:09:52 +00:00
Oli Scherer
9909cb902f Make the ICEs in the mir typechecker have more spans helpful 2022-11-25 08:01:12 +00:00
Oli Scherer
6773e7ee56 More manual formatting 2022-11-25 08:00:49 +00:00
Oli Scherer
c3eb8f2778 rustc_layout_scalar_valid_range can be applied to scalar pairs and affects teh first scalar 2022-11-25 08:00:26 +00:00
Oli Scherer
2b8963a94c Some manual formatting of let..else statements 2022-11-25 08:00:02 +00:00
Oli Scherer
2a94a2d385 Prefer not accessing the private field of newtype_index types 2022-11-25 07:51:56 +00:00
Oli Scherer
b5554722ff Add helper method to ScalarInt 2022-11-25 07:47:56 +00:00
bors
41e0363055 Auto merge of #104602 - petrochenkov:effvisperf5, r=oli-obk
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 4eb63f618e and c7c7d16727 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-25 06:14:42 +00:00
Santiago Pastorino
974e2837bb
Introduce PredicateKind::Clause 2022-11-25 00:04:54 -03:00
Oli Scherer
42cc8e8f4e
Simplify a bunch of trait ref obligation creations 2022-11-25 00:04:54 -03:00
Oli Scherer
08afabddac
get rid of to_poly_trait_predicate 2022-11-25 00:04:52 -03:00
bors
65a6e22668 Auto merge of #104845 - matthiaskrgr:rollup-tckj956, r=matthiaskrgr
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-24 23:45:32 +00:00
Nicholas Nethercote
2c5d3705ec Clarify SyntaxExtensionKind::LegacyDerive. 2022-11-25 09:13:27 +11:00
Michael Goulet
d945967779 Remove comment, simplify since we asserted fn ptr Self type has no bound vars 2022-11-24 21:50:04 +00:00
Michael Goulet
c7330c9fe8 Also check that fn pointer candidates don't have escaping bound vars 2022-11-24 21:50:04 +00:00
Michael Goulet
8927135274 Assert that we don't capture escaping bound vars in Fn trait selection 2022-11-24 21:50:04 +00:00
Matthias Krüger
1048a85dbe
Rollup merge of #104822 - spastorino:selctx-new-instead-of-with_query_mode, r=lcnr
with_query_mode -> new

r? ```@lcnr```
2022-11-24 21:34:57 +01:00
Matthias Krüger
73f01ffd46
Rollup merge of #104820 - spastorino:remove-normalize_projection_type, r=jackh726
Remove normalize_projection_type

r? ``@lcnr``
2022-11-24 21:34:56 +01:00
Matthias Krüger
83d1aab9ff
Rollup merge of #104796 - notriddle:notriddle/unused-issue-104397, r=oli-obk
lint: do not warn unused parens around higher-ranked function pointers

Fixes #104397
2022-11-24 21:34:56 +01:00
Matthias Krüger
679f1b7892
Rollup merge of #104782 - oli-obk:const_eval_limit_bump, r=pnkfelix
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-24 21:34:55 +01:00
Matthias Krüger
4843946a10
Rollup merge of #104780 - BoxyUwU:error_reported_not_be_bad, r=oli-obk
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-24 21:34:54 +01:00
Matthias Krüger
9a558b68e1
Rollup merge of #104773 - oli-obk:overlap, r=lcnr
OpaqueCast projections are always overlapping, they can't possibly be disjoint

r? ``@lcnr``
2022-11-24 21:34:53 +01:00
Matthias Krüger
0e4eb0da33
Rollup merge of #104747 - petrochenkov:ctorfields, r=cjgillot
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-24 21:34:53 +01:00
Matthias Krüger
7a17d61d3d
Rollup merge of #104704 - ecnelises:p10vec, r=jackh726
Allow power10-vector feature in PowerPC

Note that we don't have `power10-altivec`:

57fd7ffeff/llvm/lib/Target/PowerPC/PPC.td (L277-L280)
2022-11-24 21:34:52 +01:00
Matthias Krüger
80dc91c6c3
Rollup merge of #104514 - chenyukang:yukang/fix-104513-ice, r=petrochenkov
Use node_ty_opt to avoid ICE in visit_ty

Fixes #104513
2022-11-24 21:34:51 +01:00
bors
b3bc6bf312 Auto merge of #103693 - HKalbasi:master, r=oli-obk
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-24 20:29:13 +00:00
Maybe Waffle
e143fa2156 nested-match mutability (proposed by the reviewer) 2022-11-24 18:18:45 +00:00
Camille GILLOT
5de9c84140 Fix rustc_pass_by_value. 2022-11-24 17:49:42 +00:00
Camille GILLOT
1c737d6997 Use kw::Empty for elided lifetimes in path. 2022-11-24 17:48:59 +00:00
Camille GILLOT
41090346d8 Change how suggested lifetime args are computed. 2022-11-24 17:48:42 +00:00
Camille GILLOT
5f5e7a8eec Record in HIR whether lifetime elision was succesful. 2022-11-24 17:48:27 +00:00
Santiago Pastorino
3dee3aac78
Use infcx.partially_normalize_associated_types_in 2022-11-24 14:16:40 -03:00
bors
5dfb4b0afa Auto merge of #104321 - Swatinem:async-gen, r=oli-obk
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:🅱️:async_fn$0
             at .\src\lib.rs:10
   5: core::future::from_generator::impl$1::poll<enum2$<async_codegen:🅱️:async_fn_env$0> >
             at /rustc/897e37553bba8b42751c67658967889d11ecd120\library\core\src\future\mod.rs:91
   6: async_codegen:🅰️:async_fn$0
             at .\src\lib.rs:4
   7: core::future::from_generator::impl$1::poll<enum2$<async_codegen:🅰️: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:🅱️:async_fn$0
             at .\src\lib.rs:10
   4: async_codegen:🅰️:async_fn$0
             at .\src\lib.rs:4
```
2022-11-24 17:14:42 +00:00
Sarthak Singh
1767f9f9bf Unsupported query error now specifies if its unsupported for local or external crate 2022-11-24 19:05:17 +05:30
hkalbasi
390a637e29 move things from rustc_target::abi to rustc_abi 2022-11-24 16:26:13 +03:30
hkalbasi
27fb904d68 move some layout logic to rustc_target::abi::layout 2022-11-24 16:26:12 +03:30
hkalbasi
09a384643e make rustc_target usable outside of rustc 2022-11-24 16:26:12 +03:30
Santiago Pastorino
66b4b8b907
with_query_mode -> new 2022-11-24 09:36:17 -03:00
Santiago Pastorino
1930c77de1
Remove normalize_projection_type 2022-11-24 09:02:55 -03:00
Boxy
72d8879c29 make error_reported check for delayed bugs 2022-11-24 11:12:46 +00:00
bors
1dda298ad3 Auto merge of #104809 - matthiaskrgr:rollup-8abjdwh, r=matthiaskrgr
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 (⬆️ rust-analyzer)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-11-24 09:44:46 +00:00
Arpad Borsos
9f36f988ad
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.
2022-11-24 10:04:27 +01:00
Matthias Krüger
2190b163a3
Rollup merge of #104775 - spastorino:use-obligation-ctxt-normalize, r=lcnr
Use ObligationCtxt::normalize

r? ```@lcnr```
2022-11-24 08:42:37 +01:00
Matthias Krüger
6938717ca5
Rollup merge of #104753 - compiler-errors:drop-tracking-var-ice, r=oli-obk
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-24 08:42:35 +01:00
Matthias Krüger
c08c57e856
Rollup merge of #104742 - WaffleLapkin:forbidden-SUPER-deref, r=compiler-errors
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-24 08:42:34 +01:00
Matthias Krüger
b43c2e7cd9
Rollup merge of #104594 - compiler-errors:dyn-star-rcvr, r=eholk,estebank
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-24 08:42:34 +01:00
Matthias Krüger
1e0df8827b
Rollup merge of #104517 - dfordivam:patch-1, r=cuviper
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.

251831ece9/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp (L801-L804)
2022-11-24 08:42:33 +01:00
Matthias Krüger
5197ef66b7
Rollup merge of #103908 - estebank:consider-cloning, r=compiler-errors
Suggest `.clone()` or `ref binding` on E0382
2022-11-24 08:42:33 +01:00
bors
341d8b8a2c Auto merge of #103808 - cjgillot:vec-cache, r=TaKO8Ki
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-24 06:32:23 +00:00