Dylan DPC
ab59516dfd
Rollup merge of #94493 - oribenshir:feature/ISSUE-78543_async_fn_in_foreign_crate_diag_2, r=davidtwco
...
Improved diagnostic on failure to meet send bound on future in a foreign crate
Provide a better diagnostic on failure to meet send bound on futures in a foreign crate.
fixes #78543
2022-04-19 14:43:15 +02:00
bors
c102c5cfc6
Auto merge of #96020 - martingms:optimize-relate_substs, r=nnethercote
...
Micro-optimize `ty::relate::relate_substs` by avoiding `match`
Was a top-20 hot function in a callgrind profile of compiling `bitmaps-3.1.0`.
Yields some small speedups on that crate and some others according to local benching:
Benchmark | Profile | Scenario | % Change | Significance Factor?
-- | -- | -- | -- | --
bitmaps-3.1.0 | check | full | -1.88% | 9.42x
bitmaps-3.1.0 | debug | full | -1.80% | 8.99x
bitmaps-3.1.0 | opt | full | -1.70% | 8.49x
bitmaps-3.1.0 | check | incr-full | -1.54% | 7.68x
deep-vector | debug | full | 1.52% | 7.61x
bitmaps-3.1.0 | debug | incr-full | -1.45% | 7.26x
bitmaps-3.1.0 | opt | incr-full | -1.39% | 6.95x
nalgebra-0.30.1 | check | full | -0.68% | 3.42x
nalgebra-0.30.1 | debug | full | -0.64% | 3.22x
nalgebra-0.30.1 | opt | full | -0.64% | 3.20x
projection-caching | check | full | -0.61% | 3.05x
nalgebra-0.30.1 | check | incr-full | -0.56% | 2.78x
nalgebra-0.30.1 | opt | incr-full | -0.54% | 2.72x
nalgebra-0.30.1 | debug | incr-full | -0.54% | 2.69x
projection-caching | check | incr-full | -0.50% | 2.51x
tt-muncher | opt | full | -0.48% | 2.42x
projection-caching | opt | full | -0.47% | 2.37x
projection-caching | debug | full | -0.47% | 2.35x
projection-caching | opt | incr-full | -0.44% | 2.21x
projection-caching | debug | incr-full | -0.42% | 2.08x
deeply-nested-multi | check | incr-full | 0.37% | 1.87x
wf-projection-stress-65510 | opt | full | -0.37% | 1.84x
deep-vector | debug | incr-patched: add vec item | -0.32% | 1.61x
projection-caching | debug | incr-unchanged | -0.32% | 1.60x
wf-projection-stress-65510 | check | full | -0.31% | 1.55x
projection-caching | opt | incr-unchanged | -0.31% | 1.53x
wf-projection-stress-65510 | debug | incr-full | -0.30% | 1.51x
wf-projection-stress-65510 | opt | incr-full | -0.30% | 1.51x
r? `@nnethercote`
2022-04-19 10:53:53 +00:00
Michael Woerister
c0be619724
incr. comp.: Don't export impl_stable_hash_via_hash!() and warn about using it.
2022-04-19 10:43:20 +02:00
Nicholas Nethercote
d235ac7801
Handle Delimited opening immediately.
...
Instead of letting the next iteration of the loop handle it.
2022-04-19 17:02:49 +10:00
Nicholas Nethercote
29c78cc086
Add {open,close}_delim arguments to TokenCursorFrame::new().
...
This will facilitate the change in the next commit.
`boolean` arguments aren't great, but the function is only used in three
places within this one file.
2022-04-19 17:02:48 +10:00
Nicholas Nethercote
02317542eb
Rearrange TokenCursor::inlined_next().
...
In particular, avoid wrapping a token within `TokenTree::Token` and then
immediately matching it and returning the token within. Just return the
token immediately.
2022-04-19 17:02:48 +10:00
Nicholas Nethercote
b1e6dee596
Merge TokenCursor::{next,next_desugared}.
...
And likewise for the inlined variants.
I did this for simplicity, but interesting it was a performance win as
well.
2022-04-19 17:02:48 +10:00
Nicholas Nethercote
89ec75b0e9
Inline and remove Parser::next_tok().
...
It has a single call site.
2022-04-19 17:02:48 +10:00
Nicholas Nethercote
aefbbeec34
Inline and remove TokenTree::{open_tt,close_tt}.
...
They both have a single call site.
2022-04-19 17:02:48 +10:00
Nicholas Nethercote
ad566b78f2
Tweak Cursor::next_with_spacing.
...
This makes it more like `CursorRef::next_with_spacing`. There is no
performance effect, just a consistency improvement.
2022-04-19 17:02:48 +10:00
bors
e2661bac6d
Auto merge of #95379 - icewind1991:suggest-associated-type-more, r=jackh726
...
show suggestion to replace generic bounds with associated types in more cases
Moves the hint to replace generic parameters with associated type bounds from the "not all associated type bounds are specified"(`E0191`) to "to many generic type parameters provided"(`E0107`).
Since `E0191` is only emitted in places where all associated types must be specified (when creating `dyn` types), the suggesting is currently not shown for other generic type uses (such as in generic type bounds). With this change the suggesting is always emitted when the number of excess generic parameters matches the number of unbound associated types.
Main motivation for the change was a lack of useful suggesting when doing
```rust
fn foo<I: Iterator<usize>>(i: I) {}
```
2022-04-19 01:59:35 +00:00
Erik Desjardins
1bbae507d4
mark payload fields of ScalarPair enums as Scalar::Union when they're not always initialized
2022-04-18 21:43:20 -04:00
est31
3c1e1661e7
Remove unused macro rules
2022-04-18 23:28:06 +02:00
Gary Guo
e2fdb84df7
Conditionally export msan symbols only if they are defined
...
* `__msan_keep_going` is defined when `-Zsanitizer-recover=memory`.
* `__msan_track_origins` is defined when `-Zsanitizer-memory-track-origins`.
2022-04-18 20:50:56 +01:00
Gary Guo
c475117ffb
Refactor exported_symbols and linked_symbols for code reuse
2022-04-18 20:50:56 +01:00
Gary Guo
773f533eae
Synthesis object file for #[used] and exported symbols
2022-04-18 20:50:56 +01:00
Gary Guo
a1dae4bc9d
Make #[used] considered reachable
2022-04-18 20:50:56 +01:00
Gary Guo
49cc6d1f84
Add SymbolExportInfo
...
This is currently a wrapper to `SymbolExportLevel` but it allows
later addition of extra information.
2022-04-18 20:50:56 +01:00
ouz-a
5364c86e8e
replace iter with into_iter()
2022-04-18 22:05:16 +03:00
Ralf Jung
55f0977a6b
remove an unnecessary use of loc_place.ptr.into_pointer_or_addr
2022-04-18 12:47:38 -04:00
Ralf Jung
c83241a7f9
avoid an unnecessary call to Pointer::into_parts, and caution against into_pointer_or_addr
2022-04-18 12:30:17 -04:00
Ralf Jung
3236092503
add method to get absolute address of a pointer (useful only for Miri)
2022-04-18 12:30:17 -04:00
Ralf Jung
c9e568f72e
avoid pairing up AllocId and PointerTag, which is redundant
2022-04-18 10:14:06 -04:00
Takayuki Maeda
5924ef874e
stop using Autoderef
2022-04-18 12:51:12 +09:00
David Wood
b786345347
ssa: don't pack debuginfo on windows not only msvc
...
Small fix that prevents `thorin` from running on platforms where it
definitely shouldn't be running.
Signed-off-by: David Wood <david.wood@huawei.com >
2022-04-18 03:47:51 +01:00
Ralf Jung
54ab357a5b
ptr_get_alloc_id: don't return an actual Pointer
2022-04-17 22:27:14 -04:00
Ralf Jung
05489e7ec8
check Allocation invariant during printing
2022-04-17 21:08:58 -04:00
Ralf Jung
f3bdcfb8b0
downgrade really verbose logging to trace
2022-04-17 20:52:33 -04:00
Ralf Jung
989e7479d9
interpret: more debug logging for read_scalar and write_scalar
2022-04-17 20:52:30 -04:00
Ralf Jung
29cc8ec2d1
explain why prepare_relocation_copy works the way it does
2022-04-17 20:38:00 -04:00
Ralf Jung
3ec1febbf5
add caution to some comments
2022-04-17 19:32:13 -04:00
Ralf Jung
85ee04c44a
when writing uninit to an allocation, also clear relocations like other writes do
2022-04-17 19:16:54 -04:00
Ralf Jung
5640304c63
add log warnings for when we overwrite parts of a pointer, and de-init the rest
2022-04-17 19:03:08 -04:00
ouz-a
70e67d6f55
fat vec
2022-04-17 22:16:12 +03:00
ouz-a
831ebfc961
format err
2022-04-17 17:11:54 +03:00
ouz-a
2d2c5e118a
little changes
2022-04-17 16:52:18 +03:00
bors
1ec2c136b3
Auto merge of #95779 - cjgillot:ast-lifetimes-undeclared, r=petrochenkov
...
Report undeclared lifetimes during late resolution.
First step in https://github.com/rust-lang/rust/pull/91557
We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes.
r? `@petrochenkov`
2022-04-17 12:56:19 +00:00
bors
af68f7182e
Auto merge of #96016 - Aaron1011:hash-name-cleanup, r=cjgillot
...
Remove last vestiges of skippng ident span hashing
This removes a comment that no longer applies, and properly hashes
the full ident for path segments.
2022-04-17 10:31:52 +00:00
Camille GILLOT
07ee031763
Stop using CRATE_DEF_INDEX.
...
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-04-17 12:14:42 +02:00
Martin Gammelsæter
19dedf3a4b
Split relate_substs into two functions
...
One for the case with variances, and one without.
All callers use an explicit Option for the variable anyway.
2022-04-17 11:04:58 +02:00
Camille GILLOT
a9e13fa553
Lint elided lifetimes in path on the AST.
2022-04-17 11:03:34 +02:00
Camille GILLOT
fc9f25531a
Report undeclared lifetimes on AST.
2022-04-17 11:03:34 +02:00
Camille GILLOT
4cfceeabdc
Remove is_in_fn_syntax.
2022-04-17 11:03:33 +02:00
Camille GILLOT
e47f66dc0d
Visit generics inside visit_fn.
2022-04-17 11:03:33 +02:00
Camille GILLOT
aa2b5ef635
Count number of lifetime parameters in a separate pass.
2022-04-17 11:03:33 +02:00
bors
edba282770
Auto merge of #95655 - kckeiks:create-hir-crate-items-query, r=cjgillot
...
Refactor HIR item-like traversal (part 1)
Issue #95004
- Create hir_crate_items query which traverses tcx.hir_crate(()).owners to return a hir::ModuleItems
- use tcx.hir_crate_items in tcx.hir().items() to return an iterator of hir::ItemId
- use tcx.hir_crate_items to introduce a tcx.hir().par_items(impl Fn(hir::ItemId)) to traverse all items in parallel;
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com >
cc `@cjgillot`
2022-04-17 08:06:53 +00:00
bors
ac8b11810f
Auto merge of #96010 - eduardosm:Unique-on-top-of-NonNull, r=m-ou-se,tmiasko
...
Implement `core::ptr::Unique` on top of `NonNull`
Removes the use `rustc_layout_scalar_valid_range_start` and some `unsafe` blocks.
2022-04-17 05:26:08 +00:00
bors
2c28b0eaf9
Auto merge of #96134 - Dylan-DPC:rollup-ejug3yq, r=Dylan-DPC
...
Rollup of 6 pull requests
Successful merges:
- #95346 (Stablize `const_extern_fn` for "Rust" and "C")
- #95933 (htmldocck: Compare HTML tree instead of plain text html)
- #96105 (Make the debug output for `TargetSelection` less verbose)
- #96112 (Strict provenance lint diagnostics improvements)
- #96119 (update Miri)
- #96124 (to_digit tweak)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
2022-04-17 00:44:53 +00:00
Robin Appelman
decc04dbfb
show suggestion to replace generic bounds with associated types in more cases
2022-04-17 00:44:36 +02:00
Jakob Degen
4534188d4b
Address nits
2022-04-16 18:44:27 -04:00