Skip to content

Commit 06638ff

Browse files
bors[bot]dtolnay
andauthored
Merge #4741
4741: Fix type inference failure when built with log/kv_unstable r=flodiebold a=dtolnay This code is broken by an `impl From<kv::Error> for fmt::Error` in the log crate when building in a codebase that has the log/kv_unstable feature enabled. ```console $ cargo check --manifest-path crates/ra_hir_def/Cargo.toml Checking ra_hir_def v0.1.0 Finished dev [unoptimized] target(s) in 0.75s $ cargo check --manifest-path crates/ra_hir_def/Cargo.toml --features log/kv_unstable Checking ra_hir_def v0.1.0 error[E0282]: type annotations needed for the closure `fn(&str) -> std::result::Result<(), _>` --> crates/ra_hir_def/src/path.rs:278:17 | 278 | f.write_str("::")?; | ^^^^^^^^^^^^^^^^^^ cannot infer type | help: give this closure an explicit return type without `_` placeholders | 276 | let mut add_segment = |s| -> std::result::Result<(), _> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` rust-lang/log#397 Co-authored-by: David Tolnay <[email protected]>
2 parents 1dba840 + 4461796 commit 06638ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/ra_hir_def/src/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl From<Name> for ModPath {
273273
impl Display for ModPath {
274274
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
275275
let mut first_segment = true;
276-
let mut add_segment = |s| {
276+
let mut add_segment = |s| -> fmt::Result {
277277
if !first_segment {
278278
f.write_str("::")?;
279279
}

0 commit comments

Comments
 (0)