fix universe map in ifcx.instantiate_canonical_*
Previously, `infcx.instantiate_canonical_*` maps the root universe in `canonical` into `ty::UniverseIndex::Root`, I think because it assumes it works with a fresh `infcx` but this is not true for the use cases in mir typeck. Now the root universe is mapped into `infcx.universe()`.
I catched this accidentally while reviewing the code. I'm not sure if this is the right fix or if it is really a bug!
Some initial normalization method changes
1. Rename `AtExt::normalize` to `QueryNormalizeExt::query_normalize` (using the `QueryNormalizer`)
2. Introduce `NormalizeExt::normalize` to replace `partially_normalize_associated_types_in` (using the `AssocTypeNormalizer`)
3. Rename `FnCtxt::normalize_associated_types_in` to `FnCtxt::normalize`
4. Remove some unused other normalization fns in `Inherited` and `FnCtxt`
Also includes one drive-by where we're no longer creating a `FnCtxt` inside of `check_fn`, but passing it in. This means we don't need such weird `FnCtxt` construction logic.
Stacked on top of #104835 for convenience.
r? types
Rollup of 5 pull requests
Successful merges:
- #104697 (Restore control flow on error in EUV)
- #104811 (feat: implement TcpStream shutdown for wasm32-wasi)
- #105039 (Fix an ICE parsing a malformed literal in `concat_bytes!`.)
- #105071 (Add Nicholas Nethercote to `.mailmap`.)
- #105079 (Add bots to `.mailmap`)
Failed merges:
- #105074 (Add Nicholas Bishop to `.mailmap`)
r? `@ghost`
`@rustbot` modify labels: rollup
Restore control flow on error in EUV
cc `@Nilstrieb`
Fix#104649
Since #98574 refactored a piece of scrutinee memory categorization out as a subroutine, there is a subtle change in handling match arms especially when the categorization process faults and bails. In the correct case, it is not supposed to continue to process the arms any more. This PR restores the original control flow in EUV.
I promise to add a compile-fail test to demonstrate that this indeed fixes the issue after coming back from a nap.
codegen-llvm: never combine DSOLocal and DllImport
Prevent DllImport from being attached to DSOLocal definitions in the LLVM IR. The combination makes no sense, since definitions local to the compilation unit will never be imported from external objects.
Additionally, LLVM will refuse the IR if it encounters the combination (introduced in [1]):
```
if (GV.hasDLLImportStorageClass())
Assert(!GV.isDSOLocal(),
"GlobalValue with DLLImport Storage is dso_local!", &GV);
```
Right now, codegen-llvm will only apply DllImport to constants and rely on call-stubs for functions. Hence, we simply extend the codegen of constants to skip DllImport for any local definitions.
This was discovered when switching the EFI targets to the static relocation model [2]. With this fixed, we can start another attempt at this.
[1] 509132b368
[2] https://github.com/rust-lang/rust/issues/101656
Rollup of 14 pull requests
Successful merges:
- #103876 (type alias impl trait: add tests showing that hidden type only outlives lifetimes that occur in bounds)
- #104427 (Explain why `rematch_impl` fails to be infallible)
- #104436 (Add slice to the stack allocated string comment)
- #104523 (Don't use periods in target names)
- #104627 (Print all features with --print target-features)
- #104911 (Make inferred_outlives_crate return Clause)
- #105002 (Add `PathBuf::as_mut_os_string` and `Path::as_mut_os_str`)
- #105023 (Statics used in reachable function's inline asm are reachable)
- #105045 (`rustc_ast_{passes,pretty}`: remove `ref` patterns)
- #105049 (Hermit: Minor build fixes)
- #105051 (Replace a macro with a function)
- #105062 (rustdoc: use shorthand background for rustdoc toggle CSS)
- #105066 (move `candidate_from_obligation` out of assembly)
- #105068 (Run patchelf also on rust-analyzer-proc-macro-srv.)
Failed merges:
- #105050 (Remove useless borrows and derefs)
r? `@ghost`
`@rustbot` modify labels: rollup
Print all features with --print target-features
This fixes `rustc --print target-features` with respect to aliases and tied features.
Before this change, the print command assumed that each LLVM feature corresponds exactly to one rustc feature. In the case of aliases and tied features, this assumption failed and some features (such as aarch64's "pacg") were missing. With this change, every target feature is listed.
Add slice to the stack allocated string comment
Precise that the "stack allocated string" is not a string but a string slice.
``@rustbot`` label +A-docs
type alias impl trait: add tests showing that hidden type only outlives lifetimes that occur in bounds
fixes#103642https://github.com/rust-lang/rust/pull/102417 only made sure that hidden types cannot outlive lifetimes other than the ones mentioned on bounds, but didn't allow us to actually infer anything from that.
cc `@aliemjay`
Also cache the stable hash of interned Predicates
continuation of https://github.com/rust-lang/rust/pull/94299
This is a small perf improvement and shares more code between `Ty` and `Predicate`
Add a codegen-test that verifies inter-crate linkage with the static
relocation model. We expect all symbols that are part of a rust
compilation to end up in the same DSO, thus we expect `dso_local`
annotations.
Prevent DllImport from being attached to DSOLocal definitions in the
LLVM IR. The combination makes no sense, since definitions local to the
compilation unit will never be imported from external objects.
Additionally, LLVM will refuse the IR if it encounters the
combination (introduced in [1]):
if (GV.hasDLLImportStorageClass())
Assert(!GV.isDSOLocal(),
"GlobalValue with DLLImport Storage is dso_local!", &GV);
Right now, codegen-llvm will only apply DllImport to constants and rely
on call-stubs for functions. Hence, we simply extend the codegen of
constants to skip DllImport for any local definitions.
This was discovered when switching the EFI targets to the static
relocation model [2]. With this fixed, we can start another attempt at
this.
[1] 509132b368
[2] https://github.com/rust-lang/rust/issues/101656
Rollup of 10 pull requests
Successful merges:
- #104465 (Document more settings for building rustc for Fuchsia)
- #104951 (Simplify checking for `GeneratorKind::Async`)
- #104959 (Revert #104269 (to avoid spurious hang/test failure in CI))
- #104978 (notify the rust-analyzer team on changes to the rust-analyzer subtree)
- #105010 (Fix documentation of asymptotic complexity for rustc_data_structures::SortedMap)
- #105016 (Add sentence when rustdoc search is running)
- #105020 (rustdoc: merge background-image rules in rustdoc-toggle CSS)
- #105024 (rustdoc: remove `fnname` CSS class that's styled exactly like `fn`)
- #105027 (Rustdoc-Json: Add tests for linking to foreign variants.)
- #105038 (Clean up pr 104954)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
Clean up pr 104954
UI test filename typo fix and a simple comment rewording. Thanks.
CC `@vincenzopalazzo` (you spelled your name wrongly in the FIXME)
r? `@estebank`
Rustdoc-Json: Add tests for linking to foreign variants.
I initially taught these would be bugs, but it turn out they work perfectly, and the variant is added to paths.
Most of the work is done by jsondoclint checking all the ID's resolve (although this wont happen for links until #105015, which in turn is blocked on removing foreign traits), but we do check that neither the enum nor the variant is inlined, so it must be resolved correctly through paths.
r? ``@GuillaumeGomez``
rustdoc: remove `fnname` CSS class that's styled exactly like `fn`
It's not obvious why this was ever a separate class name, since even in c4219a4783 when it was first added, it was styled identically to regular `fn` links.