Skip to content

Commit a300cab

Browse files
committed
Revert the introduced typedefs
1 parent 5d2be7d commit a300cab

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/librustc/hir/mod.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2506,16 +2506,13 @@ pub type FreevarMap = NodeMap<Vec<Freevar<ast::NodeId>>>;
25062506

25072507
pub type CaptureModeMap = NodeMap<CaptureClause>;
25082508

2509-
pub type SmallHirIdVec = SmallVec<[HirId;1]>;
2510-
pub type SmallNodeIdVec = SmallVec<[NodeId;1]>;
2511-
25122509
// The TraitCandidate's import_ids is empty if the trait is defined in the same module, and
25132510
// has length > 0 if the trait is found through an chain of imports, starting with the
25142511
// import/use statement in the scope where the trait is used.
25152512
#[derive(Clone, Debug)]
25162513
pub struct TraitCandidate {
25172514
pub def_id: DefId,
2518-
pub import_ids: SmallNodeIdVec,
2515+
pub import_ids: SmallVec<[NodeId; 1]>,
25192516
}
25202517

25212518
// Trait method resolution

src/librustc_resolve/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use rustc::hir::def::{
2929
};
3030
use rustc::hir::def::Namespace::*;
3131
use rustc::hir::def_id::{CRATE_DEF_INDEX, LOCAL_CRATE, DefId};
32-
use rustc::hir::{Freevar, FreevarMap, TraitCandidate, TraitMap, GlobMap, SmallNodeIdVec};
32+
use rustc::hir::{Freevar, FreevarMap, TraitCandidate, TraitMap, GlobMap};
3333
use rustc::ty::{self, DefIdTree};
3434
use rustc::util::nodemap::{NodeMap, NodeSet, FxHashMap, FxHashSet, DefIdMap};
3535
use rustc::{bug, span_bug};
@@ -67,6 +67,7 @@ use std::collections::BTreeSet;
6767
use std::mem::replace;
6868
use rustc_data_structures::ptr_key::PtrKey;
6969
use rustc_data_structures::sync::Lrc;
70+
use smallvec::SmallVec;
7071

7172
use diagnostics::{find_span_of_binding_until_next_binding, extend_span_to_previous_binding};
7273
use resolve_imports::{ImportDirective, ImportDirectiveSubclass, NameResolution, ImportResolver};
@@ -4658,10 +4659,9 @@ impl<'a> Resolver<'a> {
46584659
}
46594660
}
46604661

4661-
fn find_transitive_imports(&mut self, kind: &NameBindingKind<'_>,
4662-
trait_name: &Ident) -> SmallNodeIdVec {
4662+
fn find_transitive_imports(&mut self, mut kind: &NameBindingKind<'_>,
4663+
trait_name: &Ident) -> SmallVec<[NodeId; 1]> {
46634664
let mut import_ids = smallvec![];
4664-
let mut kind = kind;
46654665
while let NameBindingKind::Import { directive, binding, .. } = *kind {
46664666
self.maybe_unused_trait_imports.insert(directive.id);
46674667
self.add_to_glob_map(&directive, *trait_name);

src/librustc_typeck/check/method/probe.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use crate::check::autoderef::{self, Autoderef};
77
use crate::check::FnCtxt;
88
use crate::hir::def_id::DefId;
99
use crate::hir::def::DefKind;
10-
use crate::hir::SmallHirIdVec;
1110
use crate::namespace::Namespace;
1211

1312
use rustc_data_structures::sync::Lrc;
@@ -36,7 +35,7 @@ use std::mem;
3635
use std::ops::Deref;
3736
use std::cmp::max;
3837

39-
use smallvec::smallvec;
38+
use smallvec::{smallvec, SmallVec};
4039

4140
use self::CandidateKind::*;
4241
pub use self::PickKind::*;
@@ -124,7 +123,7 @@ struct Candidate<'tcx> {
124123
xform_ret_ty: Option<Ty<'tcx>>,
125124
item: ty::AssociatedItem,
126125
kind: CandidateKind<'tcx>,
127-
import_ids: SmallHirIdVec,
126+
import_ids: SmallVec<[hir::HirId; 1]>,
128127
}
129128

130129
#[derive(Debug)]
@@ -149,7 +148,7 @@ enum ProbeResult {
149148
pub struct Pick<'tcx> {
150149
pub item: ty::AssociatedItem,
151150
pub kind: PickKind<'tcx>,
152-
pub import_ids: hir::SmallHirIdVec,
151+
pub import_ids: SmallVec<[hir::HirId; 1]>,
153152

154153
// Indicates that the source expression should be autoderef'd N times
155154
//
@@ -894,7 +893,7 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> {
894893
}
895894

896895
fn assemble_extension_candidates_for_trait(&mut self,
897-
import_ids: SmallHirIdVec,
896+
import_ids: SmallVec<[hir::HirId; 1]>,
898897
trait_def_id: DefId)
899898
-> Result<(), MethodError<'tcx>> {
900899
debug!("assemble_extension_candidates_for_trait(trait_def_id={:?})",

0 commit comments

Comments
 (0)