-
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 5 pull requests #102908
Rollup of 5 pull requests #102908
Commits on Oct 6, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 99182dd - Browse repository at this point
Copy the full SHA 99182ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0ad4dd4 - Browse repository at this point
Copy the full SHA 0ad4dd4View commit details
Commits on Oct 7, 2022
-
ADD - codegen_ssa initial diags translations machinery
ADD - migrate MissingNativeStaticLibrary fatal error
Configuration menu - View commit details
-
Copy full SHA for b0b072d - Browse repository at this point
Copy the full SHA b0b072dView commit details -
ADD - migrate lib.def write fatal error
This diagnostic has no UI test 🤔 Should we add some? If so, how?
Configuration menu - View commit details
-
Copy full SHA for 4e0de53 - Browse repository at this point
Copy the full SHA 4e0de53View commit details -
UPDATE - LibDefWriteFailure to accept type instead of formatted string
This follows team’s suggestions in this thread https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20diag.20translation/near/295305249
Configuration menu - View commit details
-
Copy full SHA for 0a2d7f8 - Browse repository at this point
Copy the full SHA 0a2d7f8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 086e70f - Browse repository at this point
Copy the full SHA 086e70fView commit details -
Configuration menu - View commit details
-
Copy full SHA for d9197db - Browse repository at this point
Copy the full SHA d9197dbView commit details -
Configuration menu - View commit details
-
Copy full SHA for 67eb01c - Browse repository at this point
Copy the full SHA 67eb01cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7548d95 - Browse repository at this point
Copy the full SHA 7548d95View commit details -
Configuration menu - View commit details
-
Copy full SHA for 0f97d4a - Browse repository at this point
Copy the full SHA 0f97d4aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 12aa84b - Browse repository at this point
Copy the full SHA 12aa84bView commit details -
- UPDATE - revert migration of logs - UPDATE - use derive on LinkRlibError enum - [Gardening] UPDATE - alphabetically sort fluent_messages - UPDATE - use PathBuf and unify both AddNativeLibrary to use Display (which is what PathBuf uses when conforming to IntoDiagnosticArg) - UPDATE - fluent messages sort after rebase
Configuration menu - View commit details
-
Copy full SHA for a25f939 - Browse repository at this point
Copy the full SHA a25f939View commit details -
Configuration menu - View commit details
-
Copy full SHA for 13d4f27 - Browse repository at this point
Copy the full SHA 13d4f27View commit details
Commits on Oct 8, 2022
-
Configuration menu - View commit details
-
Copy full SHA for b4c8a7b - Browse repository at this point
Copy the full SHA b4c8a7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for c320ab9 - Browse repository at this point
Copy the full SHA c320ab9View commit details
Commits on Oct 10, 2022
-
Small tweaks to changes made in a previous PR, unrelated to eager translation. Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for febbf71 - Browse repository at this point
Copy the full SHA febbf71View commit details -
errors: use
HashMap
to store diagnostic argsEager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`. Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 508d7e6 - Browse repository at this point
Copy the full SHA 508d7e6View commit details -
errors:
AddToDiagnostic::add_to_diagnostic_with
`AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for b4ac262 - Browse repository at this point
Copy the full SHA b4ac262View commit details -
errors:
DiagnosticMessage::Eager
Add variant of `DiagnosticMessage` for eagerly translated messages (messages in the target language which don't need translated by the emitter during emission). Also adds `eager_subdiagnostic` function which is intended to be invoked by the diagnostic derive for subdiagnostic fields which are marked as needing eager translation. Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 540b203 - Browse repository at this point
Copy the full SHA 540b203View commit details -
macros:
#[subdiagnostic(eager)]
Add support for `eager` argument to the `subdiagnostic` attribute which generates a call to `eager_subdiagnostic`. Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 291a473 - Browse repository at this point
Copy the full SHA 291a473View commit details -
query_system: finish migration
Using eager translation, migrate the remaining repeated cycle stack diagnostic. Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 113e943 - Browse repository at this point
Copy the full SHA 113e943View commit details -
macros: separate suggestion fmt'ing and emission
Diagnostic derives have previously had to take special care when ordering the generated code so that fields were not used after a move. This is unlikely for most fields because a field is either annotated with a subdiagnostic attribute and is thus likely a `Span` and copiable, or is a argument, in which case it is only used once by `set_arg` anyway. However, format strings for code in suggestions can result in fields being used after being moved if not ordered carefully. As a result, the derive currently puts `set_arg` calls last (just before emission), such as: ```rust let diag = { /* create diagnostic */ }; diag.span_suggestion_with_style( span, fluent::crate::slug, format!("{}", __binding_0), Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.emit(); ``` For eager translation, this doesn't work, as the message being translated eagerly can assume that all arguments are available - so arguments _must_ be set first. Format strings for suggestion code are now separated into two parts - an initialization line that performs the formatting into a variable, and a usage in the subdiagnostic addition. By separating these parts, the initialization can happen before arguments are set, preserving the desired order so that code compiles, while still enabling arguments to be set before subdiagnostics are added. ```rust let diag = { /* create diagnostic */ }; let __code_0 = format!("{}", __binding_0); /* + other formatting */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.span_suggestion_with_style( span, fluent::crate::slug, __code_0, Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.emit(); ``` Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 7e20929 - Browse repository at this point
Copy the full SHA 7e20929View commit details -
macros: simplify field ordering in diag derive
Following the approach taken in earlier commits to separate formatting initialization from use in the subdiagnostic derive, simplify the diagnostic derive by removing the field-ordering logic that previously solved this problem. Signed-off-by: David Wood <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for fbac1f2 - Browse repository at this point
Copy the full SHA fbac1f2View commit details -
Allow compiling the
wasm32-wasi
std library with atomicsThe issue rust-lang#102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes rust-lang#102157.
Configuration menu - View commit details
-
Copy full SHA for da638b3 - Browse repository at this point
Copy the full SHA da638b3View commit details -
Implement
env_lock
withRwLock
Copying the approach of the Unix target, this change uses the standard `RwLock` to protect against concurrent access of libc's environment. This locking is only enabled when WebAssembly's `atomics` feature is also enabled.
Configuration menu - View commit details
-
Copy full SHA for 9530ba0 - Browse repository at this point
Copy the full SHA 9530ba0View commit details -
rustdoc: remove unneeded
<div>
wrapper from sidebar DOMWhen this was added, the sidebar had a bit more complex style. It can be removed, now.
Configuration menu - View commit details
-
Copy full SHA for b63b02f - Browse repository at this point
Copy the full SHA b63b02fView commit details
Commits on Oct 11, 2022
-
Configuration menu - View commit details
-
Copy full SHA for 44f466c - Browse repository at this point
Copy the full SHA 44f466cView commit details -
Rollup merge of rust-lang#102372 - abrown:issue-102157, r=thomcc
Allow compiling the `wasm32-wasi` std library with atomics The issue rust-lang#102157 demonstrates how currently the `-Z build-std` option will fail when re-compiling the standard library with `RUSTFLAGS` like `RUSTFLAGS="-C target-feature=+atomics,+bulk-memory -C link-args=--shared-memory"`. This change attempts to resolve those build issues by depending on the the WebAssembly `futex` module and providing an implementation for `env_lock`. Fixes rust-lang#102157.
Configuration menu - View commit details
-
Copy full SHA for ac478d4 - Browse repository at this point
Copy the full SHA ac478d4View commit details -
Rollup merge of rust-lang#102612 - JhonnyBillM:migrate-codegen-ssa-to…
…-diagnostics-structs, r=davidtwco Migrate `codegen_ssa` to diagnostics structs - [Part 1] Initial migration of `codegen_ssa`. Going to split this crate migration in at least two PRs in order to avoid a huge PR and to quick off some questions around: 1. Translating messages from "external" crates. 2. Interfacing with OS messages. 3. Adding UI tests while migrating diagnostics. _See comments below._
Configuration menu - View commit details
-
Copy full SHA for 4fb3495 - Browse repository at this point
Copy the full SHA 4fb3495View commit details -
Rollup merge of rust-lang#102623 - davidtwco:translation-eager, r=com…
…piler-errors translation: eager translation Part of rust-lang#100717. See [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/336883-i18n/topic/.23100717.20lists!/near/295010720) for additional context. - **Store diagnostic arguments in a `HashMap`**: Eager translation will enable subdiagnostics to be translated multiple times with different arguments - this requires the ability to replace the value of one argument with a new value, which is better suited to a `HashMap` than the previous storage, a `Vec`. - **Add `AddToDiagnostic::add_to_diagnostic_with`**: `AddToDiagnostic::add_to_diagnostic_with` is similar to the previous `AddToDiagnostic::add_to_diagnostic` but takes a function that can be used by the caller to modify diagnostic messages originating from the subdiagnostic (such as performing translation eagerly). `add_to_diagnostic` now just calls `add_to_diagnostic_with` with an empty closure. - **Add `DiagnosticMessage::Eager`**: Add variant of `DiagnosticMessage` for eagerly translated messages (messages in the target language which don't need translated by the emitter during emission). Also adds `eager_subdiagnostic` function which is intended to be invoked by the diagnostic derive for subdiagnostic fields which are marked as needing eager translation. - **Support `#[subdiagnostic(eager)]`**: Add support for `eager` argument to the `subdiagnostic` attribute which generates a call to `eager_subdiagnostic`. - **Finish migrating `rustc_query_system`**: Using eager translation, migrate the remaining repeated cycle stack diagnostic. - **Split formatting initialization and use in diagnostic derives**: Diagnostic derives have previously had to take special care when ordering the generated code so that fields were not used after a move. This is unlikely for most fields because a field is either annotated with a subdiagnostic attribute and is thus likely a `Span` and copiable, or is a argument, in which case it is only used once by `set_arg` anyway. However, format strings for code in suggestions can result in fields being used after being moved if not ordered carefully. As a result, the derive currently puts `set_arg` calls last (just before emission), such as: let diag = { /* create diagnostic */ }; diag.span_suggestion_with_style( span, fluent::crate::slug, format!("{}", __binding_0), Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.emit(); For eager translation, this doesn't work, as the message being translated eagerly can assume that all arguments are available - so arguments _must_ be set first. Format strings for suggestion code are now separated into two parts - an initialization line that performs the formatting into a variable, and a usage in the subdiagnostic addition. By separating these parts, the initialization can happen before arguments are set, preserving the desired order so that code compiles, while still enabling arguments to be set before subdiagnostics are added. let diag = { /* create diagnostic */ }; let __code_0 = format!("{}", __binding_0); /* + other formatting */ diag.set_arg("foo", __binding_0); /* + other `set_arg` calls */ diag.span_suggestion_with_style( span, fluent::crate::slug, __code_0, Applicability::Unknown, SuggestionStyle::ShowAlways ); /* + other subdiagnostic additions */ diag.emit(); - **Remove field ordering logic in diagnostic derive:** Following the approach taken in earlier commits to separate formatting initialization from use in the subdiagnostic derive, simplify the diagnostic derive by removing the field-ordering logic that previously solved this problem. r? `@compiler-errors`
Configuration menu - View commit details
-
Copy full SHA for a5dbef4 - Browse repository at this point
Copy the full SHA a5dbef4View commit details -
Rollup merge of rust-lang#102773 - joboet:apple_parker, r=thomcc
Use semaphores for thread parking on Apple platforms Currently we use a mutex-condvar pair for thread parking on Apple systems. Unfortunately, `pthread_cond_timedwait` uses the real-time clock for measuring time, which causes problems when the system time changes. The parking implementation in this PR uses a semaphore instead, which measures monotonic time by default, avoiding these issues. As a further benefit, this has the potential to improve performance a bit, since `unpark` does not need to wait for a lock to be released. Since the Mach semaphores are poorly documented (I could not find availability or stability guarantees for instance), this uses a [dispatch semaphore](https://developer.apple.com/documentation/dispatch/dispatch_semaphore?language=objc) instead. While it adds a layer of indirection (it uses Mach semaphores internally), the overhead is probably negligible. Tested on macOS 12.5. r? `@thomcc`
Configuration menu - View commit details
-
Copy full SHA for e5faada - Browse repository at this point
Copy the full SHA e5faadaView commit details -
Rollup merge of rust-lang#102898 - notriddle:notriddle/sidebar-block,…
… r=GuillaumeGomez rustdoc: remove unneeded `<div>` wrapper from sidebar DOM When this was added, the sidebar had a bit more complex style. It can be removed, now. Preview: https://notriddle.com/notriddle-rustdoc-demos/sidebar-block/std/index.html
Configuration menu - View commit details
-
Copy full SHA for 0f7b622 - Browse repository at this point
Copy the full SHA 0f7b622View commit details