Skip to content

Commit db4b4d3

Browse files
committed
Auto merge of rust-lang#102097 - Dylan-DPC:rollup-gc75oh4, r=Dylan-DPC
Rollup of 7 pull requests Successful merges: - rust-lang#89891 (`alloc`: add unstable cfg features `no_rc` and `no_sync`) - rust-lang#101995 (Add another example for `uN::carrying_mul`) - rust-lang#102031 (Adding ignore fuchsia tests for Backtrace, ErrorKind cases) - rust-lang#102041 (Improve `-Zmeta-stats` some more) - rust-lang#102045 (fix ConstProp handling of written_only_inside_own_block_locals) - rust-lang#102058 (Clarify Path::extension() semantics in docs abstract) - rust-lang#102059 (Use rebind instead of dummy binder in `SameTypeModuloInfer` relation) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents b79b7d8 + 39bb2a7 commit db4b4d3

File tree

23 files changed

+391
-242
lines changed

23 files changed

+391
-242
lines changed

Diff for: compiler/rustc_infer/src/infer/error_reporting/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2765,7 +2765,7 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
27652765
where
27662766
T: relate::Relate<'tcx>,
27672767
{
2768-
Ok(ty::Binder::dummy(self.relate(a.skip_binder(), b.skip_binder())?))
2768+
Ok(a.rebind(self.relate(a.skip_binder(), b.skip_binder())?))
27692769
}
27702770

