aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests
Commit message (Collapse)AuthorAgeFilesLines
* Minor test fixes / new testsFlorian Diebold2021-05-251-15/+62
|
* Fix type mismatch caused by macrosFlorian Diebold2021-05-251-0/+44
| | | | | | MacroStmts should be completely transparent, but it prevented coercion. (I should maybe give `infer_expr` and `infer_expr_inner` better names.)
* Fix test after rebaseFlorian Diebold2021-05-211-1/+1
|
* Deal with goals arising from unificationFlorian Diebold2021-05-211-1/+1
|
* Get rid of resolve_ty_as_possibleFlorian Diebold2021-05-212-9/+9
| | | | Instead use shallow resolving where necessary.
* Fix handling of diverging branches in match coercionFlorian Diebold2021-05-211-0/+39
| | | | Fixes #7626.
* Fix coercion of two closures to a function pointerFlorian Diebold2021-05-212-37/+16
| | | | Fixes #8604.
* Update tests with expected changesFlorian Diebold2021-05-211-37/+34
|
* internal: Record mismatches of pattern types.Dawer2021-05-191-1/+57
|
* Merge #8813bors[bot]2021-05-164-50/+166
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8813: Get some more array lengths! r=lf- a=lf- This is built on #8799 and thus contains its changes. I'll rebase it onto master when that one gets merged. It adds support for r-a understanding the length of: * `let a: [u8; 2] = ...` * `let a = b"aaa"` * `let a = [0u8; 4]` I have added support for getting the values of byte strings, which was not previously there. I am least confident in the correctness of this part and it probably needs some more tests, as we currently have only one test that exercised that part (!). Fixes #2922. Co-authored-by: Jade <[email protected]>
| * Add more tests, refactor array lengths/consteval workJade2021-05-142-1/+106
| | | | | | | | | | | | | | | | | | | | | | Fix #2922: add unknown length as a condition for a type having unknown. Incorporate reviews: * Extract some of the const evaluation workings into functions * Add fixmes on the hacks * Add tests for impls on specific array lengths (these work!!! 😁) * Add tests for const generics (indeed we don't support it yet)
| * Test lowering byte strings some moreJade2021-05-131-14/+25
| |
| * Add support for lengths in array repeats, if they are literalsJade2021-05-131-1/+1
| | | | | | | | Now we will get the type of `[0u8; 4]`.
| * Support length for ByteStringsJade2021-05-131-2/+2
| | | | | | | | I am not confident that my added byte string parsing is right.
| * Add lowering of array lengths in typesJade2021-05-133-34/+34
| | | | | | | | | | | | | | | | | | | | | | Now e.g. ```rust fn a(b: [u8; 2]) { } ``` will know about the length of b.
* | Fix false positive "Missing match arm".Dawer2021-05-141-1/+1
|/
* Merge #8799bors[bot]2021-05-125-95/+95
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | 8799: Add basic support for array lengths in types r=flodiebold a=lf- This recognizes `let a = [1u8, 2, 3]` as having type `[u8; 3]` instead of the previous `[u8; _]`. Byte strings and `[0u8; 2]` kinds of range array declarations are unsupported as before. I don't know why a bunch of our rustc tests had single quotes inside strings un-escaped by `UPDATE_EXPECT=1 cargo t`, but I don't think it's bad? Maybe something in a nightly? Co-authored-by: Jade <[email protected]>
| * Add basic support for array lengths in typesJade2021-05-115-95/+95
| | | | | | | | | | | | | | | | | | | | This recognizes `let a = [1u8, 2, 3]` as having type `[u8; 3]` instead of the previous `[u8; _]`. Byte strings and `[0u8; 2]` kinds of range array declarations are unsupported as before. I don't know why a bunch of our rustc tests had single quotes inside strings un-escaped by `UPDATE_EXPECT=1 cargo t`, but I don't think it's bad? Maybe something in a nightly?
* | Add a test for conditionally compiled tailsDaniel McNab2021-05-031-0/+49
|/
* Don't look in super traits for <T as Trait>::AssocFlorian Diebold2021-04-291-0/+8
| | | | | | | This isn't actually how it works, you have to specify the exact trait that has the associated type. Fixes #8686.
* Add test for #8686Florian Diebold2021-04-291-0/+30
|
* fix: closure unify without check ClosureIdComonad2021-04-291-0/+36
| | | | closes #8604
* Merge #8462bors[bot]2021-04-191-0/+199
|\ | | | | | | | | | | | | | | 8462: Expand macros at type position r=jonas-schievink a=cynecx Co-authored-by: cynecx <[email protected]>
| * hir_ty: cleanups and extend infinitely_recursive_macro_type testcynecx2021-04-181-5/+9
| |
| * hir_ty: keep body::Expander in TyLoweringContextcynecx2021-04-181-0/+26
| |
| * hir_ty: Expand macros at type positioncynecx2021-04-171-0/+169
| |
* | Collect inherent impls in unnamed constsJonas Schievink2021-04-191-1/+36
|/
* Fix primitive shadowing with inner itemsJonas Schievink2021-04-161-0/+18
|
* Support macros in pattern positionJonas Schievink2021-04-112-2/+28
|
* Respect test style guidelines in tests::traitsLukas Wirth2021-04-101-698/+656
|
* Add test for binary op return ty with adtLukas Wirth2021-04-101-0/+47
|
* Add manual ops::Add impls to test::traits::closure_2Lukas Wirth2021-04-101-20/+46
|
* Implement more precise binary op return type predictionLukas Wirth2021-04-101-5/+5
|
* Resolve prelude and crate root names in the root DefMapJonas Schievink2021-04-091-0/+30
|
* Fix crash on syn involving lifetimes returned by ChalkFlorian Diebold2021-04-091-0/+38
| | | | | | | | | | If we get lifetime variables back in autoderef, just immediately replace them by static lifetimes for now. Method resolution doesn't really deal correctly with new variables being introduced (this needs to be fixed more properly). This fixes `rust-analyzer analysis-stats --with-deps` crashing in the RA repo.
* Merge #8394bors[bot]2021-04-071-0/+33
|\ | | | | | | | | | | | | | | 8394: Infer variants through type aliased enums r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
| * Infer variants through type aliased enumsLukas Wirth2021-04-071-0/+33
| |
* | Collect trait impls inside unnamed constsJonas Schievink2021-04-071-0/+22
|/
* Fix block inner item defined in macroEdwin Cheng2021-03-311-0/+26
|
* Fix generic arguments being incorrectly offset in qualified trait castsLukas Wirth2021-03-301-0/+43
|
* Basic Support Macro 2.0Edwin Cheng2021-03-271-1/+82
|
* Fix recursive macro statement expansionEdwin Cheng2021-03-251-1/+39
|
* Merge #7907bors[bot]2021-03-244-20/+139
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 7907: Autoderef with visibility r=cynecx a=cynecx Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7841. I am not sure about the general approach here. Right now this simply tries to check whether the autoderef candidate is reachable from the current module. ~~However this doesn't exactly work with traits (see the `tests::macros::infer_derive_clone_in_core` test, which fails right now).~~ see comment below Refs: - `rustc_typeck` checking fields: https://github.com/rust-lang/rust/blob/66ec64ccf31883cd2c28d045912a76179c0c6ed2/compiler/rustc_typeck/src/check/expr.rs#L1610 r? @flodiebold Co-authored-by: cynecx <[email protected]>
| * hir_ty: add coverage testing for autoderef_visibility_method testcynecx2021-03-201-0/+1
| |
| * hir_ty: fix test by removing trailing whitespacecynecx2021-03-201-24/+23
| |
| * hir_ty: fix visibility in infer_inherent_method testcynecx2021-03-201-16/+16
| |
| * hir_ty: add tests around autoderef with visibility checkingcynecx2021-03-201-0/+119
| |
| * hir_ty: fix tests by making required methods publiccynecx2021-03-202-4/+4
| |
* | Merge #8156bors[bot]2021-03-221-0/+46
|\ \ | | | | | | | | | | | | | | | | | | | | | 8156: Correctly lower TraitRefs with default params r=flodiebold a=Veykril Fixes #5685 Co-authored-by: Lukas Wirth <[email protected]>
| * | Correctly lower TraitRefs with default paramsLukas Wirth2021-03-221-0/+46
| | |