Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix a common false-positive type mismatch | Florian Diebold | 2020-02-29 | 1 | -4/+4 |
| | | | | | | | | | E.g. for `&{ some_string() }` in a context where a `&str` is expected, we reported a mismatch inside the block. The problem is that we're passing an expectation of `str` down, but the expectation is more of a hint in this case. There's a long comment in rustc about this, which I just copied. Also, fix reported location for type mismatches in macros. | ||||
* | Fix handling of binders in canonicalization | Florian Diebold | 2020-02-22 | 1 | -64/+35 |
| | | | | I'm looking forward to getting rid of this in favor of Chalk's implementation. | ||||
* | Implement unsize coercion using proper trait solving | Florian Diebold | 2020-02-22 | 1 | -179/+26 |
| | |||||
* | Fix handling of const patterns | Florian Diebold | 2020-02-21 | 1 | -1/+3 |
| | | | | | | | | | E.g. in `match x { None => ... }`, `None` is a path pattern (resolving to the option variant), not a binding. To determine this, we need to try to resolve the name during lowering. This isn't too hard since we already need to resolve names for macro expansion anyway (though maybe a bit hacky). Fixes #1618. | ||||
* | Normalize associated types in types coming from Chalk | Florian Diebold | 2020-02-21 | 1 | -1/+4 |
| | | | | Fixes #3232. | ||||
* | More manual clippy fixes | Kirill Bulatov | 2020-02-18 | 3 | -18/+10 |
| | |||||
* | Run cargo +nightly fix --clippy -Z unstable-options | Kirill Bulatov | 2020-02-18 | 4 | -42/+35 |
| | |||||
* | Fix coercion of &T to itself | Florian Diebold | 2020-02-16 | 1 | -0/+2 |
| | | | | | The autoderef coercion logic did not handle matching placeholders. This led to some type mismatches. | ||||
* | Don't let unknown match arms fall back to ! | Florian Diebold | 2020-02-11 | 1 | -1/+5 |
| | |||||
* | Add or- and parenthesized-patterns | Matthew Jasper | 2020-02-09 | 2 | -3/+13 |
| | |||||
* | Fix some TODOs | Florian Diebold | 2020-02-07 | 1 | -1/+0 |
| | |||||
* | Deal better with implicit type parameters and argument lists | Florian Diebold | 2020-02-07 | 1 | -3/+5 |
| | |||||
* | Formatting | Florian Diebold | 2020-02-07 | 3 | -12/+5 |
| | |||||
* | Clean up RPIT a bit | Florian Diebold | 2020-02-07 | 1 | -1/+0 |
| | |||||
* | Use variables in predicates as well | Florian Diebold | 2020-02-07 | 1 | -2/+2 |
| | |||||
* | Comment fixes / todos | Florian Diebold | 2020-02-07 | 1 | -0/+1 |
| | |||||
* | Change Ty::Param to contain param ID | Florian Diebold | 2020-02-07 | 3 | -15/+13 |
| | |||||
* | Fix another test | Florian Diebold | 2020-02-07 | 1 | -5/+1 |
| | |||||
* | Lower impl trait to variables, move away from using placeholders where they ↵ | Florian Diebold | 2020-02-07 | 2 | -41/+20 |
| | | | | don't belong | ||||
* | wip lower impl trait to type args | Florian Diebold | 2020-02-07 | 1 | -2/+2 |
| | |||||
* | Add impl trait lowering mode | Florian Diebold | 2020-02-07 | 1 | -5/+24 |
| | |||||
* | Introduce TyLoweringContext | Florian Diebold | 2020-02-07 | 1 | -14/+11 |
| | |||||
* | Fix inference for shift operators | Florian Diebold | 2020-01-17 | 1 | -2/+2 |
| | | | | Fixes #2602. | ||||
* | Push resolver further up | Aleksey Kladov | 2020-01-14 | 2 | -8/+20 |
| | |||||
* | Coerce closures to fn pointers | Florian Diebold | 2019-12-20 | 1 | -0/+4 |
| | | | | E.g. `let x: fn(A) -> B = |x| { y };` | ||||
* | Fix coercion of last expression in function body | Florian Diebold | 2019-12-20 | 1 | -1/+1 |
| | |||||
* | Handle closure return types | Florian Diebold | 2019-12-20 | 1 | -3/+14 |
| | | | | Fixes #2547. | ||||
* | Merge #2592 | bors[bot] | 2019-12-20 | 1 | -4/+8 |
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2592: Add std::ops::Index support for infering r=edwin0cheng a=edwin0cheng see also #2534 Seem like this can't fix #2534 for this case: ```rust fn foo3(bar: [usize; 2]) { let baz = bar[1]; // <--- baz is still unknown ? println!("{}", baz); } ``` Co-authored-by: Edwin Cheng <[email protected]> | ||||
| * | Add std::ops::Index support for infering | Edwin Cheng | 2019-12-19 | 1 | -4/+8 |
| | | |||||
* | | Introduce `ContainerId` | Aleksey Kladov | 2019-12-20 | 1 | -1/+1 |
| | | |||||
* | | Rename ContainerId -> AssocContainerId | Aleksey Kladov | 2019-12-20 | 2 | -6/+6 |
| | | |||||
* | | Add body as a possible container for items | Aleksey Kladov | 2019-12-19 | 1 | -1/+1 |
| | | |||||
* | | Forbid <T>::foo syntax in mod paths | Aleksey Kladov | 2019-12-18 | 1 | -2/+2 |
|/ | |||||
* | Handle impl Trait more correctly | Florian Diebold | 2019-12-15 | 1 | -0/+1 |
| | | | | | | | When calling a function, argument-position impl Trait is transparent; same for return-position impl Trait when inside the function. So in these cases, we need to represent that type not by `Ty::Opaque`, but by a type variable that can be unified with whatever flows into there. | ||||
* | Use different types for path with and without generics | Aleksey Kladov | 2019-12-14 | 1 | -12/+13 |
| | |||||
* | Rename N! to name! | Florian Diebold | 2019-12-13 | 1 | -2/+2 |
| | |||||
* | Add macros for known names and paths | Florian Diebold | 2019-12-13 | 1 | -2/+2 |
| | |||||
* | Correctly infer - and ! using std::ops::{Neg,Not} | Emil Lauridsen | 2019-12-13 | 1 | -21/+26 |
| | |||||
* | Add helper for resolving associated type of trait in infer | Emil Lauridsen | 2019-12-13 | 1 | -47/+7 |
| | |||||
* | Fix coercion from &Foo to an inference variable in a reference | Florian Diebold | 2019-12-08 | 1 | -1/+5 |
| | | | | We didn't try to unify within the reference, but we should. | ||||
* | Refactor parameter count tracking | Aleksey Kladov | 2019-12-07 | 1 | -10/+8 |
| | |||||
* | Remove idx and parent generics from generics | Aleksey Kladov | 2019-12-07 | 1 | -11/+13 |
| | | | | | This makes `hir_def::GenericParams` flatter. The logic for re-numbering the params is moved to hir instead. | ||||
* | Store GenericParams in arena | Aleksey Kladov | 2019-12-07 | 1 | -1/+1 |
| | |||||
* | Don't unify within a reference | Florian Diebold | 2019-12-06 | 1 | -11/+10 |
| | | | | | | | If we are expecting a `&Foo` and get a `&something`, when checking the `something`, we are *expecting* a `Foo`, but we shouldn't try to unify whatever we get with that expectation, because it could actually be a `&Foo`, and `&&Foo` coerces to `&Foo`. So this fixes quite a few false type mismatches. | ||||
* | Fix #2467 | Florian Diebold | 2019-12-03 | 2 | -3/+14 |
| | | | | | The stand-alone `unify` requires that the type doesn't contain any type variables. So we can't share the code here for now (without more refactoring)... | ||||
* | Refactor a bit | Florian Diebold | 2019-12-02 | 1 | -35/+3 |
| | |||||
* | Check receiver type properly | Florian Diebold | 2019-12-02 | 2 | -9/+13 |
| | |||||
* | Extract unification code to unify module | Florian Diebold | 2019-12-02 | 5 | -30/+290 |
| | |||||
* | Handle cycles in impl types better | Florian Diebold | 2019-11-30 | 2 | -6/+3 |
| | | | | | | - impl Trait<Self> for S is allowed - impl Trait for S<Self> is an invalid cycle, but we can add cycle recovery for it in Salsa now | ||||
* | Reduce variants of Expr | oxalica | 2019-11-29 | 1 | -39/+37 |
| |