aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/tests/traits.rs
Commit message (Collapse)AuthorAgeFilesLines
* internal: switch some tests to minicoreAleksey Kladov2021-06-161-15/+1
|
* internal: add fn to minicoreAleksey Kladov2021-06-161-230/+162
|
* internal: add result to minicoreAleksey Kladov2021-06-151-19/+1
|
* internal: add option to minicoreAleksey Kladov2021-06-151-40/+6
|
* internal: add future to minicoreAleksey Kladov2021-06-151-12/+2
|
* internal: switch some tests to minicoreAleksey Kladov2021-06-151-5/+2
|
* internal: switch some tests to minicoreAleksey Kladov2021-06-151-29/+8
|
* internal: document that we don't #[ignore] testsAleksey Kladov2021-06-151-1/+0
|
* Make block-local trait impls workFlorian Diebold2021-06-131-0/+67
| | | | | As long as either the trait or the implementing type are defined in the same block.
* Implement per-edition preludesJonas Schievink2021-06-011-16/+32
|
* hir_ty: don't pass where clauses of associated types down to chalk (temp. ↵cynecx2021-05-301-8/+23
| | | | fix #9052)
* hir_ty: use async ret type for inference inside async bodiescynecx2021-05-291-0/+49
|
* Consider trait to be in scope for trait-implLukas Wirth2021-05-251-0/+30
|
* Merge #8987bors[bot]2021-05-251-2/+24
|\ | | | | | | | | | | | | | | 8987: Fix lowering of FnOnce() without return type r=flodiebold a=flodiebold This should result in an implicit `-> ()`, not leaving out the binding. Co-authored-by: Florian Diebold <[email protected]>
| * Hide `-> ()` in Fn traitsFlorian Diebold2021-05-251-3/+3
| |
| * Fix lowering of FnOnce() without return typeFlorian Diebold2021-05-251-5/+27
| | | | | | | | This should result in an implicit `-> ()`, not leaving out the binding.
* | Fix type inference not working for new Try traitLukas Wirth2021-05-251-0/+37
|/
* Get rid of resolve_ty_as_possibleFlorian Diebold2021-05-211-1/+1
| | | | Instead use shallow resolving where necessary.
* Add more tests, refactor array lengths/consteval workJade2021-05-141-0/+97
| | | | | | | | | | | 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)
* Add basic support for array lengths in typesJade2021-05-111-1/+1
| | | | | | | | | | 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?
* 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 generic arguments being incorrectly offset in qualified trait castsLukas Wirth2021-03-301-0/+43
|
* Merge #7907bors[bot]2021-03-241-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: fix tests by making required methods publiccynecx2021-03-201-2/+2
| |
* | Correctly lower TraitRefs with default paramsLukas Wirth2021-03-221-0/+46
| |
* | Ignore type bindings in generic_predicates_for_paramFlorian Diebold2021-03-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Test for a Salsa bugFlorian Diebold2021-03-211-0/+51
|/
* Remove WhereClause::ErrorFlorian Diebold2021-03-201-2/+2
| | | | | Chalk doesn't have it, and judging from the removed code, it wasn't useful anyway.
* Add test for self-calling inner functionJonas Schievink2021-03-171-0/+21
|
* Fix unification logicFlorian Diebold2021-03-151-100/+116
|
* Check ancestor maps when computing traits in scopeJonas Schievink2021-03-091-0/+33
|
* Use upstream cov-markLaurențiu Nicola2021-03-081-3/+2
|
* Don't write trailing whitespace when formatting empty GenericPredicatesLukas Wirth2021-02-201-2/+2
|
* Don't lower TypeBound::Lifetime as GenericPredicate::ErrorLukas Wirth2021-02-201-3/+3
|
* Slightly expand testJonas Schievink2021-02-101-0/+3
|
* Add more testsJonas Schievink2021-02-101-0/+51
|
* Render Fn* trait objects and impl types as rust doesLukas Wirth2021-01-131-4/+4
|
* Implement async blocksoxalica2020-09-101-0/+40
|
* Switch to expect_test from crates.ioAleksey Kladov2020-08-211-1/+1
|
* Rename ra_hir_ty -> hir_tyAleksey Kladov2020-08-131-0/+3113