On this PR, which gives the
SliceIndex a default implementation for
R: RangeBounds<usize>, I’m running into the following error in an existing test:
[00:08:42] Compiling syntax_ext v0.0.0 (file:///checkout/src/libsyntax_ext) [00:08:58] error[E0282]: type annotations needed [00:08:58] --> librustc/hir/lowering.rs:1903:58 [00:08:58] | [00:08:58] 1903 | add_bounds.get(&ty_param.id).map_or(&[..], |x| &x), [00:08:58] | ^^^^^^ cannot infer type for `T` 41760 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu 41756 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release 41260 ./src/llvm/test/CodeGen/X86 40776 ./src/libcompiler_builtins
Before the PR,
SliceIndex was implemented for a number of concrete types. With this PR, it is given a default impl for
R: RangeBounds<usize>, and the concrete impls now specialize that default impl. I suspect it may be an instance of this issue.
Does anyone have an idea of how I might go about fixing this? Is it even fixable with the current behavior of impl specialization? Thanks!