Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Resolve trait associated items | Florian Diebold | 2019-09-25 | 1 | -1/+1 |
| | | | | E.g. `Default::default` or `<Foo as Default>::default`. | ||||
* | Handle associated type shorthand (`T::Item`) | Florian Diebold | 2019-09-22 | 1 | -9/+88 |
| | | | | | | | | | | | | This is only allowed for generic parameters (including `Self` in traits), and special care needs to be taken to not run into cycles while resolving it, because we use the where clauses of the generic parameter to find candidates for the trait containing the associated type, but the where clauses may themselves contain instances of short-hand associated types. In some cases this is even fine, e.g. we might have `T: Trait<U::Item>, U: Iterator`. If there is a cycle, we'll currently panic, which isn't great, but better than overflowing the stack... | ||||
* | Remove assoc type selection code for now to fix crashes | Florian Diebold | 2019-09-17 | 1 | -19/+4 |
| | |||||
* | Small review improvements | Florian Diebold | 2019-09-17 | 1 | -5/+3 |
| | |||||
* | Refactor some more | Florian Diebold | 2019-09-17 | 1 | -10/+24 |
| | | | | | | Type-relative paths (`<T>::foo`) also need to work in type context, for example `<T>::Item` is legal. So rather than returning the type ref from the resolver function, just check it before. | ||||
* | Refactor associated item resolution more | Florian Diebold | 2019-09-17 | 1 | -53/+66 |
| | | | | | When resolving an associated item in value namespace, use the `Ty` lowering code for the segments before the last instead of replicating it. | ||||
* | Resolve assoc types on type parameters | Florian Diebold | 2019-09-17 | 1 | -21/+58 |
| | | | | | | E.g. `fn foo<T: Iterator>() -> T::Item`. It seems that rustc does this only for type parameters and only based on their bounds, so we also only consider traits from bounds. | ||||
* | Support bare `Trait` without dyn | Florian Diebold | 2019-09-14 | 1 | -2/+1 |
| | |||||
* | Specify desirable namespace when calling resolve | Aleksey Kladov | 2019-09-13 | 1 | -55/+53 |
| | | | | That way, we are able to get rid of a number of unreachable statements | ||||
* | rename AdtDef -> Adt | Aleksey Kladov | 2019-09-12 | 1 | -13/+11 |
| | |||||
* | generalize impl_froms to nested enums | Aleksey Kladov | 2019-09-12 | 1 | -19/+9 |
| | |||||
* | make various enums "inherit" from AdtDef | Aleksey Kladov | 2019-09-12 | 1 | -29/+29 |
| | |||||
* | start cleaning up the resolution | Aleksey Kladov | 2019-09-12 | 1 | -1/+1 |
| | | | | | | | Nameres related types, like `PerNs<Resolution>`, can represent unreasonable situations, like a local in a type namespace. We should clean this up, by requiring that call-site specifies the kind of resolution it expects. | ||||
* | cleanup hir db imports | Aleksey Kladov | 2019-09-08 | 1 | -2/+3 |
| | |||||
* | Lower bounds on trait definition, and resolve assoc types from super traits | Florian Diebold | 2019-09-07 | 1 | -12/+15 |
| | |||||
* | Make type walking infrastructure a bit nicer | Florian Diebold | 2019-09-03 | 1 | -0/+1 |
| | | | | | If/when we switch to using Chalk's Ty, we'll need to replace this by its `Fold` trait, but I didn't want to import the whole thing just yet. | ||||
* | Add support for associated type bindings (`where Trait<Type = X>`) | Florian Diebold | 2019-09-03 | 1 | -28/+57 |
| | |||||
* | Add `impl Trait` and `dyn Trait` types | Florian Diebold | 2019-08-22 | 1 | -11/+54 |
| | | | | | | | - refactor bounds handling in the AST a bit - add HIR for bounds - add `Ty::Dyn` and `Ty::Opaque` variants and lower `dyn Trait` / `impl Trait` syntax to them | ||||
* | Normalize associated types during inference | Florian Diebold | 2019-08-12 | 1 | -5/+0 |
| | |||||
* | Lower fully qualified associated type paths | Florian Diebold | 2019-08-12 | 1 | -15/+73 |
| | | | | I.e. `<T as Trait>::Foo`. | ||||
* | Some renamings for clarity | Florian Diebold | 2019-07-14 | 1 | -2/+5 |
| | |||||
* | Start handling environment in trait resolution | Florian Diebold | 2019-07-08 | 1 | -0/+12 |
| | | | | | I.e. if we are inside a function with some where clauses, we assume these where clauses hold. | ||||
* | Make EnumVariant a GenericDef and simplify some code | Florian Diebold | 2019-07-06 | 1 | -0/+10 |
| | |||||
* | Add trait obligations for where clauses when calling functions/methods | Florian Diebold | 2019-07-06 | 1 | -6/+4 |
| | | | | | E.g. if we call `foo<T: Into<u32>>(x)`, that adds an obligation that `x: Into<u32>`, etc. | ||||
* | allow rustfmt to reorder imports | Aleksey Kladov | 2019-07-04 | 1 | -11/+10 |
| | | | | | | This wasn't a right decision in the first place, the feature flag was broken in the last rustfmt release, and syntax highlighting of imports is more important anyway | ||||
* | rename XSignature -> XData | Aleksey Kladov | 2019-06-18 | 1 | -8/+7 |
| | |||||
* | Add basic infrastructure for assoc type projection | Florian Diebold | 2019-06-15 | 1 | -1/+1 |
| | |||||
* | somewhat better name | Aleksey Kladov | 2019-06-08 | 1 | -2/+2 |
| | |||||
* | add tests for primitive types | Aleksey Kladov | 2019-05-30 | 1 | -2/+1 |
| | |||||
* | add built-in types to scopes | Aleksey Kladov | 2019-05-30 | 1 | -16/+0 |
| | |||||
* | add ModuleDef::BuiltInType | Aleksey Kladov | 2019-05-30 | 1 | -5/+31 |
| | |||||
* | add union to code_model | Aleksey Kladov | 2019-05-23 | 1 | -2/+8 |
| | |||||
* | remove minor code duplication | Aleksey Kladov | 2019-05-20 | 1 | -18/+14 |
| | |||||
* | Use normal iteration instead of walk_mut | Edwin Cheng | 2019-05-20 | 1 | -8/+5 |
| | |||||
* | Add infer for generic default type | Edwin Cheng | 2019-05-19 | 1 | -13/+46 |
| | |||||
* | Handle where clauses in trait solving | Florian Diebold | 2019-05-11 | 1 | -8/+45 |
| | |||||
* | Differentiate Tuple / FnPtr type constructors by cardinality | Florian Diebold | 2019-05-04 | 1 | -2/+5 |
| | | | | | This is necessary because Chalk (reasonably) expects each 'struct' to know how many type parameters it takes. | ||||
* | Chalk integration | Florian Diebold | 2019-05-04 | 1 | -18/+12 |
| | | | | | - add proper canonicalization logic - add conversions from/to Chalk IR | ||||
* | Extract generic_params method to a HasGenericParams trait | Florian Diebold | 2019-04-14 | 1 | -2/+2 |
| | |||||
* | Some cleanup | Florian Diebold | 2019-04-14 | 1 | -2/+5 |
| | |||||
* | More trait infrastructure | Florian Diebold | 2019-04-14 | 1 | -1/+8 |
| | | | | | | | | | | - make it possible to get parent trait from method - add 'obligation' machinery for checking that a type implements a trait (and inferring facts about type variables from that) - handle type parameters of traits (to a certain degree) - improve the hacky implements check to cover enough cases to exercise the handling of traits with type parameters - basic canonicalization (will probably also be done by Chalk) | ||||
* | Get substs for trait refs in impl blocks | Florian Diebold | 2019-04-14 | 1 | -25/+70 |
| | |||||
* | replace todo with fixme | Aleksey Kladov | 2019-03-23 | 1 | -3/+3 |
| | |||||
* | Refactor primitive types into more orthogonal representation | yanchith | 2019-03-22 | 1 | -4/+4 |
| | |||||
* | TypeName => TypeCtor | Florian Diebold | 2019-03-21 | 1 | -18/+18 |
| | |||||
* | Remove the old variants replaced by Ty::Apply | Florian Diebold | 2019-03-21 | 1 | -20/+18 |
| | |||||
* | Represent FnPtr and Tuple using Substs | Florian Diebold | 2019-03-21 | 1 | -2/+2 |
| | |||||
* | make Name::new private | Aleksey Kladov | 2019-03-20 | 1 | -2/+2 |
| | |||||
* | Remove FnSig from FnDef type | Florian Diebold | 2019-03-16 | 1 | -6/+12 |
| | | | | | It doesn't need to be in there since it's just information from the def. Another step towards aligning Ty with Chalk's representation. | ||||
* | Refactor FnSig a bit | Florian Diebold | 2019-03-16 | 1 | -25/+45 |
| |