Skip to content

Commit 340e7ff

Browse files
committed
Only include View impls for HashMap/Set when std is enabled
1 parent b0a7da8 commit 340e7ff

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

source/rust_verify/src/spans.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ impl SpanContextX {
9393
match *source_file.external_src.borrow() {
9494
ExternalSource::Unneeded => {
9595
let filename = match &source_file.name {
96-
FileName::Real(real_file_name) => real_file_name
97-
.local_path()
98-
.map(|path| path.canonicalize().ok())
99-
.flatten(),
96+
FileName::Real(real_file_name) => {
97+
real_file_name.local_path().and_then(|path| path.canonicalize().ok())
98+
}
10099
_ => None,
101100
};
102101
let pos = FileStartEndPos {

source/vstd/view.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl<T: DeepView> DeepView for alloc::vec::Vec<T> {
134134
}
135135
}
136136

137-
#[cfg(all(feature = "alloc", any(verus_keep_ghost, feature = "allocator")))]
137+
#[cfg(all(feature = "alloc", feature = "std", any(verus_keep_ghost, feature = "allocator")))]
138138
impl<Key, Value, S, A: core::alloc::Allocator> View for std::collections::HashMap<
139139
Key,
140140
Value,
@@ -146,7 +146,7 @@ impl<Key, Value, S, A: core::alloc::Allocator> View for std::collections::HashMa
146146
uninterp spec fn view(&self) -> Map<Key, Value>;
147147
}
148148

149-
#[cfg(all(feature = "alloc", any(verus_keep_ghost, feature = "allocator")))]
149+
#[cfg(all(feature = "alloc", feature = "std", any(verus_keep_ghost, feature = "allocator")))]
150150
impl<
151151
Key: DeepView,
152152
Value: DeepView,
@@ -160,14 +160,14 @@ impl<
160160
}
161161
}
162162

163-
#[cfg(all(feature = "alloc", not(verus_keep_ghost), not(feature = "allocator")))]
163+
#[cfg(all(feature = "alloc", feature = "std", not(verus_keep_ghost), not(feature = "allocator")))]
164164
impl<Key, Value, S> View for std::collections::HashMap<Key, Value, S> {
165165
type V = Map<Key, Value>;
166166

167167
uninterp spec fn view(&self) -> Map<Key, Value>;
168168
}
169169

170-
#[cfg(all(feature = "alloc", not(verus_keep_ghost), not(feature = "allocator")))]
170+
#[cfg(all(feature = "alloc", feature = "std", not(verus_keep_ghost), not(feature = "allocator")))]
171171
impl<Key: DeepView, Value: DeepView, S> DeepView for std::collections::HashMap<Key, Value, S> {
172172
type V = Map<Key::V, Value::V>;
173173

@@ -176,14 +176,14 @@ impl<Key: DeepView, Value: DeepView, S> DeepView for std::collections::HashMap<K
176176
}
177177
}
178178

179-
#[cfg(all(feature = "alloc", any(verus_keep_ghost, feature = "allocator")))]
179+
#[cfg(all(feature = "alloc", feature = "std", any(verus_keep_ghost, feature = "allocator")))]
180180
impl<Key, S, A: core::alloc::Allocator> View for std::collections::HashSet<Key, S, A> {
181181
type V = Set<Key>;
182182

183183
uninterp spec fn view(&self) -> Set<Key>;
184184
}
185185

186-
#[cfg(all(feature = "alloc", any(verus_keep_ghost, feature = "allocator")))]
186+
#[cfg(all(feature = "alloc", feature = "std", any(verus_keep_ghost, feature = "allocator")))]
187187
impl<Key: DeepView, S, A: core::alloc::Allocator> DeepView for std::collections::HashSet<
188188
Key,
189189
S,

0 commit comments

Comments
 (0)