Closed
Conversation
Part of rust-lang#47319. This just adds type parameter name to type mismatch error message, so e.g. the following: ``` expected enum `std::option::Option`, found type parameter ``` becomes ``` expected enum `std::option::Option`, found type parameter `T` ```
Fixes rust-lang#47319. Shows the type parameter definition(s) on type mismatch errors so the context is clearer. Pretty much changes the following: ``` LL | bar1(t); | ^ | | | expected enum `std::option::Option`, found type parameter `T` ``` into: ``` LL | fn foo1<T>(t: T) { | - this type parameter LL | bar1(t); | ^ | | | expected enum `std::option::Option`, found type parameter `T` ```
Update the tests to reflect changes to how type mismatch errors are reported (two previous commits).
Type parameters are referenced in the error message after the previous few commits (using span label). But when the main error message already references the very same type parameter it becomes clumsy. Do not show the additional label in this case as per code review comment by @estebank. Also this contains a small style fix.
Handling issue rust-lang#66105 in Rust repo. `evaluate an constant expression` to `evaluate a constant expression`
…s_derving_copy`.
When `break;` has a type mismatch because the `Destination` points at a tail expression with an obligation flowing from a return type, point at the return type. Fix rust-lang#39968.
…trochenkov Remove `PartialEq` and `Eq` from the `SpecialDerives`. Now that PR rust-lang#65519 landed, this is the follow-on work of removing `PartialEq` and `Eq` from the set of `SpecialDerives` .
…tion, r=estebank Show type parameter name and definition in type mismatch error messages Fixes rust-lang#47319 r? estebank
…, r=alexcrichton Move has_panic_handler to query Moves us off of a global Once instead re-querying the lang item each time. The conditions on when we set it to true change a little (previously we'd make sure a few more lang items were `Some`) but I think they in practice don't matter, we won't compile later on if we don't have them.
rename Memory::get methods to get_raw to indicate their unchecked nature Some recent Miri PRs started using these methods when they should not; this should discourage their use. In fact we could make these methods private to the `interp` module as far as Miri is concerned -- with the exception of the `uninit` intrinsic which will hopefully go away soon. @bjorn3 @oli-obk does priroda need these methods? It would be great to be able to seal them away.
syntax: Avoid span arithmetic for delimiter tokens The +/-1 logic is from the time where the whole group had a single span and the delimiter spans had to be calculated from it. Now the delimiters have their own spans which are constructed by lexer or proc macro API and can be used directly. If those spans are not perfect, then it should be fixed by tweaking the corresponding lexer logic rather than by trying to add or substract `1` from the span boundaries. Fixes rust-lang#62524 r? @estebank
use silent emitter for rustdoc highlighting pass Partially addresses rust-lang#63284.
let caller of check_ptr_access_align control the error message This is needed for rust-lang/miri#1031
Do not ICE with a precision flag in formatting str and no format arguments Fix rust-lang#66065.
…tril Detect `::` -> `:` typo when involving turbofish Fix rust-lang#65569.
Tweak type mismatch caused by break on tail expr When `break;` has a type mismatch because the `Destination` points at a tail expression with an obligation flowing from a return type, point at the return type. Fix rust-lang#39968.
Fix typo in explanation of `E0080` Handling issue rust-lang#66105 in Rust repo. `evaluate an constant expression` to `evaluate a constant expression`
…erister rustc: remove "GlobalMetaData" dead code from hir::map::definitions. Spotted while refactoring uses of `DefIndex` and/or `LocalDefId`. r? @michaelwoerister
Contributor
Author
|
@bors r+ p=12 rollup=never |
Collaborator
|
📌 Commit b173d97 has been approved by |
Collaborator
|
⌛ Testing commit b173d97 with merge d50e3ae2bf86b3e63f259c29bff8df71fccb049a... |
Contributor
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Collaborator
|
💔 Test failed - checks-azure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
PartialEqandEqfrom theSpecialDerives. #65892 (RemovePartialEqandEqfrom theSpecialDerives.)::->:typo when involving turbofish #66098 (Detect::->:typo when involving turbofish)E0080#66106 (Fix typo in explanation ofE0080)Failed merges:
r? @ghost