Enable 64-bit checked multiplication on 32-bit#12276
Merged
bors merged 1 commit intorust-lang:masterfrom Feb 15, 2014
Merged
Conversation
This was just waiting for compiler-rt support, which was added in rust-lang#12027 Closes rust-lang#8449
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 25, 2022
…f-impl, r=jonas-schievink feat: Improve "Generate `Deref` impl" assist Fixes rust-lang/rust-analyzer#12265 Fixes rust-lang/rust-analyzer#12266 The assist will now generate a `DerefMut` impl if a `Deref` impl is already present.
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Mar 7, 2024
…lyxyas Fix FP in `threadlocal!` when falling back to `os_local` **Issue**: The lint always triggers for some targets. **Why**: The lint assumes an `__init` function is not present for const initializers. This does not hold for all targets. Some targets always have an initializer function. **Fix**: If an initializer function exists, we check that it is not a `const` fn. Lint overview before the patch: 1. Outside `threadlocal!`, then exit early. 2. In `threadlocal!` and `__init` does not exist => is const already, exit early. 3. In `threadlocal!` and `__init` exists and `__init` body can be `const` => we lint. Lint overview after the patch: 1. Outside `threadlocal!`, then exit early. 2. In `threadlocal!` and `__init` does not exist => is const already, exit early. 3. In `threadlocal!` and `__init` exists and is `const fn` => is const already, exit early. 4. In `threadlocal!` and `__init` exists and is not `const fn` and `__init` body can be `const` => we lint. The patch adds step 3. changelog: Fixed fp in [`thread_local_initializer_can_be_made_const`] where fallback implementation of `threadlocal!` was always linted. ## Verifying the changes For each of these platforms [ mac, x86_64-windows-gnu, x86_64-windows-msvc ]: 1. switched to master, ran bless. Found a failure for windows-gnu. 2. switched to patch, ran bless. Success for all three platforms. ## How platform affects the lint: The compiler performs a [conditional compilation depending on platform features](https://doc.rust-lang.org/src/std/sys/common/thread_local/mod.rs.html). The `os_local` fallback includes a call to `__init`, without step 3, we lint in all cases. ```rust cfg_if::cfg_if! { if #[cfg(any(all(target_family = "wasm", not(target_feature = "atomics")), target_os = "uefi"))] { #[doc(hidden)] mod static_local; #[doc(hidden)] pub use static_local::{Key, thread_local_inner}; } else if #[cfg(target_thread_local)] { #[doc(hidden)] mod fast_local; #[doc(hidden)] pub use fast_local::{Key, thread_local_inner}; } else { #[doc(hidden)] mod os_local; #[doc(hidden)] pub use os_local::{Key, thread_local_inner}; } } ``` r? `@llogiq`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This was just waiting for compiler-rt support, which was added in #12027
Closes #8449