Skip to content

Commit b5c46dc

Browse files
committedFeb 10, 2024
Auto merge of #120862 - matthiaskrgr:rollup-jzfab58, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - #120584 (For a rigid projection, recursively look at the self type's item bounds to fix the `associated_type_bounds` feature) - #120596 ([rustdoc] Correctly generate path for non-local items in source code pages) - #120629 (Move some test files) - #120846 (Update jobserver-rs to 0.1.28) - #120850 (ast_lowering: Fix regression in `use ::{}` imports.) - #120853 (Avoid a collection and iteration on empty passes) r? `@ghost` `@rustbot` modify labels: rollup
·
1.91.01.78.0
2 parents d44e3b9 + 8e1eadd commit b5c46dc

File tree

68 files changed

+565
-524
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+565
-524
lines changed
 

‎Cargo.lock‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,9 +2090,9 @@ dependencies = [
20902090

20912091
[[package]]
20922092
name = "jobserver"
2093-
version = "0.1.27"
2093+
version = "0.1.28"
20942094
source = "registry+https://github.com/rust-lang/crates.io-index"
2095-
checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d"
2095+
checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6"
20962096
dependencies = [
20972097
"libc",
20982098
]

‎compiler/rustc_ast_lowering/src/item.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
569569
});
570570
}
571571

572-
let path = if trees.is_empty() && !prefix.segments.is_empty() {
572+
// Condition should match `build_reduced_graph_for_use_tree`.
573+
let path = if trees.is_empty()
574+
&& !(prefix.segments.is_empty()
575+
|| prefix.segments.len() == 1
576+
&& prefix.segments[0].ident.name == kw::PathRoot)
577+
{
573578
// For empty lists we need to lower the prefix so it is checked for things
574579
// like stability later.
575580
let res = self.lower_import_res(id, span);

‎compiler/rustc_ast_lowering/src/lib.rs‎

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,24 +1092,22 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
10921092

10931093
// Piggy-back on the `impl Trait` context to figure out the correct behavior.
10941094
let desugar_kind = match itctx {
1095-
// We are in the return position:
1096-
//
1097-
// fn foo() -> impl Iterator<Item: Debug>
1098-
//
1099-
// so desugar to
1100-
//
1101-
// fn foo() -> impl Iterator<Item = impl Debug>
1102-
ImplTraitContext::ReturnPositionOpaqueTy { .. }
1103-
| ImplTraitContext::TypeAliasesOpaqueTy { .. } => DesugarKind::ImplTrait,
1104-
1105-
// We are in the argument position, but within a dyn type:
1095+
// in an argument, RPIT, or TAIT, if we are within a dyn type:
11061096
//
11071097
// fn foo(x: dyn Iterator<Item: Debug>)
11081098
//
1109-
// so desugar to
1099+
// then desugar to:
11101100
//
11111101
// fn foo(x: dyn Iterator<Item = impl Debug>)
1112-
ImplTraitContext::Universal if self.is_in_dyn_type => DesugarKind::ImplTrait,
1102+
//
1103+
// This is because dyn traits must have all of their associated types specified.
1104+
ImplTraitContext::ReturnPositionOpaqueTy { .. }
1105+
| ImplTraitContext::TypeAliasesOpaqueTy { .. }
1106+
| ImplTraitContext::Universal
1107+
if self.is_in_dyn_type =>
1108+
{
1109+
DesugarKind::ImplTrait
1110+
}
11131111

11141112
ImplTraitContext::Disallowed(position) if self.is_in_dyn_type => {
11151113
DesugarKind::Error(position)

‎compiler/rustc_codegen_ssa/Cargo.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ar_archive_writer = "0.1.5"
99
bitflags = "2.4.1"
1010
cc = "1.0.69"
1111
itertools = "0.11"
12-
jobserver = "0.1.27"
12+
jobserver = "0.1.28"
1313
pathdiff = "0.2.0"
1414
regex = "1.4"
1515
rustc_arena = { path = "../rustc_arena" }

0 commit comments

Comments
 (0)
Please sign in to comment.