-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Removed prelude::* from libstd files. #12006
Conversation
I'm not sure how to fix that exception (looks like that warning may have been there for a while), but I think this patch will fix the Windows build. |
#[cfg(target_os = "macos")] | ||
#[cfg(target_os = "windows")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably needs to be #[cfg(windows)]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or target_os="win32"
, iirc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe. The only use of range()
is in a function with #[cfg(windows)]. I don't know if one is the superset of the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, they are equivalent.
https://github.com/mozilla/rust/blob/master/src/librustc/driver/driver.rs#L79
One more try to get the Windows guard working. |
This cleans up a warning about an unused variable and explains the code further.
A solid step towards fixing #11998. Eventually, the size may always be passed to `exchange_free` but this will not be required to fix the bug.
- `extra::json` didn't make the cut, because of `extra::json` required dep on `extra::TreeMap`. If/when `extra::TreeMap` moves out of `extra`, then `extra::json` could move into `serialize` - `libextra`, `libsyntax` and `librustc` depend on the newly created `libserialize` - The extensions to various `extra` types like `DList`, `RingBuf`, `TreeMap` and `TreeSet` for `Encodable`/`Decodable` were moved into the respective modules in `extra` - There is some trickery, evident in `src/libextra/lib.rs` where a stub of `extra::serialize` is set up (in `src/libextra/serialize.rs`) for use in the stage0 build, where the snapshot rustc is still making deriving for `Encodable` and `Decodable` point at extra. Big props to @huonw for help working out the re-export solution for this extra: inline extra::serialize stub fix stuff clobbered in rebase + don't reexport serialize::serialize no more globs in libserialize syntax: fix import of libserialize traits librustc: fix bad imports in encoder/decoder add serialize dep to librustdoc fix failing run-pass tests w/ serialize dep adjust uuid dep more rebase de-clobbering for libserialize fixing tests, pushing libextra dep into cfg(test) fix doc code in extra::json adjust index.md links to serialize and uuid library
This is part of the overall strategy I would like to take when approaching issue #11165. The only two I/O objects that reasonably want to be "split" are the network stream objects. Everything else can be "split" by just creating another version. The initial idea I had was the literally split the object into a reader and a writer half, but that would just introduce lots of clutter with extra interfaces that were a little unnnecssary, or it would return a ~Reader and a ~Writer which means you couldn't access things like the remote peer name or local socket name. The solution I found to be nicer was to just clone the stream itself. The clone is just a clone of the handle, nothing fancy going on at the kernel level. Conceptually I found this very easy to wrap my head around (everything else supports clone()), and it solved the "split" problem at the same time. The cloning support is pretty specific per platform/lib combination: * native/win32 - uses some specific WSA apis to clone the SOCKET handle * native/unix - uses dup() to get another file descriptor * green/all - This is where things get interesting. When we support full clones of a handle, this implies that we're allowing simultaneous writes and reads to happen. It turns out that libuv doesn't support two simultaneous reads or writes of the same object. It does support *one* read and *one* write at the same time, however. Some extra infrastructure was added to just block concurrent writers/readers until the previous read/write operation was completed. I've added tests to the tcp/unix modules to make sure that this functionality is supported everywhere.
This replaces the imports from the prelude with the re-exported symbols.
I pushed this to try, and it works on everything but windows: http://buildbot.rust-lang.org/builders/try-win/builds/875 This also looks like it's picked up a few extra commits during the rebasings |
Unless there are any objections, I'll create a new branch and a new PR for this, probably early tomorrow. It should be easy enough to cherry-pick the two useful commits. |
fix: Remove `rust-analyzer.inlayHints.enable` and set language scope Closes rust-lang#12036 CC rust-lang/rust-analyzer#12027 (comment) The key was left there by mistake in rust-lang#12006. Setting the configuration scope only works if you already have it created, which is fine, but unfortunately not quite discoverable.
…ero, r=llogiq Don't warn about modulo arithmetic when comparing to zero closes rust-lang#12006 By default, don't warn about modulo arithmetic when comparing to zero. This behavior is configurable via `clippy.toml`. See discussion [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/.E2.9C.94.20Is.20issue.20.2312006.20worth.20implementing.3F) changelog: [`modulo_arithmetic`]: By default don't lint when comparing the result of a modulo operation to zero.
This replaces the imports from the prelude with the re-exported symbols, as requested in #11983.