-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 16 pull requests #55789
Rollup of 16 pull requests #55789
Conversation
The new levels s and z are not mentioned as possible values.
Implement the rotate_left and rotate_right operations using llvm.fshl and llvm.fshr if they are available (LLVM >= 7). Originally I wanted to expose the funnel_shift_left and funnel_shift_right intrinsics and implement rotate_left and rotate_right on top of them. However, emulation of funnel shifts requires emitting a conditional to check for zero shift amount, which is not necessary for rotates. I was uncomfortable doing that here, as I don't want to rely on LLVM to optimize away that conditional (and for variable rotates, I'm not sure it can). We should revisit that question when we raise our minimum version requirement to LLVM 7 and don't need emulation code anymore.
As a drive-by, added `-g` to the compile-flags so that the test more reliably fails to compile when the extern static in question is *not* provided. (I.e. this is making the test more robust in the face of potential future revisions.) Fix rust-lang#54388.
This makes it easier to debug mis-optimizations that occur during inlining. Thanks to @nikomatsakis for the suggestion!
This commit filters out locals that have never been initialized for consideration in the `unused_mut` lint. This is intended to detect when the statement that would have initialized the local was removed as unreachable code. In these cases, we would not want to lint. This is the same behaviour as the AST borrow checker. This is achieved by taking advantage of an existing pass over the MIR for the `unused_mut` lint and creating a set of those locals that were never initialized.
This is a (much) more constrained version of rust-lang#54772 that also aims at improving the situation in rust-lang#34681. It removes any font specifications that are not the "official" rustdoc font, and instead relies on the browser to provide the fallback font if the official on is not available. On Linux systems, this is particularly important, as fonts like Helvetica, Arial, and Times often look pretty bad since they're pulled from extracted MS fonts. A specification like `serif` or `sans-serif` lets the browser instead choose a good font.
The `wasm32-unknown-emscripten` expects the `rust_eh_personality` symbol to be there, but a cfg checking for `target_arch = "wasm32"` which was meant to remove the symbol from the `wasm32-unknown-unknown` target, didn't check for whether `emscripten` is targeted or not, so the symbol accidentally got filtered out there as well. Fixes rust-lang#55276
Currently Cargo will always capture the output of rustc meaning that rustc is never hooked up to a tty. To retain colors Cargo uses the `fwdansi` crate to ensure that ansi color codes are translated to windows terminal methods (and ansi codes otherwise just go their natural route on Unix). Cargo passes `--color always` to rustc to ensure that using a pipe doesn't trick it into not emitting colors at all. It turns out, however, that `--color always` ends up still accidentally using the native shell api on native windows shells. The fix here is to instead pass `AlwaysAnsi` to `termcolor` instead of `Always`, ensuring that when `--color always` is passed to rustc and its output isn't a terminal, we're always generating ansi colors regardless of the platform. Closes rust-lang#55769
of LLVM's Target Datalayout. https://llvm.org/docs/LangRef.html#data-layout
Support for the program data address space option of LLVM's Target Datalayout This was introduced recently (specifically, for AVR, cc @dylanmckay). (I came up with this when attempting to run [avr-rust](https://github.com/avr-rust/rust) rebased on the latest [rust-lang](https://github.com/rust-lang/rust) commits. If this requires a different design, some additional discussions, or is not something to pursue right now, I'd be happy to close this PR). Note that this somewhat overlaps with @DiamondLovesYou's rust-lang#51576, I think, although the implementation here is significantly simpler: Since the address space applies to _all_ program data, we can just check the pointee's type whenever we create an LLVM pointer type. If it is a function we use the program data address space; if not we use the default address space. cc @eddyb, who has been reviewing rust-lang#51576 Ref: https://llvm.org/docs/LangRef.html#data-layout
…ramertj Clarify error message for -C opt-level The new levels s and z are not mentioned as possible values.
…g_span_from_free_region, r=estebank Fix ICE in msg_span_from_free_region on ReEmpty On an example like this: ```rust #![feature(conservative_impl_trait)] fn server() -> impl FilterBase2 { segment2(|| { loop { } }).map2(|| "") } trait FilterBase2 { fn map2<F>(self, _fn: F) -> Map2<F> where Self: Sized { loop { } } } struct Map2<F> { _func: F } impl<F> FilterBase2 for Map2<F> { } fn segment2<F>(_fn: F) -> Map2<F> where F: Fn() -> Result<(), ()> { loop { } } ``` we now, instead of ICE'ing, get a diagnostic like: ``` error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds --> issue-55608.rs:3:16 | 3 | fn server() -> impl FilterBase2 { | ^^^^^^^^^^^^^^^^ | = note: hidden type `Map2<[closure@issue-55608.rs:4:36: 4:41]>` captures an empty lifetime ``` Fix rust-lang#55608
Implement rotate using funnel shift on LLVM >= 7 Implement the rotate_left and rotate_right operations using llvm.fshl and llvm.fshr if they are available (LLVM >= 7). Originally I wanted to expose the funnel_shift_left and funnel_shift_right intrinsics and implement rotate_left and rotate_right on top of them. However, emulation of funnel shifts requires emitting a conditional to check for zero shift amount, which is not necessary for rotates. I was uncomfortable doing that here, as I don't want to rely on LLVM to optimize away that conditional (and for variable rotates, I'm not sure it can). We should revisit that question when we raise our minimum version requirement to LLVM 7 and don't need emulation code anymore. Fixes rust-lang#52457.
miri: accept extern types in structs if they are the only field Fixes rust-lang#55541 Cc @oli-obk @eddyb rust-lang#43467
…error-from-rustfixed-code, r=alexcrichton Sidestep link error from rustfix'ed code by using a *defined* static. As a drive-by, added `-g` to the compile-flags so that the test more reliably fails to compile when the extern static in question is *not* provided. (I.e. this is making the test more robust in the face of potential future revisions.) Fix rust-lang#54388.
impl_stable_hash_for: support enums and tuple structs with generic parameters Port a bunch of implementations over to the macro, now that that is possible.
Elide anon lifetimes in conflicting impl note Fix rust-lang#54690.
…matsakis Consume optimization fuel from the MIR inliner This makes it easier to debug mis-optimizations that occur during inlining. Thanks to @nikomatsakis for the suggestion!
…li-obk borrow_set: remove a helper function and a clone it uses This clone doesn't seem necessary. r? @oli-obk
Improve creation of 3 IndexVecs - preallocate when the minimal size is known - use `from_elem_n` instead of `new`+`resize`
[regression - rust2018]: unused_mut lint false positives on nightly Fixes rust-lang#55344. This commit filters out locals that have never been initialized for consideration in the `unused_mut` lint. This is intended to detect when the statement that would have initialized the local was removed as unreachable code. In these cases, we would not want to lint. This is the same behaviour as the AST borrow checker. This is achieved by taking advantage of an existing pass over the MIR for the `unused_mut` lint and creating a set of those locals that were never initialized. r? @pnkfelix
…llaumeGomez Remove intermediate font specs This is a (much) more constrained version of rust-lang#54772 that also aims at improving the situation in rust-lang#34681. It removes any font specifications that are not the "official" rustdoc font, and instead relies on the browser to provide the fallback font if the official on is not available. On Linux systems, this is particularly important, as fonts like Helvetica, Arial, and Times often look pretty bad since they're pulled from extracted MS fonts. A specification like `serif` or `sans-serif` lets the browser instead choose a good font.
…r=estebank mir: remove a hacky recursive helper function It can be replaced with a `while let` loop.
wasm32-unknown-emscripten expects the rust_eh_personality symbol The `wasm32-unknown-emscripten` expects the `rust_eh_personality` symbol to be there, but a cfg checking for `target_arch = "wasm32"` which was meant to remove the symbol from the `wasm32-unknown-unknown` target, didn't check for whether `emscripten` is targeted or not, so the symbol accidentally got filtered out there as well. Fixes rust-lang#55276
rustc: Request ansi colors if stderr isn't a tty Currently Cargo will always capture the output of rustc meaning that rustc is never hooked up to a tty. To retain colors Cargo uses the `fwdansi` crate to ensure that ansi color codes are translated to windows terminal methods (and ansi codes otherwise just go their natural route on Unix). Cargo passes `--color always` to rustc to ensure that using a pipe doesn't trick it into not emitting colors at all. It turns out, however, that `--color always` ends up still accidentally using the native shell api on native windows shells. The fix here is to instead pass `AlwaysAnsi` to `termcolor` instead of `Always`, ensuring that when `--color always` is passed to rustc and its output isn't a terminal, we're always generating ansi colors regardless of the platform. Closes rust-lang#55769
@bors r+ p=16 |
📌 Commit de60b44 has been approved by |
⌛ Testing commit de60b44 with merge 034b7941f6749ffa686a83aa27606b828607fdbd... |
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 |
💔 Test failed - status-travis |
Successful merges:
Failed merges:
r? @ghost