Skip to content

Commit b73e9a4

Browse files
committed
Auto merge of rust-lang#114130 - GuillaumeGomez:rollup-69ihuaj, r=GuillaumeGomez
Rollup of 7 pull requests Successful merges: - rust-lang#114032 (typos) - rust-lang#114059 (rustdoc: fix cross-crate `impl Sized` & `impl ?Sized`) - rust-lang#114088 (Bump syn dependency) - rust-lang#114091 (docs: fmt::Debug*: Fix comments for finish method.) - rust-lang#114109 (Docs: Fix URL for `rmatches`) - rust-lang#114117 (Restore region uniquification in the new solver 🎉 ) - rust-lang#114123 (Turns out opaque types can have hidden types registered during mir validation) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 49a16b6 + 218e88e commit b73e9a4

File tree

22 files changed

+420
-272
lines changed

22 files changed

+420
-272
lines changed

Cargo.lock

+19-19
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ dependencies = [
220220
"proc-macro2",
221221
"quote",
222222
"serde",
223-
"syn 2.0.8",
223+
"syn 2.0.27",
224224
]
225225

226226
[[package]]
@@ -502,7 +502,7 @@ dependencies = [
502502
"heck",
503503
"proc-macro2",
504504
"quote",
505-
"syn 2.0.8",
505+
"syn 2.0.27",
506506
]
507507

