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 #73633

Closed
wants to merge 40 commits into from

Commits on May 1, 2020

  1. Configuration menu
    Copy the full SHA
    c88e6a7 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2020

  1. Configuration menu
    Copy the full SHA
    8667996 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c69d6c8 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2020

  1. Configuration menu
    Copy the full SHA
    b97487b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2d6267a View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2020

  1. add link list of error codes on docs.microsoft.com

    Carsten Andrich committed Jun 13, 2020
    Configuration menu
    Copy the full SHA
    e27a8b5 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2020

  1. Configuration menu
    Copy the full SHA
    1d08b1b View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2020

  1. Remove the const_raw_ptr_comparison feature gate.

    We can never supply a meaningful implementation of this.
    Instead, the follow up commits will create two intrinsics
    that approximate comparisons:
    
    * `ptr_maybe_eq`
    * `ptr_maybe_ne`
    
    The fact that `ptr_maybe_eq(a, b)` is not necessarily the same
    value as `!ptr_maybe_ne(a, b)` is a symptom of this entire
    problem.
    oli-obk committed Jun 19, 2020
    Configuration menu
    Copy the full SHA
    9245ba8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e09b620 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    84f1d73 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e75fbae View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2020

  1. Squashed all commits

    rakshith-ravi committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    0624a5a View commit details
    Browse the repository at this point in the history
  2. Refer just to the issue in the raw ptr cmp diagnostic instead of expl…

    …aining everything in the diagnostic
    oli-obk committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9e88b48 View commit details
    Browse the repository at this point in the history
  3. Satisfy tidy

    oli-obk committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    53686b9 View commit details
    Browse the repository at this point in the history
  4. Address review comments

    oli-obk committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    98e97a4 View commit details
    Browse the repository at this point in the history
  5. update tests

    Christian Poveda committed Jun 20, 2020
    Configuration menu
    Copy the full SHA
    9355168 View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2020

  1. Fix typos in doc comments

    This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'
    JOE1994 authored Jun 21, 2020
    Configuration menu
    Copy the full SHA
    6374054 View commit details
    Browse the repository at this point in the history
  2. Fix typo in error_codes doc

    dario23 committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    e3d735d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1c74ab4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e465b22 View commit details
    Browse the repository at this point in the history
  5. Update src/librustc_mir/monomorphize/collector.rs

    typo fix
    
    Co-authored-by: Jonas Schievink <[email protected]>
    JOE1994 and jonas-schievink authored Jun 21, 2020
    Configuration menu
    Copy the full SHA
    893077c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    3bfd0c9 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    6297228 View commit details
    Browse the repository at this point in the history
  8. fmt

    RalfJung committed Jun 21, 2020
    Configuration menu
    Copy the full SHA
    7447bf2 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2020

  1. bootstrap: no config.toml exists regression

    This commit fixes a regression introduced in rust-lang#73317 where an oversight
    meant that `config.toml` was assumed to exist.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    b60ec47 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    bb66d8d View commit details
    Browse the repository at this point in the history
  3. Update rustdoc

    oli-obk committed Jun 22, 2020
    Configuration menu
    Copy the full SHA
    f81c663 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3b47280 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#71756 - carstenandrich:master, r=dtolnay

    add Windows system error codes that should map to io::ErrorKind::TimedOut
    
    closes rust-lang#71646
    
    **Disclaimer:** The author of this pull request has a negligible amount of experience (i.e., kinda zero) with the Windows API. This PR should _definitely_ be reviewed by someone familiar with the API and its error handling.
    
    While porting POSIX software using serial ports to Windows, I found that for many Windows system error codes, an `io::Error` created via `io::Error::from_raw_os_error()` or `io::Error::last_os_error()` is not `io::ErrorKind::TimedOut`. For example, when a (non-overlapped) write to a COM port via [`WriteFile()`](https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile) times out, [`GetLastError()`](https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror) returns `ERROR_SEM_TIMEOUT` ([121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-)). However, an `io::Error` created from this error code will have `io::ErrorKind::Other`.
    
    Currently, only the error codes `ERROR_OPERATION_ABORTED` and `WSAETIMEDOUT` will instantiate `io::Error`s with kind `io::ErrorKind::TimedOut`.
    This makes `io::Error::last_os_error()` unsuitable for error handling of syscalls that could time out, because timeouts can not be caught by matching the error's kind against `io::ErrorKind::TimedOut`.
    
    Downloading the [list of Windows system error codes](https://gist.github.com/carstenandrich/c331d557520b8a0e7f44689ca257f805) and grepping anything that sounds like a timeout (`egrep -i "timed?.?(out|limit)"`), I've identified the following error codes that should also have `io::ErrorKind::TimedOut`, because they could be I/O-related:
    
    Name | Code | Description
    --- | --- | ---
    `ERROR_SEM_TIMEOUT` | [121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-) | The semaphore timeout period has expired.
    `WAIT_TIMEOUT` | [258](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-) | The wait operation timed out.
    `ERROR_DRIVER_CANCEL_TIMEOUT` | [594](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--500-999-) | The driver %hs failed to complete a cancelled I/O request in the allotted time.
    `ERROR_COUNTER_TIMEOUT` | [1121](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-) | A serial I/O operation completed because the timeout period expired. The IOCTL_SERIAL_XOFF_COUNTER did not reach zero.)
    `ERROR_TIMEOUT` | [1460](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1300-1699-) | This operation returned because the timeout period expired.
    `ERROR_CTX_MODEM_RESPONSE_TIMEOUT` | [7012](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The modem did not respond to the command sent to it. Verify that the modem is properly cabled and powered on.
    `ERROR_CTX_CLIENT_QUERY_TIMEOUT` | [7040](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The client failed to respond to the server connect message.
    `ERROR_DS_TIMELIMIT_EXCEEDED` | [8226](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--8200-8999-) | The time limit for this request was exceeded.
    `DNS_ERROR_RECORD_TIMED_OUT` | [9705](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--9000-11999-) | DNS record timed out.
    `ERROR_IPSEC_IKE_TIMED_OUT` | [13805](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | Negotiation timed out.
    
    The following errors are also timeouts, but they don't seem to be directly related to I/O or network operations:
    
    Name | Code | Description
    --- | --- | ---
    `ERROR_SERVICE_REQUEST_TIMEOUT` | [1053](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--1000-1299-) | The service did not respond to the start or control request in a timely fashion.
    `ERROR_RESOURCE_CALL_TIMED_OUT` | [5910](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--4000-5999-) | The call to the cluster resource DLL timed out.
    `FRS_ERR_SYSVOL_POPULATE_TIMEOUT` | [8014](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--6000-8199-) | The file replication service cannot populate the system volume because of an internal timeout. The event log may have more information.
    `ERROR_RUNLEVEL_SWITCH_TIMEOUT` | [15402](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | The requested run level switch cannot be completed successfully since one or more services will not stop or restart within the specified timeout.
    `ERROR_RUNLEVEL_SWITCH_AGENT_TIMEOUT` | [15403](https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--12000-15999-) | A run level switch agent did not respond within the specified timeout.
    
    Please note that `ERROR_SEM_TIMEOUT` is the only timeout error I have [seen in action](https://gist.github.com/carstenandrich/10b3962fa1abc9e50816b6460010900b). The remainder of the error codes listed above is based purely on reading documentation.
    
    This pull request adds all of the errors listed in both tables, but I'm not sure whether adding all of them makes sense. Someone with actual Windows API experience should decide that.
    
    I expect these changes to be fairly backwards compatible, because only the error's [`.kind()`](https://doc.rust-lang.org/std/io/struct.Error.html#method.kind) will change, but matching the error's code via [`.raw_os_error()`](https://doc.rust-lang.org/std/io/struct.Error.html#method.raw_os_error) will not be affected.
    However, code expecting these errors to be `io::ErrorKind::Other` would break. Even though I personally do not think such an implementation would make sense, after all the docs say that `io::ErrorKind` is _intended to grow over time_, a residual risk remains, of course. I took the liberty to ammend the docstring of `io::ErrorKind::Other` with a remark that discourages matching against it.
    
    As per the contributing guidelines I'm adding @steveklabnik due to the changed documentation. Also @retep998 might have some valuable insights on the error codes.
    
    r? @steveklabnik
    cc @retep998
    cc @Mark-Simulacrum
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    6747a11 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#72271 - rakshith-ravi:master, r=varkor

    Improve compiler error message for wrong generic parameter order
    
    - Added optional "help" parameter that shows a help message on the compiler error if required.
    - Added a simple ordered parameter as a sample help.
    
    @varkor will make more changes as required. Let me know if I'm heading in the right direction.
    
    Fixes rust-lang#68437
    
    r? @varkor
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    f441819 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#72780 - GuillaumeGomez:enforce-doc-alias-ch…

    …eck, r=ollie27
    
    Enforce doc alias check
    
    Part of rust-lang#50146.
    
    r? @ollie27
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    59a3b9a View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#73398 - oli-obk:const_raw_ptr_cmp, r=varkor…

    …,RalfJung,nagisa
    
    A way forward for pointer equality in const eval
    
    r? @varkor on the first commit and @RalfJung on the second commit
    
    cc rust-lang#53020
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    5b219f2 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#73472 - GuillaumeGomez:cleanup-e0689, r=Dyl…

    …an-DPC
    
    Clean up E0689 explanation
    
    r? @Dylan-DPC
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    3e98225 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#73513 - oli-obk:const_binop_overflow, r=est…

    …ebank
    
    Show the values and computation that would overflow a const evaluation or propagation
    
    Fixes rust-lang#71134
    
    In contrast to the example in the issue it doesn't use individual spans for each operand. The effort required to implement that is quite high compared to the little (if at all) benefit it would bring to diagnostics.
    
    cc @shepmaster
    
    The way this is implemented it is also fairly easy to do the same for overflow panics at runtime, but that should be done in a separate PR since it may have runtime performance implications.
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    9916c09 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#73515 - christianpoveda:livedrop-diagnostic…

    …s, r=oli-obk
    
    Add second message for LiveDrop errors
    
    This is an attempt to fix rust-lang#72907 by adding a second message to the `LiveDrop` diagnostics. Changing from this
    ```
    error[E0493]: destructors cannot be evaluated at compile-time
     --> src/lib.rs:7:9
      |
    7 |     let mut always_returned = None;
      |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
    
    error: aborting due to previous error
    ```
    to this
    ```
    error[E0493]: destructors cannot be evaluated at compile-time
      --> foo.rs:6:9
       |
    6  |     let mut always_returned = None;
       |         ^^^^^^^^^^^^^^^^^^^ constants cannot evaluate destructors
    ...
    10 |         always_returned = never_returned;
       |         --------------- value is dropped here
    
    error: aborting due to previous error
    ```
    r? @RalfJung @ecstatic-morse
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    59b57b2 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#73572 - JOE1994:patch-4, r=jonas-schievink

    Fix typos in doc comments
    
    Hello 🦀 ,
    
    This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'
    
    Thank you for reviewing this PR 👍
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    15a793a View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#73575 - dario23:typo-errorcodes-doc, r=matt…

    …hewjasper
    
    Fix typo in error_codes doc
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    af94a6b View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#73578 - RalfJung:ty-ctxt-at, r=jonas-schievink

    Make is_freeze and is_copy_modulo_regions take TyCtxtAt
    
    Make is_freeze and is_copy_modulo_regions take TyCtxtAt instead of separately taking TyCtxt and Span. This is consistent with is_sized.
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    ca761c0 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#73586 - RalfJung:switch-ty, r=oli-obk

    switch_ty is redundant
    
    This field is redundant, but we cannot remove it currently as pretty-printing relies on it (and it does not have access to `mir::Body` to compute the type itself).
    
    Cc @oli-obk @matthewjasper @jonas-schievink
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    fda89ea View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#73590 - davidtwco:bootstrap-fix-config-env-…

    …var, r=Mark-Simulacrum
    
    bootstrap: no `config.toml` exists regression
    
    Fixes rust-lang#73574.
    
    This PR fixes a regression introduced in rust-lang#73317 where an oversight meant that `config.toml` was assumed to exist.
    Manishearth authored Jun 22, 2020
    Configuration menu
    Copy the full SHA
    b405ab1 View commit details
    Browse the repository at this point in the history