mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
Merge #787
787: rename combine -> or r=matklad a=matklad Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
commit
6596793c0c
@ -135,7 +135,7 @@ impl<T> PerNs<T> {
|
||||
PerNs { types: self.types.as_ref(), values: self.values.as_ref() }
|
||||
}
|
||||
|
||||
pub fn combine(self, other: PerNs<T>) -> PerNs<T> {
|
||||
pub fn or(self, other: PerNs<T>) -> PerNs<T> {
|
||||
PerNs { types: self.types.or(other.types), values: self.values.or(other.values) }
|
||||
}
|
||||
|
||||
@ -439,7 +439,7 @@ impl ItemMap {
|
||||
let from_extern_prelude =
|
||||
self.extern_prelude.get(name).map_or(PerNs::none(), |&it| PerNs::types(it));
|
||||
|
||||
from_scope.combine(from_extern_prelude)
|
||||
from_scope.or(from_extern_prelude)
|
||||
}
|
||||
|
||||
// Returns Yes if we are sure that additions to `ItemMap` wouldn't change
|
||||
|
@ -59,7 +59,7 @@ impl Resolver {
|
||||
pub fn resolve_name(&self, name: &Name) -> PerNs<Resolution> {
|
||||
let mut resolution = PerNs::none();
|
||||
for scope in self.scopes.iter().rev() {
|
||||
resolution = resolution.combine(scope.resolve_name(name));
|
||||
resolution = resolution.or(scope.resolve_name(name));
|
||||
if resolution.is_both() {
|
||||
return resolution;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user