Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 12 pull requests #66138

Closed
wants to merge 30 commits into from
Closed

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Nov 5, 2019

Successful merges:

Failed merges:

r? @ghost

Mark-Simulacrum and others added 30 commits November 1, 2019 22:24
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`
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
@Centril
Copy link
Contributor Author

Centril commented Nov 5, 2019

@bors r+ p=12 rollup=never

@bors
Copy link
Contributor

bors commented Nov 5, 2019

📌 Commit b173d97 has been approved by Centril

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 5, 2019
@bors
Copy link
Contributor

bors commented Nov 5, 2019

⌛ Testing commit b173d97 with merge d50e3ae2bf86b3e63f259c29bff8df71fccb049a...

@Centril Centril added the rollup A PR which is a rollup label Nov 5, 2019
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools of your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
2019-11-06T01:51:00.2803531Z normalized stderr:
2019-11-06T01:51:00.2803836Z error: This generic shadows the built-in type `u32`
2019-11-06T01:51:00.2804237Z   --> $DIR/builtin-type-shadow.rs:4:8
2019-11-06T01:51:00.2804322Z    |
2019-11-06T01:51:00.2804536Z LL | fn foo<u32>(a: u32) -> u32 {
2019-11-06T01:51:00.2804681Z    |
2019-11-06T01:51:00.2804974Z    = note: `-D clippy::builtin-type-shadow` implied by `-D warnings`
2019-11-06T01:51:00.2805049Z 
2019-11-06T01:51:00.2805120Z error[E0308]: mismatched types
2019-11-06T01:51:00.2805120Z error[E0308]: mismatched types
2019-11-06T01:51:00.2805363Z   --> $DIR/builtin-type-shadow.rs:5:5
2019-11-06T01:51:00.2805431Z    |
2019-11-06T01:51:00.2805653Z LL | fn foo<u32>(a: u32) -> u32 {
2019-11-06T01:51:00.2805905Z    |        ---             --- expected `u32` because of return type
2019-11-06T01:51:00.2806118Z    |        this type parameter
2019-11-06T01:51:00.2806202Z LL |     42
2019-11-06T01:51:00.2806286Z    |     ^^ expected type parameter `u32`, found integer
2019-11-06T01:51:00.2806356Z    |
2019-11-06T01:51:00.2806356Z    |
2019-11-06T01:51:00.2806431Z    = note: expected type `u32`
2019-11-06T01:51:00.2806497Z               found type `{integer}`
2019-11-06T01:51:00.2806590Z    = help: type parameters must be constrained to match other types
2019-11-06T01:51:00.2806906Z    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
2019-11-06T01:51:00.2807345Z error: aborting due to 2 previous errors
2019-11-06T01:51:00.2807411Z 
2019-11-06T01:51:00.2807688Z For more information about this error, try `rustc --explain E0308`.
2019-11-06T01:51:00.2807759Z 
2019-11-06T01:51:00.2807759Z 
2019-11-06T01:51:00.2807793Z 
2019-11-06T01:51:00.2807849Z expected stderr:
2019-11-06T01:51:00.2808099Z error: This generic shadows the built-in type `u32`
2019-11-06T01:51:00.2808319Z   --> $DIR/builtin-type-shadow.rs:4:8
2019-11-06T01:51:00.2808403Z    |
2019-11-06T01:51:00.2808627Z LL | fn foo<u32>(a: u32) -> u32 {
2019-11-06T01:51:00.2808771Z    |
2019-11-06T01:51:00.2809012Z    = note: `-D clippy::builtin-type-shadow` implied by `-D warnings`
2019-11-06T01:51:00.2809084Z 
2019-11-06T01:51:00.2809423Z error[E0308]: mismatched types
2019-11-06T01:51:00.2809423Z error[E0308]: mismatched types
2019-11-06T01:51:00.2809703Z   --> $DIR/builtin-type-shadow.rs:5:5
2019-11-06T01:51:00.2809771Z    |
2019-11-06T01:51:00.2809997Z LL | fn foo<u32>(a: u32) -> u32 {
2019-11-06T01:51:00.2810272Z    |                        --- expected `u32` because of return type
2019-11-06T01:51:00.2810579Z    |     ^^ expected type parameter, found integer
2019-11-06T01:51:00.2810663Z    |
2019-11-06T01:51:00.2810719Z    = note: expected type `u32`
2019-11-06T01:51:00.2810719Z    = note: expected type `u32`
2019-11-06T01:51:00.2810804Z               found type `{integer}`
2019-11-06T01:51:00.2810900Z    = help: type parameters must be constrained to match other types
2019-11-06T01:51:00.2812545Z    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
2019-11-06T01:51:00.2812720Z error: aborting due to 2 previous errors
2019-11-06T01:51:00.2812768Z 
2019-11-06T01:51:00.2813061Z For more information about this error, try `rustc --explain E0308`.
2019-11-06T01:51:00.2813120Z 
2019-11-06T01:51:00.2813120Z 
2019-11-06T01:51:00.2813175Z 
2019-11-06T01:51:00.2813237Z diff of stderr:
2019-11-06T01:51:00.2813279Z 
2019-11-06T01:51:00.2813552Z  error: This generic shadows the built-in type `u32`
2019-11-06T01:51:00.2813847Z    --> $DIR/builtin-type-shadow.rs:4:8
2019-11-06T01:51:00.2813924Z     |
2019-11-06T01:51:00.2814177Z  LL | fn foo<u32>(a: u32) -> u32 {
2019-11-06T01:51:00.2814337Z     |
2019-11-06T01:51:00.2814605Z     = note: `-D clippy::builtin-type-shadow` implied by `-D warnings`
2019-11-06T01:51:00.2814938Z  
2019-11-06T01:51:00.2814995Z  error[E0308]: mismatched types
2019-11-06T01:51:00.2814995Z  error[E0308]: mismatched types
2019-11-06T01:51:00.2815232Z    --> $DIR/builtin-type-shadow.rs:5:5
2019-11-06T01:51:00.2815300Z     |
2019-11-06T01:51:00.2815529Z  LL | fn foo<u32>(a: u32) -> u32 {
2019-11-06T01:51:00.2815802Z -   |                        --- expected `u32` because of return type
2019-11-06T01:51:00.2816065Z +   |        ---             --- expected `u32` because of return type
2019-11-06T01:51:00.2816222Z +   |        this type parameter
2019-11-06T01:51:00.2816305Z  LL |     42
2019-11-06T01:51:00.2816691Z -   |     ^^ expected type parameter, found integer
2019-11-06T01:51:00.2816802Z +   |     ^^ expected type parameter `u32`, found integer
2019-11-06T01:51:00.2816802Z +   |     ^^ expected type parameter `u32`, found integer
2019-11-06T01:51:00.2816869Z     |
2019-11-06T01:51:00.2816942Z     = note: expected type `u32`
2019-11-06T01:51:00.2817021Z                found type `{integer}`
2019-11-06T01:51:00.2817094Z     = help: type parameters must be constrained to match other types
2019-11-06T01:51:00.2817418Z     = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
2019-11-06T01:51:00.2817580Z  error: aborting due to 2 previous errors
2019-11-06T01:51:00.2817642Z  
2019-11-06T01:51:00.2817894Z  For more information about this error, try `rustc --explain E0308`.
2019-11-06T01:51:00.2817983Z  
---
2019-11-06T01:51:00.2823342Z 
2019-11-06T01:51:00.2823599Z ------------------------------------------
2019-11-06T01:51:00.2823692Z stderr:
2019-11-06T01:51:00.2823947Z ------------------------------------------
2019-11-06T01:51:00.2825395Z {"message":"This generic shadows the built-in type `u32`","code":{"code":"clippy::builtin_type_shadow","explanation":null},"level":"error","spans":[{"file_name":"tests/ui/builtin-type-shadow.rs","byte_start":78,"byte_end":81,"line_start":4,"line_end":4,"column_start":8,"column_end":11,"is_primary":true,"text":[{"text":"fn foo<u32>(a: u32) -> u32 {","highlight_start":8,"highlight_end":11}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`-D clippy::builtin-type-shadow` implied by `-D warnings`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: This generic shadows the built-in type `u32`\n  --> tests/ui/builtin-type-shadow.rs:4:8\n   |\nLL | fn foo<u32>(a: u32) -> u32 {\n   |        ^^^\n   |\n   = note: `-D clippy::builtin-type-shadow` implied by `-D warnings`\n\n"}
2019-11-06T01:51:00.2839374Z {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"tests/ui/builtin-type-shadow.rs","byte_start":104,"byte_end":106,"line_start":5,"line_end":5,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    42","highlight_start":5,"highlight_end":7}],"label":"expected type parameter `u32`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"tests/ui/builtin-type-shadow.rs","byte_start":78,"byte_end":81,"line_start":4,"line_end":4,"column_start":8,"column_end":11,"is_primary":false,"text":[{"text":"fn foo<u32>(a: u32) -> u32 {","highlight_start":8,"highlight_end":11}],"label":"this type parameter","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"tests/ui/builtin-type-shadow.rs","byte_start":94,"byte_end":97,"line_start":4,"line_end":4,"column_start":24,"column_end":27,"is_primary":false,"text":[{"text":"fn foo<u32>(a: u32) -> u32 {","highlight_start":24,"highlight_end":27}],"label":"expected `u32` because of return type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `u32`\n   found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"type parameters must be constrained to match other types","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> tests/ui/builtin-type-shadow.rs:5:5\n   |\nLL | fn foo<u32>(a: u32) -> u32 {\n   |        ---             --- expected `u32` because of return type\n   |        |\n   |        this type parameter\nLL |     42\n   |     ^^ expected type parameter `u32`, found integer\n   |\n   = note: expected type `u32`\n              found type `{integer}`\n   = help: type parameters must be constrained to match other types\n   = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters\n\n"}
2019-11-06T01:51:00.2844326Z {"message":"For more information about this error, try `rustc --explain E0308`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0308`.\n"}
2019-11-06T01:51:00.2844459Z 
2019-11-06T01:51:00.2844936Z ------------------------------------------
2019-11-06T01:51:00.2844991Z 
---
2019-11-06T02:21:18.5986042Z 
2019-11-06T02:21:18.6256905Z error[E0599]: no method named `get` found for type `&rustc_mir::interpret::Memory<'mir, 'tcx, machine::Evaluator<'tcx>>` in the current scope
2019-11-06T02:21:18.6257437Z   --> src/tools/miri/src/intptrcast.rs:66:37
2019-11-06T02:21:18.6257734Z    |
2019-11-06T02:21:18.6258241Z 66 |                 if offset <= memory.get(alloc_id)?.size.bytes() {
2019-11-06T02:21:18.6258828Z    |                                     ^^^ method not found in `&rustc_mir::interpret::Memory<'mir, 'tcx, machine::Evaluator<'tcx>>`
2019-11-06T02:21:18.7481125Z error[E0599]: no method named `get_mut` found for type `rustc_mir::interpret::Memory<'_, '_, machine::Evaluator<'_>>` in the current scope
2019-11-06T02:21:18.7481555Z    --> src/tools/miri/src/eval.rs:167:36
2019-11-06T02:21:18.7481788Z     |
2019-11-06T02:21:18.7482497Z 167 |         let cmd_alloc = ecx.memory.get_mut(cmd_ptr.alloc_id)?;
---
2019-11-06T02:21:19.2972328Z   local time: Wed Nov  6 02:21:19 UTC 2019
2019-11-06T02:21:19.5710033Z   network time: Wed, 06 Nov 2019 02:21:19 GMT
2019-11-06T02:21:19.5711206Z == end clock drift check ==
2019-11-06T02:21:20.6332959Z 
2019-11-06T02:21:20.6452947Z ##[error]Bash exited with code '1'.
2019-11-06T02:21:20.6494054Z ##[section]Starting: Checkout
2019-11-06T02:21:20.6497086Z ==============================================================================
2019-11-06T02:21:20.6497181Z Task         : Get sources
2019-11-06T02:21:20.6497284Z Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.

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 @TimNN. (Feature Requests)

@bors
Copy link
Contributor

bors commented Nov 6, 2019

💔 Test failed - checks-azure

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 6, 2019
@Centril Centril closed this Nov 6, 2019
@Centril Centril deleted the rollup-angtai5 branch November 6, 2019 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.