508508
[[package]]
@@ -527,7 +527,7 @@ dependencies = [
527527
"regex",
528528
"rustc_tools_util",
529529
"serde",
530-
"syn 2.0.8",
530+
"syn 2.0.27",
531531
"tempfile",
532532
"termize",
533533
"tester",
@@ -842,7 +842,7 @@ version = "0.1.73"
842842
dependencies = [
843843
"itertools",
844844
"quote",
845-
"syn 2.0.8",
845+
"syn 2.0.27",
846846
]
847847

848848
[[package]]
@@ -943,7 +943,7 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
943943
dependencies = [
944944
"proc-macro2",
945945
"quote",
946-
"syn 2.0.8",
946+
"syn 2.0.27",
947947
]
948948

949949
[[package]]
@@ -1309,7 +1309,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
13091309
dependencies = [
13101310
"proc-macro2",
13111311
"quote",
1312-
"syn 2.0.8",
1312+
"syn 2.0.27",
13131313
]
13141314

13151315
[[package]]
@@ -2456,7 +2456,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
24562456
dependencies = [
24572457
"proc-macro2",
24582458
"quote",
2459-
"syn 2.0.8",
2459+
"syn 2.0.27",
24602460
]
24612461

24622462
[[package]]
@@ -2643,7 +2643,7 @@ dependencies = [
26432643
"pest_meta",
26442644
"proc-macro2",
26452645
"quote",
2646-
"syn 2.0.8",
2646+
"syn 2.0.27",
26472647
]
26482648

26492649
[[package]]
@@ -3586,7 +3586,7 @@ dependencies = [
35863586
"fluent-syntax",
35873587
"proc-macro2",
35883588
"quote",
3589-
"syn 2.0.8",
3589+
"syn 2.0.27",
35903590
"unic-langid",
35913591
]
35923592

@@ -3855,7 +3855,7 @@ version = "0.1.0"
38553855
dependencies = [
38563856
"proc-macro2",
38573857
"quote",
3858-
"syn 2.0.8",
3858+
"syn 2.0.27",
38593859
"synstructure 0.13.0",
38603860
]
38613861

@@ -4462,7 +4462,7 @@ dependencies = [
44624462
"proc-macro2",
44634463
"quote",
44644464
"serde",
4465-
"syn 2.0.8",
4465+
"syn 2.0.27",
44664466
]
44674467

44684468
[[package]]
@@ -4629,7 +4629,7 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
46294629
dependencies = [
46304630
"proc-macro2",
46314631
"quote",
4632-
"syn 2.0.8",
4632+
"syn 2.0.27",
46334633
]
46344634

46354635
[[package]]
@@ -4910,9 +4910,9 @@ dependencies = [
49104910

49114911
[[package]]
49124912
name = "syn"
4913-
version = "2.0.8"
4913+
version = "2.0.27"
49144914
source = "registry+https://github.com/rust-lang/crates.io-index"
4915-
checksum = "bcc02725fd69ab9f26eab07fad303e2497fad6fb9eba4f96c4d1687bdf704ad9"
4915+
checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0"
49164916
dependencies = [
49174917
"proc-macro2",
49184918
"quote",
@@ -4939,7 +4939,7 @@ checksum = "285ba80e733fac80aa4270fbcdf83772a79b80aa35c97075320abfee4a915b06"
49394939
dependencies = [
49404940
"proc-macro2",
49414941
"quote",
4942-
"syn 2.0.8",
4942+
"syn 2.0.27",
49434943
"unicode-xid",
49444944
]
49454945

@@ -5089,7 +5089,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
50895089
dependencies = [
50905090
"proc-macro2",
50915091
"quote",
5092-
"syn 2.0.8",
5092+
"syn 2.0.27",
50935093
]
50945094

50955095
[[package]]
@@ -5310,7 +5310,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
53105310
dependencies = [
53115311
"proc-macro2",
53125312
"quote",
5313-
"syn 2.0.8",
5313+
"syn 2.0.27",
53145314
]
53155315

53165316
[[package]]
@@ -5740,7 +5740,7 @@ dependencies = [
57405740
"once_cell",
57415741
"proc-macro2",
57425742
"quote",
5743-
"syn 2.0.8",
5743+
"syn 2.0.27",
57445744
"wasm-bindgen-shared",
57455745
]
57465746

@@ -5774,7 +5774,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
57745774
dependencies = [
57755775
"proc-macro2",
57765776
"quote",
5777-
"syn 2.0.8",
5777+
"syn 2.0.27",
57785778
"wasm-bindgen-backend",
57795779
"wasm-bindgen-shared",
57805780
]

compiler/rustc_const_eval/src/util/compare_types.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,15 @@ pub fn is_subtype<'tcx>(
5757
// we would get unification errors because we're unable to look into opaque types,
5858
// even if they're constrained in our current function.
5959
for (key, ty) in infcx.take_opaque_types() {
60-
span_bug!(
61-
ty.hidden_type.span,
62-
"{}, {}",
63-
tcx.type_of(key.def_id).instantiate(tcx, key.args),
64-
ty.hidden_type.ty
65-
);
60+
let hidden_ty = tcx.type_of(key.def_id).instantiate(tcx, key.args);
61+
if hidden_ty != ty.hidden_type.ty {
62+
span_bug!(
63+
ty.hidden_type.span,
64+
"{}, {}",
65+
tcx.type_of(key.def_id).instantiate(tcx, key.args),
66+
ty.hidden_type.ty
67+
);
68+
}
6669
}
6770
errors.is_empty()
6871
}

compiler/rustc_macros/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ proc-macro = true
88

99
[dependencies]
1010
synstructure = "0.13.0"
11-
# FIXME(Nilstrieb): Updating this causes changes in the diagnostics output.
12-
syn = { version = "=2.0.8", features = ["full"] }
11+
syn = { version = "2.0.9", features = ["full"] }
1312
proc-macro2 = "1"
1413
quote = "1"

compiler/rustc_trait_selection/src/solve/canonicalize.rs

+14-11
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,8 @@ impl<'a, 'tcx> Canonicalizer<'a, 'tcx> {
125125
// - var_infos: [E0, U1, E1, U1, E1, E6, U6], curr_compressed_uv: 1, next_orig_uv: 6
126126
// - var_infos: [E0, U1, E1, U1, E1, E2, U2], curr_compressed_uv: 2, next_orig_uv: -
127127
//
128-
// This algorithm runs in `O(nm)` where `n` is the number of different universe
129-
// indices in the input and `m` is the number of canonical variables.
130-
// This should be fine as both `n` and `m` are expected to be small.
128+
// This algorithm runs in `O(n²)` where `n` is the number of different universe
129+
// indices in the input. This should be fine as `n` is expected to be small.
131130
let mut curr_compressed_uv = ty::UniverseIndex::ROOT;
132131
let mut existential_in_new_uv = false;
133132
let mut next_orig_uv = Some(ty::UniverseIndex::ROOT);
@@ -263,14 +262,18 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for Canonicalizer<'_, 'tcx> {
263262
ty::ReError(_) => return r,
264263
};
265264

266-
let var = ty::BoundVar::from(
267-
self.variables.iter().position(|&v| v == r.into()).unwrap_or_else(|| {
268-
let var = self.variables.len();
269-
self.variables.push(r.into());
270-
self.primitive_var_infos.push(CanonicalVarInfo { kind });
271-
var
272-
}),
273-
);
265+
let existing_bound_var = match self.canonicalize_mode {
266+
CanonicalizeMode::Input => None,
267+
CanonicalizeMode::Response { .. } => {
268+
self.variables.iter().position(|&v| v == r.into()).map(ty::BoundVar::from)
269+
}
270+
};
271+
let var = existing_bound_var.unwrap_or_else(|| {
272+
let var = ty::BoundVar::from(self.variables.len());
273+
self.variables.push(r.into());
274+
self.primitive_var_infos.push(CanonicalVarInfo { kind });
275+
var
276+
});
274277
let br = ty::BoundRegion { var, kind: BrAnon(None) };
275278
ty::Region::new_late_bound(self.interner(), self.binder_index, br)
276279
}

compiler/rustc_trait_selection/src/solve/eval_ctxt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
344344
Ok(response) => response,
345345
};
346346

347-
let has_changed = !canonical_response.value.var_values.is_identity()
347+
let has_changed = !canonical_response.value.var_values.is_identity_modulo_regions()
348348
|| !canonical_response.value.external_constraints.opaque_types.is_empty();
349349
let (certainty, nested_goals) = match self.instantiate_and_apply_query_response(
350350
goal.param_env,

library/core/src/fmt/builders.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ impl<'a, 'b: 'a> DebugSet<'a, 'b> {
518518
/// fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
519519
/// fmt.debug_set()
520520
/// .entries(self.0.iter())
521-
/// .finish() // Ends the struct formatting.
521+
/// .finish() // Ends the set formatting.
522522
/// }
523523
/// }
524524
///
@@ -648,7 +648,7 @@ impl<'a, 'b: 'a> DebugList<'a, 'b> {
648648
/// fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
649649
/// fmt.debug_list()
650650
/// .entries(self.0.iter())
651-
/// .finish() // Ends the struct formatting.
651+
/// .finish() // Ends the list formatting.
652652
/// }
653653
/// }
654654
///
@@ -905,7 +905,7 @@ impl<'a, 'b: 'a> DebugMap<'a, 'b> {
905905
/// fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
906906
/// fmt.debug_map()
907907
/// .entries(self.0.iter().map(|&(ref k, ref v)| (k, v)))
908-
/// .finish() // Ends the struct formatting.
908+
/// .finish() // Ends the map formatting.
909909
/// }
910910
/// }
911911
///

library/core/src/str/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1666,7 +1666,7 @@ impl str {
16661666
/// If the pattern allows a reverse search but its results might differ
16671667
/// from a forward search, the [`rmatches`] method can be used.
16681668
///
1669-
/// [`rmatches`]: str::matches
1669+
/// [`rmatches`]: str::rmatches
16701670
///
16711671
/// # Examples
16721672
///

0 commit comments

Comments
 (0)