-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 8 pull requests #117309
Rollup of 8 pull requests #117309
Commits on Oct 8, 2023
-
Configuration menu - View commit details
-
Copy full SHA for e960d0e - Browse repository at this point
Copy the full SHA e960d0eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8531ebf - Browse repository at this point
Copy the full SHA 8531ebfView commit details
Commits on Oct 16, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 3733316 - Browse repository at this point
Copy the full SHA 3733316View commit details
Commits on Oct 25, 2023
-
add note change wording short_ty_string on t
Configuration menu - View commit details
-
Copy full SHA for 991bf75 - Browse repository at this point
Copy the full SHA 991bf75View commit details
Commits on Oct 26, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 828f069 - Browse repository at this point
Copy the full SHA 828f069View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1ef96a9 - Browse repository at this point
Copy the full SHA 1ef96a9View commit details
Commits on Oct 27, 2023
-
Configuration menu - View commit details
-
Copy full SHA for b7debe3 - Browse repository at this point
Copy the full SHA b7debe3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 84a1a68 - Browse repository at this point
Copy the full SHA 84a1a68View commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ef5897 - Browse repository at this point
Copy the full SHA 2ef5897View commit details -
When encountering sealed traits, point types that implement it
``` error[E0277]: the trait bound `S: d::Hidden` is not satisfied --> $DIR/sealed-trait-local.rs:53:20 | LL | impl c::Sealed for S {} | ^ the trait `d::Hidden` is not implemented for `S` | note: required by a bound in `c::Sealed` --> $DIR/sealed-trait-local.rs:17:23 | LL | pub trait Sealed: self::d::Hidden { | ^^^^^^^^^^^^^^^ required by this bound in `Sealed` = note: `Sealed` is a "sealed trait", because to implement it you also need to implement `c::d::Hidden`, which is not accessible; this is usually done to force you to use one of the provided types that already implement it = help: the following types implement the trait: - c::X - c::Y ``` The last `help` is new.
Configuration menu - View commit details
-
Copy full SHA for 6dbad23 - Browse repository at this point
Copy the full SHA 6dbad23View commit details -
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
Configuration menu - View commit details
-
Copy full SHA for a65d99d - Browse repository at this point
Copy the full SHA a65d99dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 98c469c - Browse repository at this point
Copy the full SHA 98c469cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3feec48 - Browse repository at this point
Copy the full SHA 3feec48View commit details -
Streamline
rustc_interface
tests.In `test_edition_parsing`, change the `build_session_options_and_crate_config` call to `build_session_options`, because the config isn't used. That leaves a single call site for `build_session_options_and_crate_config`, so just inline and remove it.
Configuration menu - View commit details
-
Copy full SHA for 2142d01 - Browse repository at this point
Copy the full SHA 2142d01View commit details -
Change
CrateConfig
fromFxIndexSet
toFxHashSet
.Because its order doesn't matter. This is well demonstrated by `to_crate_config`, which creates a `CrateConfig` from an `FxHashSet`.
Configuration menu - View commit details
-
Copy full SHA for 32986d8 - Browse repository at this point
Copy the full SHA 32986d8View commit details -
In `parse_cfg`, we now construct a `FxHashSet<String>` directly instead of constructing a `FxHashSet<Symbol>` and then immediately converting it to a `FxHashSet<String>`(!) (The type names made this behaviour non-obvious. The next commit will make the type names clearer.)
Configuration menu - View commit details
-
Copy full SHA for 75e415b - Browse repository at this point
Copy the full SHA 75e415bView commit details -
`parse_cfgspecs` and `parse_check_cfg` run very early, before the main interner is running. They each use a short-lived interner and convert all interned symbols to strings in their output data structures. Once the main interner starts up, these data structures get converted into new data structures that are identical except with the strings converted to symbols. All is not obvious from the current code, which is a mess, particularly with inconsistent naming that obscures the parallel string/symbol data structures. This commit clean things up a lot. - The existing `CheckCfg` type is generic, allowing both `CheckCfg<String>` and `CheckCfg<Symbol>` forms. This is really useful, but it defaults to `String`. The commit removes the default so we have to use `CheckCfg<String>` and `CheckCfg<Symbol>` explicitly, which makes things clearer. - Introduces `Cfg`, which is generic over `String` and `Symbol`, similar to `CheckCfg`. - Renames some things. - `parse_cfgspecs` -> `parse_cfg` - `CfgSpecs` -> `Cfg<String>`, plus it's used in more places, rather than the underlying `FxHashSet` type. - `CrateConfig` -> `Cfg<Symbol>`. - `CrateCheckConfig` -> `CheckCfg<Symbol>` - Adds some comments explaining the string-to-symbol conversions. - `to_crate_check_config`, which converts `CheckCfg<String>` to `CheckCfg<Symbol>`, is inlined and removed and combined with the overly-general `CheckCfg::map_data` to produce `CheckCfg::<String>::intern`. - `build_configuration` now does the `Cfg<String>`-to-`Cfg<Symbol>` conversion, so callers don't need to, which removes the need for `to_crate_config`. The diff for two of the fields in `Config` is a good example of the improved clarity: ``` - pub crate_cfg: FxHashSet<(String, Option<String>)>, - pub crate_check_cfg: CheckCfg, + pub crate_cfg: Cfg<String>, + pub crate_check_cfg: CheckCfg<String>, ``` Compare that with the diff for the corresponding fields in `ParseSess`, and the relationship to `Config` is much clearer than before: ``` - pub config: CrateConfig, - pub check_config: CrateCheckConfig, + pub config: Cfg<Symbol>, + pub check_config: CheckCfg<Symbol>, ```
Configuration menu - View commit details
-
Copy full SHA for 5e54997 - Browse repository at this point
Copy the full SHA 5e54997View commit details -
Change
Cfg<T>
to anFxIndexSet
.Despite what I claimed in an earlier commit, the ordering does matter to some degree. Using `FxIndexSet` prevents changes to the error message order in `tests/ui/check-cfg/mix.rs`.
Configuration menu - View commit details
-
Copy full SHA for 5438004 - Browse repository at this point
Copy the full SHA 5438004View commit details
Commits on Oct 28, 2023
-
Rollup merge of rust-lang#116534 - cjgillot:no-dep-tasks, r=davidtwco
Remove -Zdep-tasks. This option is not useful any more, we can use `tracing` and `RUSTC_LOG` to debug the dep-graph.
Configuration menu - View commit details
-
Copy full SHA for 975d042 - Browse repository at this point
Copy the full SHA 975d042View commit details -
Rollup merge of rust-lang#116739 - Milo123459:milo/short-paths, r=est…
…ebank Make `E0277` use short paths Fixes rust-lang#116616
Configuration menu - View commit details
-
Copy full SHA for 471e33f - Browse repository at this point
Copy the full SHA 471e33fView commit details -
Rollup merge of rust-lang#116816 - ChrisDenton:api.rs, r=workingjubilee
Create `windows/api.rs` for safer FFI FFI is inherently unsafe. For memory safety we need to assert that some contract is being upheld on both sides of the FFI, though of course we can only ever check our side. In Rust, `unsafe` blocks are used to assert safety and `// SAFETY` comments describing why it is safe. Currently in sys/windows we have a lot of this unsafety spread all over the place, with variations on the same unsafe patterns repeated. And because of the repitition and frequency, we're a bit lax with the safety comments. This PR aims to fix this and to make FFI safety more auditable by creating an `api` module with the goal of centralising and consolidating this unsafety. It contains thin wrappers around the Windows API that make most functions safe to call or, if that's not possible, then at least safer. Note that its goal is *only* to address safety. It does not stray far from the Windows API and intentionally does not attempt to make higher lever wrappers around, for example, file handles. This is better left to the existing modules. The windows/api.rs file has a top level comment to help future contributors understand the intent of the module and the design decisions made. I chose two functions as a first tentative step towards the above goal: - [`GetLastError`](https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-getlasterror) is trivially safe. There's no reason to wrap it in an `unsafe` block every time. So I simply created a safe `get_last_error` wrapper. - [`SetFileInformationByHandle`](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfileinformationbyhandle) is more complex. It essentially takes a generic type but over a C API which necessitates some amount of ceremony. Rather than implementing similar unsafe patterns in multiple places, I provide a safe `set_file_information_by_handle` that takes a Rusty generic type and handles converting that to the form required by the C FFI. r? libs
Configuration menu - View commit details
-
Copy full SHA for d87b5e4 - Browse repository at this point
Copy the full SHA d87b5e4View commit details -
Rollup merge of rust-lang#116945 - estebank:sealed-trait-impls, r=pet…
…rochenkov When encountering sealed traits, point types that implement it ``` error[E0277]: the trait bound `S: d::Hidden` is not satisfied --> $DIR/sealed-trait-local.rs:53:20 | LL | impl c::Sealed for S {} | ^ the trait `d::Hidden` is not implemented for `S` | note: required by a bound in `c::Sealed` --> $DIR/sealed-trait-local.rs:17:23 | LL | pub trait Sealed: self::d::Hidden { | ^^^^^^^^^^^^^^^ required by this bound in `Sealed` = note: `Sealed` is a "sealed trait", because to implement it you also need to implement `c::d::Hidden`, which is not accessible; this is usually done to force you to use one of the provided types that already implement it = help: the following types implement the trait: - c::X - c::Y ``` The last `help` is new.
Configuration menu - View commit details
-
Copy full SHA for 9f631d0 - Browse repository at this point
Copy the full SHA 9f631d0View commit details -
Rollup merge of rust-lang#117025 - Urgau:cleanup-improve-check-cfg-im…
…pl, r=petrochenkov Cleanup and improve `--check-cfg` implementation This PR removes some indentation in the code, as well as preventing some bugs/misusages and fix a nit in the doc. r? ```@petrochenkov``` (maybe)
Configuration menu - View commit details
-
Copy full SHA for 87a564d - Browse repository at this point
Copy the full SHA 87a564dView commit details -
Rollup merge of rust-lang#117256 - dtolnay:currentversion, r=compiler…
…-errors Parse rustc version at compile time This PR eliminates a couple awkward codepaths where it was not clear how the compiler should proceed if its own version number is incomprehensible. https://github.com/rust-lang/rust/blob/dab715641e96a61a534587fda9de1128b75b34dc/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs#L385 https://github.com/rust-lang/rust/blob/dab715641e96a61a534587fda9de1128b75b34dc/compiler/rustc_attr/src/builtin.rs#L630 We can guarantee that every compiled rustc comes with a working version number, so the ICE codepaths above shouldn't need to be written.
Configuration menu - View commit details
-
Copy full SHA for 1db8c9d - Browse repository at this point
Copy the full SHA 1db8c9dView commit details -
Rollup merge of rust-lang#117268 - nnethercote:rustc_interface, r=oli…
…-obk `rustc_interface` cleanups Particularly in and around `--cfg` and `--check-cfg` handling. r? `@oli-obk`
Configuration menu - View commit details
-
Copy full SHA for 48a3865 - Browse repository at this point
Copy the full SHA 48a3865View commit details -
Rollup merge of rust-lang#117277 - RalfJung:too-big-with-padding, r=o…
…li-obk fix failure to detect a too-big-type after adding padding Fixes rust-lang#117265
Configuration menu - View commit details
-
Copy full SHA for 09fd68d - Browse repository at this point
Copy the full SHA 09fd68dView commit details