diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-25 11:35:14 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-25 11:35:14 +0100 |
commit | f654f4943552888c2b8f079cf687970268d81f18 (patch) | |
tree | d0d12e63caa092d986e1ce352e6de0a2cb4cdbdd /crates/ra_hir_expand | |
parent | 29fc409e7fe5b12dcf6bfbcca622d79c4c8fcb72 (diff) | |
parent | 58dde891f87bc6131b0ef34c33f6ffb9aa0c0ec3 (diff) |
Merge #4125
4125: Avoid lossy OsString conversions r=matklad a=lnicola
This is a bit invasive, and perhaps for not much benefit since non-UTF-8 environment variables don't work anyway.
Co-authored-by: Laurențiu Nicola <[email protected]>
Diffstat (limited to 'crates/ra_hir_expand')
-rw-r--r-- | crates/ra_hir_expand/src/builtin_macro.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_hir_expand/src/builtin_macro.rs b/crates/ra_hir_expand/src/builtin_macro.rs index 2ccebda28..e0fef613d 100644 --- a/crates/ra_hir_expand/src/builtin_macro.rs +++ b/crates/ra_hir_expand/src/builtin_macro.rs | |||
@@ -358,7 +358,7 @@ fn env_expand( | |||
358 | // However, we cannot use an empty string here, because for | 358 | // However, we cannot use an empty string here, because for |
359 | // `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become | 359 | // `include!(concat!(env!("OUT_DIR"), "/foo.rs"))` will become |
360 | // `include!("foo.rs"), which might go to infinite loop | 360 | // `include!("foo.rs"), which might go to infinite loop |
361 | let s = get_env_inner(db, arg_id, &key).unwrap_or("__RA_UNIMPLEMENTATED__".to_string()); | 361 | let s = get_env_inner(db, arg_id, &key).unwrap_or_else(|| "__RA_UNIMPLEMENTATED__".to_string()); |
362 | let expanded = quote! { #s }; | 362 | let expanded = quote! { #s }; |
363 | 363 | ||
364 | Ok((expanded, FragmentKind::Expr)) | 364 | Ok((expanded, FragmentKind::Expr)) |