-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 14 pull requests #73598
Rollup of 14 pull requests #73598
Commits on May 1, 2020
-
add Windows system error codes that map to io::ErrorKind::TimedOut
Carsten Andrich committedMay 1, 2020 Configuration menu - View commit details
-
Copy full SHA for c88e6a7 - Browse repository at this point
Copy the full SHA c88e6a7View commit details
Commits on May 2, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 8667996 - Browse repository at this point
Copy the full SHA 8667996View commit details -
Configuration menu - View commit details
-
Copy full SHA for c69d6c8 - Browse repository at this point
Copy the full SHA c69d6c8View commit details
Commits on Jun 13, 2020
-
add link list of error codes on docs.microsoft.com
Carsten Andrich committedJun 13, 2020 Configuration menu - View commit details
-
Copy full SHA for e27a8b5 - Browse repository at this point
Copy the full SHA e27a8b5View commit details
Commits on Jun 18, 2020
-
Configuration menu - View commit details
-
Copy full SHA for 1d08b1b - Browse repository at this point
Copy the full SHA 1d08b1bView commit details
Commits on Jun 19, 2020
-
Configuration menu - View commit details
-
Copy full SHA for c9c434d - Browse repository at this point
Copy the full SHA c9c434dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e93362b - Browse repository at this point
Copy the full SHA e93362bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0094f44 - Browse repository at this point
Copy the full SHA 0094f44View commit details -
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.
Configuration menu - View commit details
-
Copy full SHA for 9245ba8 - Browse repository at this point
Copy the full SHA 9245ba8View commit details -
Configuration menu - View commit details
-
Copy full SHA for e09b620 - Browse repository at this point
Copy the full SHA e09b620View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84f1d73 - Browse repository at this point
Copy the full SHA 84f1d73View commit details
Commits on Jun 20, 2020
-
Provide suggestions for some moved value errors
When encountering an used moved value where the previous move happened in a `match` or `if let` pattern, suggest using `ref`. Fix rust-lang#63988. When encountering a `&mut` value that is used in multiple iterations of a loop, suggest reborrowing it with `&mut *`. Fix rust-lang#62112.
Configuration menu - View commit details
-
Copy full SHA for a10e07c - Browse repository at this point
Copy the full SHA a10e07cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0624a5a - Browse repository at this point
Copy the full SHA 0624a5aView commit details -
Refer just to the issue in the raw ptr cmp diagnostic instead of expl…
…aining everything in the diagnostic
Configuration menu - View commit details
-
Copy full SHA for 9e88b48 - Browse repository at this point
Copy the full SHA 9e88b48View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53686b9 - Browse repository at this point
Copy the full SHA 53686b9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 98e97a4 - Browse repository at this point
Copy the full SHA 98e97a4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5faf657 - Browse repository at this point
Copy the full SHA 5faf657View commit details -
Configuration menu - View commit details
-
Copy full SHA for fc60282 - Browse repository at this point
Copy the full SHA fc60282View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4896a06 - Browse repository at this point
Copy the full SHA 4896a06View commit details
Commits on Jun 21, 2020
-
This commit fixes typos in the doc comments of 'librustc_mir/monomorphize/collector.rs'
Configuration menu - View commit details
-
Copy full SHA for 6374054 - Browse repository at this point
Copy the full SHA 6374054View commit details -
Configuration menu - View commit details
-
Copy full SHA for e3d735d - Browse repository at this point
Copy the full SHA e3d735dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e465b22 - Browse repository at this point
Copy the full SHA e465b22View commit details -
Configuration menu - View commit details
-
Copy full SHA for 467415d - Browse repository at this point
Copy the full SHA 467415dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a657be4 - Browse repository at this point
Copy the full SHA a657be4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 726b6f4 - Browse repository at this point
Copy the full SHA 726b6f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for c14d85f - Browse repository at this point
Copy the full SHA c14d85fView commit details -
Update src/librustc_mir/monomorphize/collector.rs
typo fix Co-authored-by: Jonas Schievink <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 893077c - Browse repository at this point
Copy the full SHA 893077cView commit details -
Prefer accessible paths in 'use' suggestions
This fixes an issue with the following sample: mod foo { mod inaccessible { pub struct X; } pub mod avail { pub struct X; } } fn main() { X; } Instead of suggesting both `use crate::foo::inaccessible::X;` and `use crate::foo::avail::X;`, it should only suggest the latter. It is done by trimming the list of suggestions from inaccessible paths if accessible paths are present. Visibility is checked with `is_accessible_from` now instead of being hard-coded. - Some tests fixes are trivial, and others require a bit more explaining, here are my comments: src/test/ui/issues/issue-35675.stderr: Only needs to make the enum public to have the suggestion make sense. src/test/ui/issues/issue-42944.stderr: Importing the tuple struct won't help because its constructor is not visible, so the attempted constructor does not work. In that case, it's better not to suggest it. The case where the constructor is public is covered in `issue-26545.rs`.
Configuration menu - View commit details
-
Copy full SHA for fea5ab1 - Browse repository at this point
Copy the full SHA fea5ab1View commit details -
Do not send a notification for P-high stable regressions
Add comment to clarify the pattern
Configuration menu - View commit details
-
Copy full SHA for ae71e96 - Browse repository at this point
Copy the full SHA ae71e96View commit details -
Rollup merge of rust-lang#71660 - sollyucko:master, r=dtolnay
impl PartialEq<Vec<B>> for &[A], &mut [A] rust-lang/rfcs#2917
Configuration menu - View commit details
-
Copy full SHA for ecf0dbe - Browse repository at this point
Copy the full SHA ecf0dbeView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 400b4cb - Browse repository at this point
Copy the full SHA 400b4cbView commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 005b222 - Browse repository at this point
Copy the full SHA 005b222View commit details -
Rollup merge of rust-lang#72623 - da-x:use-suggest-public-path, r=pet…
…rochenkov Prefer accessible paths in 'use' suggestions This PR addresses issue rust-lang#26454, where `use` suggestions are made for paths that don't work. For example: ```rust mod foo { mod bar { struct X; } } fn main() { X; } // suggests `use foo::bar::X;` ```
Configuration menu - View commit details
-
Copy full SHA for 6f62d83 - Browse repository at this point
Copy the full SHA 6f62d83View commit details -
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
Configuration menu - View commit details
-
Copy full SHA for 5d26903 - Browse repository at this point
Copy the full SHA 5d26903View commit details -
Rollup merge of rust-lang#73472 - GuillaumeGomez:cleanup-e0689, r=Dyl…
…an-DPC Clean up E0689 explanation r? @Dylan-DPC
Configuration menu - View commit details
-
Copy full SHA for 35dac31 - Browse repository at this point
Copy the full SHA 35dac31View commit details -
Rollup merge of rust-lang#73495 - Lucretiel:wasi-io-impls, r=sfackler
Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits Currently, some of the platform-specific standard streams (`src/libstd/sys/*/stdio.rs`) manually implement parts of the `io::Write` interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage of `fn write(&self, ...)` instead of `fn write(&mut self, ...)`. Unfortunately, this means that those implementations don't have the default-implemented io methods, like `read_exact` and `write_all`. This caused rust-lang#72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms. This change converts *all* such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in `src/libstd/io/stdio.rs`.
Configuration menu - View commit details
-
Copy full SHA for 4727f03 - Browse repository at this point
Copy the full SHA 4727f03View commit details -
Configuration menu - View commit details
-
Copy full SHA for cb81d38 - Browse repository at this point
Copy the full SHA cb81d38View commit details -
Rollup merge of rust-lang#73534 - estebank:borrowck-suggestions, r=ma…
…tthewjasper Provide suggestions for some moved value errors When encountering an used moved value where the previous move happened in a `match` or `if let` pattern, suggest using `ref`. Fix rust-lang#63988. When encountering a `&mut` value that is used in multiple iterations of a loop, suggest reborrowing it with `&mut *`. Fix rust-lang#62112.
Configuration menu - View commit details
-
Copy full SHA for 62ffd20 - Browse repository at this point
Copy the full SHA 62ffd20View commit details -
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 👍
Configuration menu - View commit details
-
Copy full SHA for 2717ff0 - Browse repository at this point
Copy the full SHA 2717ff0View commit details -
Rollup merge of rust-lang#73575 - dario23:typo-errorcodes-doc, r=matt…
…hewjasper Fix typo in error_codes doc
Configuration menu - View commit details
-
Copy full SHA for d1b1ca3 - Browse repository at this point
Copy the full SHA d1b1ca3View commit details -
Rollup merge of rust-lang#73580 - RalfJung:deprecate-wrapping-offset-…
…from, r=Amanieu deprecate wrapping_offset_from As per rust-lang#41079 (comment) which seems like a consensus. r? @Amanieu
Configuration menu - View commit details
-
Copy full SHA for 91d0414 - Browse repository at this point
Copy the full SHA 91d0414View commit details -
Rollup merge of rust-lang#73582 - RalfJung:miri-span-bug, r=oli-obk
Miri: replace many bug! by span_bug! r? @oli-obk
Configuration menu - View commit details
-
Copy full SHA for 722bf14 - Browse repository at this point
Copy the full SHA 722bf14View commit details -
Rollup merge of rust-lang#73585 - LeSeulArtichaut:patch-3, r=Mark-Sim…
…ulacrum Do not send a notification for P-high stable regressions This is kind of a hack to only match nightly and beta regressions, but not stable regressions. See my tests [on the playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=6ff8a809162118aa2951f2ff12400067). r? @spastorino cc @Mark-Simulacrum
Configuration menu - View commit details
-
Copy full SHA for b4c36fe - Browse repository at this point
Copy the full SHA b4c36feView commit details