Skip to content

Commit fb87845

Browse files
committed
fix tidy and bless test
1 parent 7fc84ac commit fb87845

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

tests/ui/type-inference/regression-issue-81317.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,31 @@
11
// Regression test for #81317: type can no longer be infered as of 1.49
22
//
3-
// The problem is that the xor operator and the index.into() each have two candidate impls that could apply
3+
// The problem is that the xor operator and the index.into() call
4+
// each have two candidate impls that could apply
45
// { S as BitXor<S>, S as BitXor<&'a S> } for xor and
56
// { T::I as Into<u64>, T::I as Into<S> } for index.into()
67
// previously inference was able to infer that the only valid combination was
78
// S as BitXor<S> and T::I as Into<S>
89
//
910
// after rust-lang/rust#73905 this is no longer infered
1011
//
11-
// the error message could be better e.g. when iv is unused or has an an explicitly specified type S
12+
// the error message could be better e.g.
13+
// when iv is unused or has an an explicitly specified type S
1214
// there is currently the following help message
1315
//
1416
// error[E0284]: type annotations needed
1517
// --> src/main.rs:13:24
1618
// |
17-
// 42 | let iv = S ^ index.into();
19+
// 44 | let iv = S ^ index.into();
1820
// | - ^^^^
1921
// | |
2022
// | type must be known at this point
2123
// |
2224
// = note: cannot satisfy `<S as BitXor<_>>::Output == _`
2325
// help: try using a fully qualified path to specify the expected types
2426
// |
25-
// 42 - let iv = S ^ index.into();
26-
// 42 + let iv = S ^ <<T as P>::I as Into<T>>::into(index);
27+
// 44 - let iv = S ^ index.into();
28+
// 44 + let iv = S ^ <<T as P>::I as Into<T>>::into(index);
2729
//
2830
// this is better as it's actually sufficent to fix the problem,
2931
// while just specifying the type of iv as currently suggested is insufficent

tests/ui/type-inference/regression-issue-81317.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0282]: type annotations needed
2-
--> $DIR/regression-issue-81317.rs:13:9
2+
--> $DIR/regression-issue-81317.rs:44:9
33
|
44
LL | let iv = S ^ index.into();
55
| ^^

0 commit comments

Comments
 (0)