aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-06-04 09:09:56 +0100
committerGitHub <[email protected]>2020-06-04 09:09:56 +0100
commit06638ff848f092432a9818bbc81c7ee18e93a003 (patch)
tree22a5e599efa77abdfa3dbd3043387f6c15e25dc6 /crates/ra_hir_def
parent1dba84019e0f3e7175f204624629a52013332e52 (diff)
parent4461796f33d3d50de4d704a76fae6fa3cb2b73aa (diff)
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<(), _> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` https://github.com/rust-lang/log/issues/397 Co-authored-by: David Tolnay <[email protected]>
Diffstat (limited to 'crates/ra_hir_def')
-rw-r--r--crates/ra_hir_def/src/path.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/path.rs b/crates/ra_hir_def/src/path.rs
index e84efe2ab..4512448e0 100644
--- a/crates/ra_hir_def/src/path.rs
+++ b/crates/ra_hir_def/src/path.rs
@@ -273,7 +273,7 @@ impl From<Name> for ModPath {
273impl Display for ModPath { 273impl Display for ModPath {
274 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 274 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
275 let mut first_segment = true; 275 let mut first_segment = true;
276 let mut add_segment = |s| { 276 let mut add_segment = |s| -> fmt::Result {
277 if !first_segment { 277 if !first_segment {
278 f.write_str("::")?; 278 f.write_str("::")?;
279 } 279 }