Merge pull request #2236 from rust-lang/rustc-pull

This commit is contained in:
Yuki Okushi 2025-02-02 17:31:01 +09:00 committed by GitHub
commit 9350966973
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 12 additions and 7 deletions

View File

@ -58,7 +58,7 @@ impl rustc_driver::Callbacks for MyCallbacks {
fn after_crate_root_parsing( fn after_crate_root_parsing(
&mut self, &mut self,
_compiler: &Compiler, _compiler: &Compiler,
krate: &rustc_ast::Crate, krate: &mut rustc_ast::Crate,
) -> Compilation { ) -> Compilation {
for item in &krate.items { for item in &krate.items {
println!("{}", item_to_string(&item)); println!("{}", item_to_string(&item));

View File

@ -58,7 +58,7 @@ impl rustc_driver::Callbacks for MyCallbacks {
fn after_crate_root_parsing( fn after_crate_root_parsing(
&mut self, &mut self,
_compiler: &Compiler, _compiler: &Compiler,
krate: &rustc_ast::Crate, krate: &mut rustc_ast::Crate,
) -> Compilation { ) -> Compilation {
for item in &krate.items { for item in &krate.items {
println!("{}", item_to_string(&item)); println!("{}", item_to_string(&item));

View File

@ -1 +1 @@
66d6064f9eb888018775e08f84747ee6f39ba28e 8239a37f9c0951a037cfc51763ea52a20e71e6bd

View File

@ -4,8 +4,13 @@ These are a set of steps to add support for a new target. There are
numerous end states and paths to get there, so not all sections may be numerous end states and paths to get there, so not all sections may be
relevant to your desired goal. relevant to your desired goal.
See also the associated documentation in the
[target tier policy][target_tier_policy_add].
<!-- toc --> <!-- toc -->
[target_tier_policy_add]: https://doc.rust-lang.org/rustc/target-tier-policy.html#adding-a-new-target
## Specifying a new LLVM ## Specifying a new LLVM
For very new targets, you may need to use a different fork of LLVM For very new targets, you may need to use a different fork of LLVM

View File

@ -275,7 +275,7 @@ Here are some notable ones:
| `rustc_dump_def_parents` | Dumps the chain of `DefId` parents of certain definitions. | | `rustc_dump_def_parents` | Dumps the chain of `DefId` parents of certain definitions. |
| `rustc_dump_item_bounds` | Dumps the [`item_bounds`] of an item. | | `rustc_dump_item_bounds` | Dumps the [`item_bounds`] of an item. |
| `rustc_dump_predicates` | Dumps the [`predicates_of`] an item. | | `rustc_dump_predicates` | Dumps the [`predicates_of`] an item. |
| `rustc_dump_vtable` | | | `rustc_dump_vtable` | Dumps the vtable layout of an impl, or a type alias of a dyn type. |
| `rustc_hidden_type_of_opaques` | Dumps the [hidden type of each opaque types][opaq] in the crate. | | `rustc_hidden_type_of_opaques` | Dumps the [hidden type of each opaque types][opaq] in the crate. |
| `rustc_layout` | [See this section](#debugging-type-layouts). | | `rustc_layout` | [See this section](#debugging-type-layouts). |
| `rustc_object_lifetime_default` | Dumps the [object lifetime defaults] of an item. | | `rustc_object_lifetime_default` | Dumps the [object lifetime defaults] of an item. |

View File

@ -43,7 +43,7 @@ environment.
## Formatting and linting Python code ## Formatting and linting Python code
The Rust repository contains quite a lof of Python code. We try to keep The Rust repository contains quite a lot of Python code. We try to keep
it both linted and formatted by the [ruff][ruff] tool. it both linted and formatted by the [ruff][ruff] tool.
When modifying Python code, use this command to format it: When modifying Python code, use this command to format it:

View File

@ -40,7 +40,7 @@ requirements of impls and functions as explicit predicates.
### using implicit implied bounds as assumptions ### using implicit implied bounds as assumptions
These bounds are not added to the `ParamEnv` of the affected item itself. For lexical These bounds are not added to the `ParamEnv` of the affected item itself. For lexical
region resolution they are added using [`fn OutlivesEnvironment::with_bounds`]. region resolution they are added using [`fn OutlivesEnvironment::from_normalized_bounds`].
Similarly, during MIR borrowck we add them using Similarly, during MIR borrowck we add them using
[`fn UniversalRegionRelationsBuilder::add_implied_bounds`]. [`fn UniversalRegionRelationsBuilder::add_implied_bounds`].
@ -55,7 +55,7 @@ The assumed outlives constraints for implicit bounds are computed using the
MIR borrowck adds the outlives constraints for both the normalized and unnormalized types, MIR borrowck adds the outlives constraints for both the normalized and unnormalized types,
lexical region resolution [only uses the unnormalized types][notnorm]. lexical region resolution [only uses the unnormalized types][notnorm].
[`fn OutlivesEnvironment::with_bounds`]: https://github.com/rust-lang/rust/blob/5b8bc568d28b2e922290c9a966b3231d0ce9398b/compiler/rustc_infer/src/infer/outlives/env.rs#L90-L97 [`fn OutlivesEnvironment::from_normalized_bounds`]: https://github.com/rust-lang/rust/blob/8239a37f9c0951a037cfc51763ea52a20e71e6bd/compiler/rustc_infer/src/infer/outlives/env.rs#L50-L55
[`fn UniversalRegionRelationsBuilder::add_implied_bounds`]: https://github.com/rust-lang/rust/blob/5b8bc568d28b2e922290c9a966b3231d0ce9398b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs#L316 [`fn UniversalRegionRelationsBuilder::add_implied_bounds`]: https://github.com/rust-lang/rust/blob/5b8bc568d28b2e922290c9a966b3231d0ce9398b/compiler/rustc_borrowck/src/type_check/free_region_relations.rs#L316
[mir]: https://github.com/rust-lang/rust/blob/91cae1dcdcf1a31bd8a92e4a63793d65cfe289bb/compiler/rustc_borrowck/src/type_check/free_region_relations.rs#L258-L332 [mir]: https://github.com/rust-lang/rust/blob/91cae1dcdcf1a31bd8a92e4a63793d65cfe289bb/compiler/rustc_borrowck/src/type_check/free_region_relations.rs#L258-L332
[`fn assumed_wf_types`]: https://github.com/rust-lang/rust/blob/5b8bc568d28b2e922290c9a966b3231d0ce9398b/compiler/rustc_ty_utils/src/implied_bounds.rs#L21 [`fn assumed_wf_types`]: https://github.com/rust-lang/rust/blob/5b8bc568d28b2e922290c9a966b3231d0ce9398b/compiler/rustc_ty_utils/src/implied_bounds.rs#L21