- 26 8月, 2021 2 次提交
- 18 8月, 2021 1 次提交
-
-
由 crlf0710 提交于
-
- 03 8月, 2021 1 次提交
-
-
由 crlf0710 提交于
-
- 20 7月, 2021 1 次提交
-
-
由 Aaron Hill 提交于
During function type-checking, we normalize any associated types in the function signature (argument types + return type), and then create WF obligations for each of the normalized types. The HIR wf code does not currently support this case, so any errors that we get have imprecise spans. This commit extends `ObligationCauseCode::WellFormed` to support recording a function parameter, allowing us to get the corresponding HIR type if an error occurs. Function typechecking is modified to pass this information during signature normalization and WF checking. The resulting code is fairly verbose, due to the fact that we can no longer normalize the entire signature with a single function call. As part of the refactoring, we now perform HIR-based WF checking for several other 'typed items' (statics, consts, and inherent impls). As a result, WF and projection errors in a function signature now have a precise span, which points directly at the responsible type. If a function signature is constructed via a macro, this will allow the error message to point at the code 'most responsible' for the error (e.g. a user-supplied macro argument).
-
- 17 7月, 2021 1 次提交
-
-
由 Aaron Hill 提交于
During well-formed checking, we walk through all types 'nested' in generic arguments. For example, WF-checking `Option<MyStruct<u8>>` will cause us to check `MyStruct<u8>` and `u8`. However, this is done on a `rustc_middle::ty::Ty`, which has no span information. As a result, any errors that occur will have a very general span (e.g. the definintion of an associated item). This becomes a problem when macros are involved. In general, an associated type like `type MyType = Option<MyStruct<u8>>;` may have completely different spans for each nested type in the HIR. Using the span of the entire associated item might end up pointing to a macro invocation, even though a user-provided span is available in one of the nested types. This PR adds a framework for HIR-based well formed checking. This check is only run during error reporting, and is used to obtain a more precise span for an existing error. This is accomplished by individually checking each 'nested' type in the HIR for the type, allowing us to find the most-specific type (and span) that produces a given error. The majority of the changes are to the error-reporting code. However, some of the general trait code is modified to pass through more information. Since this has no soundness implications, I've implemented a minimal version to begin with, which can be extended over time. In particular, this only works for HIR items with a corresponding `DefId` (e.g. it will not work for WF-checking performed within function bodies).
-
- 30 5月, 2021 1 次提交
-
-
由 Camille GILLOT 提交于
-
- 12 5月, 2021 1 次提交
-
-
由 Camille GILLOT 提交于
-
- 31 3月, 2021 1 次提交
-
-
由 Oli Scherer 提交于
-
- 12 3月, 2021 1 次提交
-
-
由 Oli Scherer 提交于
valtree is a version of constants that is inherently safe to be used within types. This is in contrast to ty::Const which can have different representations of the same value. These representation differences can show up in hashing or equality comparisons, breaking type equality of otherwise equal types. valtrees do not have this problem.
-
- 20 2月, 2021 2 次提交
-
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
The per-Key choice was not used.
-
- 06 2月, 2021 1 次提交
-
-
由 Santiago Pastorino 提交于
This reverts commit b4def89d, reversing changes made to 7dc1e852.
-
- 24 1月, 2021 1 次提交
-
-
由 oli 提交于
-
- 02 12月, 2020 1 次提交
-
-
由 Santiago Pastorino 提交于
This reverts commit 349b3b32, reversing changes made to b776d1c3.
-
- 27 11月, 2020 2 次提交
-
-
由 Santiago Pastorino 提交于
-
由 Santiago Pastorino 提交于
-
- 18 9月, 2020 1 次提交
-
-
由 Bastian Kauschke 提交于
-
- 30 8月, 2020 1 次提交
-
-
由 mark 提交于
-
- 22 7月, 2020 1 次提交
-
-
由 Aaron Hill 提交于
Fixes #65918
-
- 15 7月, 2020 4 次提交
-
-
由 Bastian Kauschke 提交于
-
由 Bastian Kauschke 提交于
-
由 Bastian Kauschke 提交于
-
由 Bastian Kauschke 提交于
-
- 15 5月, 2020 1 次提交
-
-
由 csmoe 提交于
-
- 02 5月, 2020 1 次提交
-
-
由 Jack Huey 提交于
-
- 28 4月, 2020 1 次提交
-
-
由 marmeladema 提交于
-
- 18 4月, 2020 1 次提交
-
-
由 Eduard-Mihai Burtescu 提交于
-
- 05 4月, 2020 1 次提交
-
-
由 Aaron Hill 提交于
-
- 30 3月, 2020 1 次提交
-
-
由 Mazdak Farrokhzad 提交于
-
- 26 3月, 2020 1 次提交
-
-
由 Camille GILLOT 提交于
-
- 24 3月, 2020 1 次提交
-
-
由 Bastian Kauschke 提交于
-
- 19 3月, 2020 1 次提交
-
-
由 Eduard-Mihai Burtescu 提交于
-
- 19 2月, 2020 1 次提交
-
-
由 John Kåre Alsaker 提交于
-
- 23 1月, 2020 1 次提交
-
-
由 Michael Woerister 提交于
This reduces the amount of invalidated data when new types are add to upstream crates.
-
- 17 1月, 2020 1 次提交
-
-
由 Aaron Hill 提交于
-
- 14 1月, 2020 1 次提交
-
-
由 Ben Lewis 提交于
which requires a lot of unnecessary work to evaluate them further down the line.
-
- 13 1月, 2020 1 次提交
-
-
由 Aaron Hill 提交于
-
- 12 1月, 2020 1 次提交
-
-
由 Matthew Jasper 提交于
-
- 05 1月, 2020 1 次提交
-
-
由 Mazdak Farrokhzad 提交于
-