diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-11 16:30:05 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-11 16:30:05 +0100 |
commit | bd61ad756cc0a7bfeaa5dae81ac5ab50a2e71697 (patch) | |
tree | 382ff970758f62c2d4322c6daf2071b8543133f0 /crates/ra_hir_def/src | |
parent | 7c617000b832354ea405a9543276505c1c7e6a0a (diff) | |
parent | 215e229dd1a495cda6541371c75145ba03f62de5 (diff) |
Merge #4849
4849: Make known paths use `core` instead of `std` r=matklad a=jonas-schievink
I'm not sure if this causes problems today, but it seems like it easily could, if rust-analyzer processes the libstd sources for the right `--target` and that target is a `#![no_std]`-only target.
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r-- | crates/ra_hir_def/src/data.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir_def/src/path.rs | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/crates/ra_hir_def/src/data.rs b/crates/ra_hir_def/src/data.rs index 807195d25..53599e74a 100644 --- a/crates/ra_hir_def/src/data.rs +++ b/crates/ra_hir_def/src/data.rs | |||
@@ -99,7 +99,7 @@ impl FunctionData { | |||
99 | } | 99 | } |
100 | 100 | ||
101 | fn desugar_future_path(orig: TypeRef) -> Path { | 101 | fn desugar_future_path(orig: TypeRef) -> Path { |
102 | let path = path![std::future::Future]; | 102 | let path = path![core::future::Future]; |
103 | let mut generic_args: Vec<_> = std::iter::repeat(None).take(path.segments.len() - 1).collect(); | 103 | let mut generic_args: Vec<_> = std::iter::repeat(None).take(path.segments.len() - 1).collect(); |
104 | let mut last = GenericArgs::empty(); | 104 | let mut last = GenericArgs::empty(); |
105 | last.bindings.push(AssociatedTypeBinding { | 105 | last.bindings.push(AssociatedTypeBinding { |
diff --git a/crates/ra_hir_def/src/path.rs b/crates/ra_hir_def/src/path.rs index bfa921de2..ba16442bd 100644 --- a/crates/ra_hir_def/src/path.rs +++ b/crates/ra_hir_def/src/path.rs | |||
@@ -323,16 +323,16 @@ pub use hir_expand::name as __name; | |||
323 | 323 | ||
324 | #[macro_export] | 324 | #[macro_export] |
325 | macro_rules! __known_path { | 325 | macro_rules! __known_path { |
326 | (std::iter::IntoIterator) => {}; | 326 | (core::iter::IntoIterator) => {}; |
327 | (std::result::Result) => {}; | 327 | (core::result::Result) => {}; |
328 | (std::ops::Range) => {}; | 328 | (core::ops::Range) => {}; |
329 | (std::ops::RangeFrom) => {}; | 329 | (core::ops::RangeFrom) => {}; |
330 | (std::ops::RangeFull) => {}; | 330 | (core::ops::RangeFull) => {}; |
331 | (std::ops::RangeTo) => {}; | 331 | (core::ops::RangeTo) => {}; |
332 | (std::ops::RangeToInclusive) => {}; | 332 | (core::ops::RangeToInclusive) => {}; |
333 | (std::ops::RangeInclusive) => {}; | 333 | (core::ops::RangeInclusive) => {}; |
334 | (std::future::Future) => {}; | 334 | (core::future::Future) => {}; |
335 | (std::ops::Try) => {}; | 335 | (core::ops::Try) => {}; |
336 | ($path:path) => { | 336 | ($path:path) => { |
337 | compile_error!("Please register your known path in the path module") | 337 | compile_error!("Please register your known path in the path module") |
338 | }; | 338 | }; |