27712771
fn consts(

Diff for: compiler/rustc_metadata/src/rmeta/encoder.rs

+152-213
Large diffs are not rendered by default.

Diff for: compiler/rustc_mir_transform/src/const_prop.rs

+20-20
Original file line numberDiff line numberDiff line change
@@ -1066,32 +1066,32 @@ impl<'tcx> MutVisitor<'tcx> for ConstPropagator<'_, 'tcx> {
10661066
let source_info = terminator.source_info;
10671067
self.source_info = Some(source_info);
10681068
self.super_terminator(terminator, location);
1069+
// Do NOT early return in this function, it does some crucial fixup of the state at the end!
10691070
match &mut terminator.kind {
10701071
TerminatorKind::Assert { expected, ref mut cond, .. } => {
10711072
if let Some(ref value) = self.eval_operand(&cond) {
10721073
trace!("assertion on {:?} should be {:?}", value, expected);
10731074
let expected = Scalar::from_bool(*expected);
1074-
let Ok(value_const) = self.ecx.read_scalar(&value) else {
1075-
// FIXME should be used use_ecx rather than a local match... but we have
1076-
// quite a few of these read_scalar/read_immediate that need fixing.
1077-
return
1078-
};
1079-
if expected != value_const {
1080-
// Poison all places this operand references so that further code
1081-
// doesn't use the invalid value
1082-
match cond {
1083-
Operand::Move(ref place) | Operand::Copy(ref place) => {
1084-
Self::remove_const(&mut self.ecx, place.local);
1075+
// FIXME should be used use_ecx rather than a local match... but we have
1076+
// quite a few of these read_scalar/read_immediate that need fixing.
1077+
if let Ok(value_const) = self.ecx.read_scalar(&value) {
1078+
if expected != value_const {
1079+
// Poison all places this operand references so that further code
1080+
// doesn't use the invalid value
1081+
match cond {
1082+
Operand::Move(ref place) | Operand::Copy(ref place) => {
1083+
Self::remove_const(&mut self.ecx, place.local);
1084+
}
1085+
Operand::Constant(_) => {}
1086+
}
1087+
} else {
1088+
if self.should_const_prop(value) {
1089+
*cond = self.operand_from_scalar(
1090+
value_const,
1091+
self.tcx.types.bool,
1092+
source_info.span,
1093+
);
10851094
}
1086-
Operand::Constant(_) => {}
1087-
}
1088-
} else {
1089-
if self.should_const_prop(value) {
1090-
*cond = self.operand_from_scalar(
1091-
value_const,
1092-
self.tcx.types.bool,
1093-
source_info.span,
1094-
);
10951095
}
10961096
}
10971097
}

Diff for: library/alloc/src/lib.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@
6969
any(not(feature = "miri-test-libstd"), test, doctest),
7070
no_global_oom_handling,
7171
not(no_global_oom_handling),
72+
not(no_rc),
73+
not(no_sync),
7274
target_has_atomic = "ptr"
7375
))]
7476
#![no_std]
@@ -225,16 +227,17 @@ mod boxed {
225227
}
226228
pub mod borrow;
227229
pub mod collections;
228-
#[cfg(not(no_global_oom_handling))]
230+
#[cfg(all(not(no_rc), not(no_sync), not(no_global_oom_handling)))]
229231
pub mod ffi;
230232
pub mod fmt;
233+
#[cfg(not(no_rc))]
231234
pub mod rc;
232235
pub mod slice;
233236
pub mod str;
234237
pub mod string;
235-
#[cfg(target_has_atomic = "ptr")]
238+
#[cfg(all(not(no_rc), not(no_sync), target_has_atomic = "ptr"))]
236239
pub mod sync;
237-
#[cfg(all(not(no_global_oom_handling), target_has_atomic = "ptr"))]
240+
#[cfg(all(not(no_global_oom_handling), not(no_rc), not(no_sync), target_has_atomic = "ptr"))]
238241
pub mod task;
239242
#[cfg(test)]
240243
mod tests;

Diff for: library/core/src/num/mod.rs

+30
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ macro_rules! widening_impl {
113113
/// This returns the low-order (wrapping) bits and the high-order (overflow) bits
114114
/// of the result as two separate values, in that order.
115115
///
116+
/// If you also need to add a carry to the wide result, then you want
117+
/// [`Self::carrying_mul`] instead.
118+
///
116119
/// # Examples
117120
///
118121
/// Basic usage:
@@ -148,6 +151,8 @@ macro_rules! widening_impl {
148151
/// additional amount of overflow. This allows for chaining together multiple
149152
/// multiplications to create "big integers" which represent larger values.
150153
///
154+
/// If you don't need the `carry`, then you can use [`Self::widening_mul`] instead.
155+
///
151156
/// # Examples
152157
///
153158
/// Basic usage:
@@ -167,6 +172,31 @@ macro_rules! widening_impl {
167172
)]
168173
/// ```
169174
///
175+
/// This is the core operation needed for scalar multiplication when
176+
/// implementing it for wider-than-native types.
177+
///
178+
/// ```
179+
/// #![feature(bigint_helper_methods)]
180+
/// fn scalar_mul_eq(little_endian_digits: &mut Vec<u16>, multiplicand: u16) {
181+
/// let mut carry = 0;
182+
/// for d in little_endian_digits.iter_mut() {
183+
/// (*d, carry) = d.carrying_mul(multiplicand, carry);
184+
/// }
185+
/// if carry != 0 {
186+
/// little_endian_digits.push(carry);
187+
/// }
188+
/// }
189+
///
190+
/// let mut v = vec![10, 20];
191+
/// scalar_mul_eq(&mut v, 3);
192+
/// assert_eq!(v, [30, 60]);
193+
///
194+
/// assert_eq!(0x87654321_u64 * 0xFEED, 0x86D3D159E38D);
195+
/// let mut v = vec![0x4321, 0x8765];
196+
/// scalar_mul_eq(&mut v, 0xFEED);
197+
/// assert_eq!(v, [0xE38D, 0xD159, 0x86D3]);
198+
/// ```
199+
///
170200
/// If `carry` is zero, this is similar to [`overflowing_mul`](Self::overflowing_mul),
171201
/// except that it gives the value of the overflow instead of just whether one happened:
172202
///

Diff for: library/std/src/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2401,7 +2401,7 @@ impl Path {
24012401
self.file_name().map(split_file_at_dot).and_then(|(before, _after)| Some(before))
24022402
}
24032403

2404-
/// Extracts the extension of [`self.file_name`], if possible.
2404+
/// Extracts the extension (without the leading dot) of [`self.file_name`], if possible.
24052405
///
24062406
/// The extension is:
24072407
///

Diff for: src/bootstrap/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,8 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &'static str, Option<&[&'static str]>)]
201201
(Some(Mode::Std), "stdarch_intel_sde", None),
202202
(Some(Mode::Std), "no_fp_fmt_parse", None),
203203
(Some(Mode::Std), "no_global_oom_handling", None),
204+
(Some(Mode::Std), "no_rc", None),
205+
(Some(Mode::Std), "no_sync", None),
204206
(Some(Mode::Std), "freebsd12", None),
205207
(Some(Mode::Std), "backtrace_in_libstd", None),
206208
/* Extra values not defined in the built-in targets yet, but used in std */

Diff for: src/test/mir-opt/issue-101973.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// compile-flags: -O -C debug-assertions=on
2+
// This needs inlining followed by ConstProp to reproduce, so we cannot use "unit-test".
3+
4+
#[inline]
5+
pub fn imm8(x: u32) -> u32 {
6+
let mut out = 0u32;
7+
out |= (x >> 0) & 0xff;
8+
out
9+
}
10+
11+
// EMIT_MIR issue_101973.inner.ConstProp.diff
12+
#[inline(never)]
13+
pub fn inner(fields: u32) -> i64 {
14+
imm8(fields).rotate_right(((fields >> 8) & 0xf) << 1) as i32 as i64
15+
}
16+
17+
fn main() {
18+
let val = inner(0xe32cf20f);
19+
assert_eq!(val as u64, 0xfffffffff0000000);
20+
}

Diff for: src/test/mir-opt/issue_101973.inner.ConstProp.diff

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
- // MIR for `inner` before ConstProp
2+
+ // MIR for `inner` after ConstProp
3+
4+
fn inner(_1: u32) -> i64 {
5+
debug fields => _1; // in scope 0 at $DIR/issue-101973.rs:+0:14: +0:20
6+
let mut _0: i64; // return place in scope 0 at $DIR/issue-101973.rs:+0:30: +0:33
7+
let mut _2: i32; // in scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
8+
let mut _3: u32; // in scope 0 at $DIR/issue-101973.rs:+1:5: +1:58
9+
let mut _4: u32; // in scope 0 at $DIR/issue-101973.rs:+1:5: +1:17
10+
let mut _5: u32; // in scope 0 at $DIR/issue-101973.rs:+1:10: +1:16
11+
let mut _6: u32; // in scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
12+
let mut _7: u32; // in scope 0 at $DIR/issue-101973.rs:+1:31: +1:52
13+
let mut _8: u32; // in scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
14+
let mut _9: u32; // in scope 0 at $DIR/issue-101973.rs:+1:33: +1:39
15+
let mut _10: (u32, bool); // in scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
16+
let mut _11: (u32, bool); // in scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
17+
scope 1 (inlined imm8) { // at $DIR/issue-101973.rs:14:5: 14:17
18+
debug x => _5; // in scope 1 at $DIR/issue-101973.rs:5:13: 5:14
19+
let mut _12: u32; // in scope 1 at $DIR/issue-101973.rs:7:12: 7:27
20+
let mut _13: u32; // in scope 1 at $DIR/issue-101973.rs:7:12: 7:20
21+
let mut _14: u32; // in scope 1 at $DIR/issue-101973.rs:7:13: 7:14
22+
let mut _15: (u32, bool); // in scope 1 at $DIR/issue-101973.rs:7:12: 7:20
23+
scope 2 {
24+
debug out => _4; // in scope 2 at $DIR/issue-101973.rs:6:9: 6:16
25+
}
26+
}
27+
scope 3 (inlined core::num::<impl u32>::rotate_right) { // at $DIR/issue-101973.rs:14:5: 14:58
28+
debug self => _4; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
29+
debug n => _6; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
30+
let mut _16: u32; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
31+
let mut _17: u32; // in scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
32+
}
33+
34+
bb0: {
35+
StorageLive(_2); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
36+
StorageLive(_3); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:58
37+
StorageLive(_4); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:17
38+
StorageLive(_5); // scope 0 at $DIR/issue-101973.rs:+1:10: +1:16
39+
_5 = _1; // scope 0 at $DIR/issue-101973.rs:+1:10: +1:16
40+
_4 = const 0_u32; // scope 1 at $DIR/issue-101973.rs:6:19: 6:23
41+
StorageLive(_12); // scope 2 at $DIR/issue-101973.rs:7:12: 7:27
42+
StorageLive(_13); // scope 2 at $DIR/issue-101973.rs:7:12: 7:20
43+
StorageLive(_14); // scope 2 at $DIR/issue-101973.rs:7:13: 7:14
44+
_14 = _5; // scope 2 at $DIR/issue-101973.rs:7:13: 7:14
45+
_15 = CheckedShr(_14, const 0_i32); // scope 2 at $DIR/issue-101973.rs:7:12: 7:20
46+
assert(!move (_15.1: bool), "attempt to shift right by `{}`, which would overflow", const 0_i32) -> bb3; // scope 2 at $DIR/issue-101973.rs:7:12: 7:20
47+
}
48+
49+
bb1: {
50+
_8 = move (_10.0: u32); // scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
51+
StorageDead(_9); // scope 0 at $DIR/issue-101973.rs:+1:44: +1:45
52+
_7 = BitAnd(move _8, const 15_u32); // scope 0 at $DIR/issue-101973.rs:+1:31: +1:52
53+
StorageDead(_8); // scope 0 at $DIR/issue-101973.rs:+1:51: +1:52
54+
_11 = CheckedShl(_7, const 1_i32); // scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
55+
assert(!move (_11.1: bool), "attempt to shift left by `{}`, which would overflow", const 1_i32) -> bb2; // scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
56+
}
57+
58+
bb2: {
59+
_6 = move (_11.0: u32); // scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
60+
StorageDead(_7); // scope 0 at $DIR/issue-101973.rs:+1:56: +1:57
61+
StorageLive(_16); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
62+
_16 = _4; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
63+
StorageLive(_17); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
64+
_17 = _6; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
65+
_3 = rotate_right::<u32>(move _16, move _17) -> bb4; // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
66+
// mir::Constant
67+
// + span: $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
68+
// + literal: Const { ty: extern "rust-intrinsic" fn(u32, u32) -> u32 {rotate_right::<u32>}, val: Value(<ZST>) }
69+
}
70+
71+
bb3: {
72+
_13 = move (_15.0: u32); // scope 2 at $DIR/issue-101973.rs:7:12: 7:20
73+
StorageDead(_14); // scope 2 at $DIR/issue-101973.rs:7:19: 7:20
74+
_12 = BitAnd(move _13, const 255_u32); // scope 2 at $DIR/issue-101973.rs:7:12: 7:27
75+
StorageDead(_13); // scope 2 at $DIR/issue-101973.rs:7:26: 7:27
76+
_4 = BitOr(_4, move _12); // scope 2 at $DIR/issue-101973.rs:7:5: 7:27
77+
StorageDead(_12); // scope 2 at $DIR/issue-101973.rs:7:26: 7:27
78+
StorageDead(_5); // scope 0 at $DIR/issue-101973.rs:+1:16: +1:17
79+
StorageLive(_6); // scope 0 at $DIR/issue-101973.rs:+1:31: +1:57
80+
StorageLive(_7); // scope 0 at $DIR/issue-101973.rs:+1:31: +1:52
81+
StorageLive(_8); // scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
82+
StorageLive(_9); // scope 0 at $DIR/issue-101973.rs:+1:33: +1:39
83+
_9 = _1; // scope 0 at $DIR/issue-101973.rs:+1:33: +1:39
84+
_10 = CheckedShr(_9, const 8_i32); // scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
85+
assert(!move (_10.1: bool), "attempt to shift right by `{}`, which would overflow", const 8_i32) -> bb1; // scope 0 at $DIR/issue-101973.rs:+1:32: +1:45
86+
}
87+
88+
bb4: {
89+
StorageDead(_17); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
90+
StorageDead(_16); // scope 3 at $SRC_DIR/core/src/num/uint_macros.rs:LL:COL
91+
StorageDead(_6); // scope 0 at $DIR/issue-101973.rs:+1:57: +1:58
92+
StorageDead(_4); // scope 0 at $DIR/issue-101973.rs:+1:57: +1:58
93+
_2 = move _3 as i32 (Misc); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:65
94+
StorageDead(_3); // scope 0 at $DIR/issue-101973.rs:+1:64: +1:65
95+
_0 = move _2 as i64 (Misc); // scope 0 at $DIR/issue-101973.rs:+1:5: +1:72
96+
StorageDead(_2); // scope 0 at $DIR/issue-101973.rs:+1:71: +1:72
97+
return; // scope 0 at $DIR/issue-101973.rs:+2:2: +2:2
98+
}
99+
}
100+

Diff for: src/test/run-make-fulldeps/alloc-no-rc/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include ../tools.mk
2+
3+
all:
4+
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_rc

Diff for: src/test/run-make-fulldeps/alloc-no-sync/Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
include ../tools.mk
2+
3+
all:
4+
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_sync

Diff for: src/test/ui/backtrace.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// ignore-openbsd no support for libbacktrace without filename
55
// ignore-sgx no processes
66
// ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
7+
// ignore-fuchsia Backtraces not symbolized
78
// compile-flags:-g
89
// compile-flags:-Cstrip=none
910

Diff for: src/test/ui/panics/issue-47429-short-backtraces.legacy.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:22:5
1+
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:23:5
22
stack backtrace:
33
0: std::panicking::begin_panic
44
1: issue_47429_short_backtraces::main

Diff for: src/test/ui/panics/issue-47429-short-backtraces.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ignore-wasm no panic or subprocess support
1313
// ignore-emscripten no panic or subprocess support
1414
// ignore-sgx no subprocess support
15+
// ignore-fuchsia Backtraces not symbolized
1516

1617
// NOTE(eddyb) output differs between symbol mangling schemes
1718
// revisions: legacy v0

Diff for: src/test/ui/panics/issue-47429-short-backtraces.v0.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:22:5
1+
thread 'main' panicked at 'explicit panic', $DIR/issue-47429-short-backtraces.rs:23:5
22
stack backtrace:
33
0: std::panicking::begin_panic::<&str>
44
1: issue_47429_short_backtraces::main

Diff for: src/test/ui/panics/runtime-switch.legacy.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:25:5
1+
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:26:5
22
stack backtrace:
33
0: std::panicking::begin_panic
44
1: runtime_switch::main

Diff for: src/test/ui/panics/runtime-switch.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ignore-wasm no panic or subprocess support
1313
// ignore-emscripten no panic or subprocess support
1414
// ignore-sgx no subprocess support
15+
// ignore-fuchsia Backtrace not symbolized
1516

1617
// NOTE(eddyb) output differs between symbol mangling schemes
1718
// revisions: legacy v0

Diff for: src/test/ui/panics/runtime-switch.v0.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:25:5
1+
thread 'main' panicked at 'explicit panic', $DIR/runtime-switch.rs:26:5
22
stack backtrace:
33
0: std::panicking::begin_panic::<&str>
44
1: runtime_switch::main

Diff for: src/test/ui/process/process-spawn-nonexistent.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// run-pass
22
// ignore-emscripten no processes
33
// ignore-sgx no processes
4+
// ignore-fuchsia ErrorKind not translated
45

56
use std::io::ErrorKind;
67
use std::process::Command;

Diff for: src/test/ui/runtime/backtrace-debuginfo.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
// ignore-pretty issue #37195
1313
// ignore-emscripten spawning processes is not supported
1414
// ignore-sgx no processes
15+
// ignore-fuchsia Backtrace not symbolized, trace different line alignment
1516

1617
use std::env;
1718

Diff for: src/test/ui/std-backtrace.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// ignore-openbsd no support for libbacktrace without filename
55
// ignore-sgx no processes
66
// ignore-msvc see #62897 and `backtrace-debuginfo.rs` test
7+
// ignore-fuchsia Backtraces not symbolized
78
// compile-flags:-g
89
// compile-flags:-Cstrip=none
910

Diff for: src/test/ui/suggestions/issue-101984.rs

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
use std::marker::PhantomData;
2+
3+
type Component = fn(&());
4+
5+
struct Wrapper {
6+
router: Router<(Component, Box<Self>)>,
7+
}
8+
9+
struct Match<C>(PhantomData<C>);
10+
11+
struct Router<T>(PhantomData<T>);
12+
13+
impl<T> Router<T> {
14+
pub fn at(&self) -> Result<Match<&T>, ()> {
15+
todo!()
16+
}
17+
}
18+
19+
impl Wrapper {
20+
fn at(&self, path: &str) -> Result<(Component, Box<Self>), ()> {
21+
let (cmp, router) = self.router.at()?;
22+
//~^ ERROR mismatched types
23+
todo!()
24+
}
25+
}
26+
27+
fn main() {}

0 commit comments

Comments
 (0)