| Age | Commit message (Collapse) | Author | Lines |
|
self-profiling: Add events for metadata loading (plus a small dep-tracking optimization)
This PR
- adds self-profiling events related to loading things from crate metadata
- makes the compiler cache the `DepNodeIndex` of upstream crates, so that they don't have to be looked up over and over.
The commits are best reviewed in isolation.
Self-profiling tracking issue: https://github.com/rust-lang/rust/issues/58967
r? @Mark-Simulacrum
cc @wesleywiser
|
|
|
|
|
|
|
|
|
|
Don't discard value names when using address or memory sanitizer
The value names are used when reporting issues found by address
sanitizer or memory sanitizer. Avoid discarding names when those
sanitizers are enabled, unless explicitly requested to do otherwise.
|
|
Split non-CAS atomic support off into target_has_atomic_load_store
This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s:
* `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations).
* ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS).
cc #32976
r? @alexcrichton
|
|
|
|
Report `CONST_ERR` lint in external macros
fixes #65300
fixes #61058
r? @oli-obk
|
|
The value names are used when reporting issues found by address
sanitizer or memory sanitizer. Avoid discarding names when those
sanitizers are enabled, unless explicitly requested to do otherwise.
|
|
Add `Instance::resolve_for_fn_ptr` (RFC 2091 #2/N)
Supercedes: https://github.com/rust-lang/rust/pull/65082
Depends on: https://github.com/rust-lang/rust/pull/65037
Tracking issue: https://github.com/rust-lang/rust/issues/47809
[RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)
steps taken:
* [x] add a `ReifyShim` that is similar to `VirtualShim` in behavior (see #54183)
* [x] add `ty::Instance::resolve_for_fn_ptr` (leave `ty::Instance::resolve_vtable` alone), migrate appropriate callers
* [x] `resolve_for_fn_ptr` returns the shim if calling a `#[track_caller]` function
|
|
Instead just use `pprust::path_to_string(..)` where needed.
This has two benefits:
a) The AST definition is now independent of printing it.
(Therefore we get closer to extracting a data-crate.)
b) Debugging should be easier as program flow is clearer.
|
|
|
|
This allows caching some recursive types and getting to an error much
more quickly.
|
|
stability: Do not use `buffer_lint` after lowering to HIR
Fixes https://github.com/rust-lang/rust/issues/65253
|
|
Query generator kind for error reporting
Fixes https://github.com/rust-lang/rust/pull/65166#discussion_r333114545
r? @estebank
cc @cramertj
|
|
Deduplicate is_{freeze,copy,sized}_raw
Fixes #65259
Deduplicates `is_{freeze,copy,sized}_raw` by delegating to a new method which takes in a `LangItem`.
|
|
Add ?Sized bound to a supertrait listing in E0038 error documentation
This example failed to compile because of implicit `Sized` bound for `A` parameter that wasn't required by `Trait`.
|
|
Function pointers as const generic arguments
Makes function pointers as const generic arguments usable.
Fixes #62395
r? @varkor
|
|
|
|
|
|
Stabilize mem::take (mem_take)
Tracking issue: https://github.com/rust-lang/rust/issues/61129
r? @matklad
|
|
Union fields may now never have a type with attached destructor.
This for example allows unions to use arbitrary field types only by
wrapping
them in ManuallyDrop.
The stable rule remains, that union fields must be Copy. We use the new
rule for the `untagged_union` feature.
See RFC 2514.
Note for ui tests:
We can't test move out through Box's deref-move since we can't
have a Box in a union anymore.
|
|
|
|
|
|
|
|
|
|
Add llvm.sideeffect to potential infinite loops and recursions
LLVM assumes that a thread will eventually cause side effect. This is
not true in Rust if a loop or recursion does nothing in its body,
causing undefined behavior even in common cases like `loop {}`.
Inserting llvm.sideeffect fixes the undefined behavior.
As a micro-optimization, only insert llvm.sideeffect when jumping back
in blocks or calling a function.
A patch for LLVM is expected to allow empty non-terminate code by
default and fix this issue from LLVM side.
https://github.com/rust-lang/rust/issues/28728
**UPDATE:** [Mentoring instructions here](https://github.com/rust-lang/rust/pull/59546#issuecomment-515072429) to unstall this PR
|
|
Per review feedback.
|
|
|
|
|
|
|
|
|
|
The function only has one call site, so we don't need a tag argument.
|
|
This wins 6% on `unicode_normalization`, by avoiding a call to
`lub_concrete_regions()` and a `Region` equality test.
|
|
Some places use the local `tcx` variable, some use `self.tcx()`. This
commit removes the local variable so that all places use `self.tcx()`,
for consistency.
|
|
Note when a mutable trait object is needed
Fix https://github.com/rust-lang/rust/issues/63619, fix https://github.com/rust-lang/rust/issues/37914. CC https://github.com/rust-lang/rust/issues/64068.
|
|
Also add a missing terminal newline to a test.
|
|
This ICEs in MIR currently, which I think is to be expected since none of the MIR plumbing is set up. I added a test which confirms that the shim is being used for reifying a track_caller function.
|
|
|
|
|
|
|
|
Snapshot clean-ups
Two minor clean-ups involving snapshots.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|