Florian Diebold
05eba0db3d
Binders::subst -> substitute
2021-04-05 19:20:28 +02:00
Florian Diebold
ad20f00844
Use VariableKinds in Binders
2021-04-05 19:19:18 +02:00
Florian Diebold
69714d36e6
Hide Binders internals more
2021-04-05 19:19:18 +02:00
Laurențiu Nicola
d7546d8c23
Pass interner to TraitRef::self_type_parameter
2021-04-05 17:38:37 +03:00
Laurențiu Nicola
aefcbf2758
Pass interner to ProjectionTy::self_type_parameter
2021-04-05 17:37:24 +03:00
Laurențiu Nicola
72c54c53cd
Rename TyKind::ForeignType to Foreign
2021-04-05 15:39:06 +03:00
Laurențiu Nicola
65c2e51940
Rename TyKind::Unknown to Error
2021-04-05 15:39:06 +03:00
Florian Diebold
645a9c3a27
Move things from traits
module to types
as well
2021-04-04 20:27:40 +02:00
Florian Diebold
508a1ecad3
Move things in hir_ty into submodules
...
- all the types that will be replaced by Chalk go to `types`
- `TypeWalk` impls go to `walk`
2021-04-04 20:22:00 +02:00
Florian Diebold
ebdfc932e7
Replace Substitution::type_params
2021-04-04 13:16:39 +02:00
Florian Diebold
a4d7bdf1c8
Replace Substitution::bound_vars and ::type_params_for_generics
2021-04-04 13:16:39 +02:00
Florian Diebold
715c178f0b
Move TyBuilder to its own module
2021-04-04 13:16:39 +02:00
Florian Diebold
584d1c9e5b
Replace last uses of SubstsBuilder by TyBuilder
2021-04-04 13:16:39 +02:00
Florian Diebold
505ca65216
Remove CallableSig::from_substs
2021-04-04 13:16:39 +02:00
Florian Diebold
eaa03ef446
Some more TyBuilder use
2021-04-04 13:16:38 +02:00
Florian Diebold
5d2b488aeb
Replace remaining uses of Substitution::build_for_def
2021-04-04 13:16:38 +02:00
Florian Diebold
cd227f581e
Add and start using TraitRef and ProjectionTy builders
2021-04-04 13:16:38 +02:00
Florian Diebold
2ead65190e
Move Ty::builtin to TyBuilder
2021-04-04 13:16:38 +02:00
Florian Diebold
620769f322
Add TyBuilder::adt
2021-04-04 13:16:38 +02:00
Florian Diebold
e6f007d9a8
Move Ty::fn_ptr to TyBuilder
2021-04-04 13:16:38 +02:00
Florian Diebold
b0fe3d929f
Add TyBuilder::unit() and TyExt::is_unit()
2021-04-04 13:16:38 +02:00
Florian Diebold
b15152c430
Add TyBuilder
2021-04-04 13:16:38 +02:00
Florian Diebold
c551604b5a
Rename Ty::interned to Ty::kind
...
... since that's the actual method on Chalk side that matches the signature.
2021-04-03 13:08:29 +02:00
Florian Diebold
e480d81988
Introduce GenericArg
like in Chalk
...
Plus some more adaptations to Substitution.
Lots of `assert_ty_ref` that we should revisit when introducing
lifetime/const parameters.
2021-04-03 11:17:13 +02:00
Josh Mcguigan
957939292e
completion relevance consider if types can be unified
2021-03-26 09:11:50 -07:00
Florian Diebold
b4c20e3589
Fix chalk_ir assertion
...
Fixes #8150 .
2021-03-24 23:10:13 +01:00
Florian Diebold
f7be314579
Align Canonical more with Chalk's version
...
In particular, use chalk_ir::CanonicalVarKinds.
2021-03-21 20:05:38 +01:00
Florian Diebold
1d5c4a77fb
Use QuantifiedWhereClause in generic_predicates as well
...
Still far too much binder skipping going on; I find it hard to imagine
this is all correct, but the tests pass.
2021-03-21 18:01:14 +01:00
Florian Diebold
590c416359
Introduce QuantifiedWhereClause and DynTy analogous to Chalk
...
This introduces a bunch of new binders in lots of places, which we have
to be careful about, but we had to add them at some point.
2021-03-21 18:01:14 +01:00
Florian Diebold
d8f8b495ad
Ignore type bindings in generic_predicates_for_param
...
This allows us to handle more cases without a query cycle, which
includes certain cases that rustc accepted. That in turn means we avoid
triggering salsa-rs/salsa#257 on valid code (it will still happen if the
user writes an actual cycle).
We actually accept more definitions than rustc now; that's because rustc
only ignores bindings when looking up super traits, whereas we now also
ignore them when looking for predicates to disambiguate associated type
shorthand. We could introduce a separate query for super traits if
necessary, but for now I think this should be fine.
2021-03-21 15:29:03 +01:00
Florian Diebold
0623bb4d71
Test for a Salsa bug
2021-03-21 13:33:06 +01:00
Florian Diebold
7ec3b66f7a
Turn Obligation into something similar to chalk_ir::DomainGoal
...
This includes starting to make use of Chalk's `Cast` trait.
2021-03-20 12:47:12 +01:00
Florian Diebold
8e7e405f6a
Remove WhereClause::Error
...
Chalk doesn't have it, and judging from the removed code, it wasn't
useful anyway.
2021-03-20 10:51:00 +01:00
Florian Diebold
7a5fb37cf1
Rename GenericPredicate -> WhereClause
2021-03-20 10:46:36 +01:00
Lukas Wirth
8996b1a235
Replace Projection variant in GenericPredicate with AliasEq
2021-03-19 12:12:18 +01:00
Florian Diebold
7a7e47eab7
Chalkify TraitRef
2021-03-18 21:53:19 +01:00
Florian Diebold
ce2cae45b5
Rename Substs -> Substitution
2021-03-16 17:58:17 +01:00
Florian Diebold
455e755bb0
Use SmallVec for Substs
...
Doesn't help as much as I hoped, but it helps a bit and I also did some
refactorings that were necessary anyway.
2021-03-15 19:48:03 +01:00
Florian Diebold
42217738e0
Don't use Substs for Ref/Raw/Array/Slice
2021-03-14 20:21:05 +01:00
Florian Diebold
af466f8542
Make Ty wrap TyKind in an Arc
...
... like it will be in Chalk. We still keep `interned_mut` and
`into_inner` methods that will probably not exist with Chalk.
This worsens performance slightly (5ginstr inference on RA), but doesn't
include other simplifications we can do yet.
2021-03-14 17:31:08 +01:00
Florian Diebold
1954147834
More renaming
2021-03-14 16:33:27 +01:00
Florian Diebold
eea777c714
Use chalk_ir::FnSig
2021-03-14 16:30:43 +01:00
Florian Diebold
3411fe3e84
Rename some fields to their Chalk names
2021-03-14 16:30:43 +01:00
Florian Diebold
b035c314b4
Use chalk_ir::OpaqueTyId
2021-03-13 20:05:47 +01:00
Florian Diebold
1bf6b7360c
Use chalk_ir::PlaceholderIndex
2021-03-13 19:47:34 +01:00
Florian Diebold
2d69eb131f
Use chalk_ir::ClosureId
2021-03-13 19:27:09 +01:00
Florian Diebold
9719ce9fc7
Use chalk_ir::FnDefId
2021-03-13 17:56:48 +01:00
Florian Diebold
19664e276a
Use chalk_ir::AssocTypeId
2021-03-13 17:56:48 +01:00
Florian Diebold
dfafcd926a
Use chalk_ir::ForeignDefId
2021-03-13 17:56:48 +01:00
Florian Diebold
6c32bbf3ca
Separate Ty
and TyKind
like in Chalk
...
Currently `Ty` just wraps `TyKind`, but this allows us to change most
places to already use `intern` / `interned`.
2021-03-13 16:17:15 +01:00
Lukas Wirth
50e01d2bc7
Use chalk_ir::AdtId
2021-03-04 19:38:02 +01:00
Lukas Wirth
7072f59fc6
Use chalk_ir::Mutability
2021-03-01 19:57:36 +01:00
Lukas Wirth
5d121cdb45
Introduce Ty::Alias
2021-03-01 14:24:00 +01:00
Lukas Wirth
4b7fc69315
Assert index relationship between type_variable_table and var_unification_table
2021-03-01 13:54:17 +01:00
Lukas Wirth
11a1f13cd1
Being Ty::InferenceVar closes to chalk equivalent
2021-03-01 12:41:29 +01:00
Lukas Wirth
407196b8c0
Lift FnPointer into a struct
2021-02-28 23:53:21 +01:00
Lukas Wirth
a3fd2faba5
Remove Substs from Ty::ForeignType
2021-02-28 20:44:09 +01:00
Lukas Wirth
0e995adcf6
Turn Ty::Tuple variant into a tuple-variant
2021-02-28 20:39:43 +01:00
Lukas Wirth
faf2dd49e4
Fix code_model::Type::walk not walking all types
2021-02-28 20:15:56 +01:00
Lukas Wirth
a3f5491a1a
Inline TypeCtor into Ty
2021-02-28 19:13:37 +01:00
Lukas Wirth
7c2dd85a32
Use chalk_ir::Scalar directly
2021-02-28 11:06:37 +01:00
Lukas Wirth
5183c9f083
Introduce TypeCtor::Scalar
2021-02-28 01:20:04 +01:00
Jonas Schievink
216dc856c5
Wrap BuiltinType
in code model
2021-02-11 19:52:33 +01:00
Lukas Wirth
426ad8e165
Classify function calls as functions when shadowed by types
2021-01-28 19:08:55 +01:00
Jonas Schievink
3de8f57c51
Make ModuleId
's krate
field private
2021-01-22 18:09:55 +01:00
Florian Diebold
29acd39800
Don't emit arg count diagnostics for method calls with unknown receiver
...
Fixes #7098 .
2021-01-01 20:49:18 +01:00
Lukas Wirth
11f8664182
Add Lifetimes to the HIR
2020-12-12 00:56:52 +01:00
Aleksey Kladov
b610118453
Deny unreachable-pub
...
It's very useful when `pub` is equivalent to "this is crate's public
API", let's enforce this!
Ideally, we should enforce it for local `cargo test`, and only during
CI, but that needs https://github.com/rust-lang/cargo/issues/5034 .
2020-11-02 14:07:08 +01:00
Charles Lew
b302f69b7c
Update chalk to 0.27 and adapt to chalk changes.
2020-09-15 22:37:05 +08:00
oxalica
529c369c9b
Fix type walking about type of async block
2020-09-12 01:08:50 +08:00
oxalica
251ef93ac3
Implement async blocks
2020-09-10 20:01:23 +08:00
Aleksey Kladov
6a77ec7bbe
Rename ra_hir_ty -> hir_ty
2020-08-13 16:35:29 +02:00