mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
minor: import Either
from either
This commit is contained in:
parent
f5401f6206
commit
cf0c8fe000
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -572,6 +572,7 @@ dependencies = [
|
||||
"chalk-recursive",
|
||||
"chalk-solve",
|
||||
"cov-mark",
|
||||
"either",
|
||||
"ena",
|
||||
"expect-test",
|
||||
"hir-def",
|
||||
@ -1714,6 +1715,7 @@ name = "syntax"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cov-mark",
|
||||
"either",
|
||||
"expect-test",
|
||||
"indexmap",
|
||||
"itertools",
|
||||
|
@ -18,6 +18,7 @@ arrayvec = "0.7.2"
|
||||
bitflags = "1.3.2"
|
||||
smallvec.workspace = true
|
||||
ena = "0.14.0"
|
||||
either = "1.7.0"
|
||||
tracing = "0.1.35"
|
||||
rustc-hash = "1.1.0"
|
||||
scoped-tls = "1.0.0"
|
||||
|
@ -5,11 +5,11 @@
|
||||
use std::fmt;
|
||||
use std::sync::Arc;
|
||||
|
||||
use either::Either;
|
||||
use hir_def::lang_item::LangItem;
|
||||
use hir_def::{resolver::HasResolver, AdtId, AssocItemId, DefWithBodyId, HasModule};
|
||||
use hir_def::{ItemContainerId, Lookup};
|
||||
use hir_expand::name;
|
||||
use itertools::Either;
|
||||
use itertools::Itertools;
|
||||
use rustc_hash::FxHashSet;
|
||||
use typed_arena::Arena;
|
||||
|
@ -17,6 +17,7 @@ use std::ops::Index;
|
||||
use std::sync::Arc;
|
||||
|
||||
use chalk_ir::{cast::Cast, ConstValue, DebruijnIndex, Mutability, Safety, Scalar, TypeFlags};
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
body::Body,
|
||||
builtin_type::{BuiltinInt, BuiltinType, BuiltinUint},
|
||||
@ -31,7 +32,6 @@ use hir_def::{
|
||||
ItemContainerId, Lookup, TraitId, TypeAliasId, VariantId,
|
||||
};
|
||||
use hir_expand::name::name;
|
||||
use itertools::Either;
|
||||
use la_arena::ArenaMap;
|
||||
use rustc_hash::FxHashMap;
|
||||
use stdx::always;
|
||||
|
@ -42,9 +42,9 @@ use chalk_ir::{
|
||||
visit::{TypeSuperVisitable, TypeVisitable, TypeVisitor},
|
||||
NoSolution, TyData,
|
||||
};
|
||||
use either::Either;
|
||||
use hir_def::{expr::ExprId, type_ref::Rawness, TypeOrConstParamId};
|
||||
use hir_expand::name;
|
||||
use itertools::Either;
|
||||
use la_arena::{Arena, Idx};
|
||||
use rustc_hash::FxHashSet;
|
||||
use traits::FnTrait;
|
||||
|
@ -16,6 +16,7 @@ use chalk_ir::{
|
||||
cast::Cast, fold::Shift, fold::TypeFoldable, interner::HasInterner, Mutability, Safety,
|
||||
};
|
||||
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
adt::StructKind,
|
||||
body::{Expander, LowerCtx},
|
||||
@ -35,7 +36,6 @@ use hir_def::{
|
||||
};
|
||||
use hir_expand::{name::Name, ExpandResult};
|
||||
use intern::Interned;
|
||||
use itertools::Either;
|
||||
use la_arena::{Arena, ArenaMap};
|
||||
use rustc_hash::FxHashSet;
|
||||
use smallvec::SmallVec;
|
||||
@ -1583,10 +1583,10 @@ pub(crate) fn generic_defaults_recover(
|
||||
.iter_id()
|
||||
.map(|id| {
|
||||
let val = match id {
|
||||
itertools::Either::Left(_) => {
|
||||
Either::Left(_) => {
|
||||
GenericArgData::Ty(TyKind::Error.intern(Interner)).intern(Interner)
|
||||
}
|
||||
itertools::Either::Right(id) => unknown_const_as_generic(db.const_param_ty(id)),
|
||||
Either::Right(id) => unknown_const_as_generic(db.const_param_ty(id)),
|
||||
};
|
||||
crate::make_binders(db, &generic_params, val)
|
||||
})
|
||||
|
@ -5,6 +5,7 @@ use std::iter;
|
||||
|
||||
use base_db::CrateId;
|
||||
use chalk_ir::{cast::Cast, fold::Shift, BoundVar, DebruijnIndex};
|
||||
use either::Either;
|
||||
use hir_def::{
|
||||
db::DefDatabase,
|
||||
generics::{
|
||||
@ -19,7 +20,6 @@ use hir_def::{
|
||||
};
|
||||
use hir_expand::name::Name;
|
||||
use intern::Interned;
|
||||
use itertools::Either;
|
||||
use rustc_hash::FxHashSet;
|
||||
use smallvec::{smallvec, SmallVec};
|
||||
|
||||
|
@ -14,6 +14,7 @@ doctest = false
|
||||
|
||||
[dependencies]
|
||||
cov-mark = "2.0.0-pre.1"
|
||||
either = "1.7.0"
|
||||
itertools = "0.10.5"
|
||||
rowan = "0.15.10"
|
||||
rustc_lexer = { version = "727.0.0", package = "rustc-ap-rustc_lexer" }
|
||||
|
@ -13,7 +13,7 @@ pub mod prec;
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use itertools::Either;
|
||||
use either::Either;
|
||||
|
||||
use crate::{
|
||||
syntax_node::{SyntaxNode, SyntaxNodeChildren, SyntaxToken},
|
||||
|
@ -1,7 +1,7 @@
|
||||
//! Various traits that are implemented by ast nodes.
|
||||
//!
|
||||
//! The implementations are usually trivial, and live in generated.rs
|
||||
use itertools::Either;
|
||||
use either::Either;
|
||||
|
||||
use crate::{
|
||||
ast::{self, support, AstChildren, AstNode, AstToken},
|
||||
|
Loading…
Reference in New Issue
Block a user