about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2022-08-27Sunset RLSEric Huss-592/+162
2022-08-28Auto merge of #96946 - WaffleLapkin:ptr_mask, r=scottmcmbors-1/+87
Add pointer masking convenience functions This PR adds the following public API: ```rust impl<T: ?Sized> *const T { fn mask(self, mask: usize) -> *const T; } impl<T: ?Sized> *mut T { fn mask(self, mask: usize) -> *const T; } // mod intrinsics fn mask<T>(ptr: *const T, mask: usize) -> *const T ``` This is equivalent to `ptr.map_addr(|a| a & mask)` but also uses a cool llvm intrinsic. Proposed in https://github.com/rust-lang/rust/pull/95643#issuecomment-1121562352 cc `@Gankra` `@scottmcm` `@RalfJung` r? rust-lang/libs-api
2022-08-27Auto merge of #100591 - est31:stabilization_placeholder, r=Mark-Simulacrumbors-86/+271
Require stabilizations to use a placeholder instead of writing out stabilization version Implements the idea from [this](https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/libs.20stabilization.20placeholder) zulip stream. It's a common phenomenon that feature stabilizations don't make it into a particular release, but the version is still inaccurate. Often this is caught in the PR, but it can also require subsequent changes to adjust/correct the version. A list with examples of such PRs is given in #100577, but it's far from complete. This PR requires stabilization PRs to use the placeholder `CURRENT_RUSTC_VERSION`, enforced via tidy tooling. The PR also adds a tool that replaces the placeholder with the version number. It can be invoked via `./x.py run src/tools/replace-version-placeholder` and is supposed to be ran upon beta branching as well as version bumping and any backports to the beta branch. I filed PRs to the dev guide and forge to document these changes in the release and stabilization workflows: * The [dev guide](https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#determining-the-stabilization-version) PR: https://github.com/rust-lang/rustc-dev-guide/pull/1443 * The [std dev guide](https://std-dev-guide.rust-lang.org/) PR: https://github.com/rust-lang/std-dev-guide/pull/43 * The [forge](https://github.com/rust-lang/rust-forge) PR: https://github.com/rust-lang/rust-forge/pull/643 Alternative to #100577 which added checking.
2022-08-27Add replace-version-placeholder toolest31-1/+116
This tool is to be ran at specific points in the release process to replace the version place holder made by stabilizations with the version number.
2022-08-27tidy: move directory traversal utility functions into dedicated moduleest31-62/+74
2022-08-27Adjust label break value stabilization version to CURRENT_RUSTC_VERSIONest31-1/+1
2022-08-27Adjust backtrace stabilization version to CURRENT_RUSTC_VERSIONest31-13/+13
2022-08-27Adjust ptr_const_cast stabilization version to CURRENT_RUSTC_VERSIONest31-4/+4
2022-08-27Expand the version placeholder to the current version in stability attribute ↵est31-0/+8
parsing That way, the current version is shown in rustdoc etc.
2022-08-27tidy: forbid since values for features that point to the current release or ↵est31-5/+55
future ones It's a common phenomenon that feature stabilizations don't make it into a particular release, but the version is still inaccurate. Often this leads to subsequent changes to adjust/correct the version. Instead, require people to put a placeholder that gets replaced during beta branching time with the current rust version. That way, there is no chance that an error can be introduced. Usage of the placeholder is required on the nightly channel, and forbidden on the stable and beta channels.
2022-08-27Auto merge of #100999 - nnethercote:shrink-FnAbi, r=bjorn3bors-181/+165
Shrink `FnAbi` Because they can take up a lot of memory in debug and release builds. r? `@bjorn3`
2022-08-27Auto merge of #100989 - lcnr:implied-bounds-uwu, r=spastorinobors-1/+60
no unnormalized types for implied bounds outside borrowck fixes #100910 - introduced in https://github.com/rust-lang/rust/pull/100676 - by only considering normalized types for wf. r? types
2022-08-27Auto merge of #100946 - jyn514:query-system-3, r=cjgillotbors-16/+16
Simplify the arguments to macros generated by the `rustc_queries` proc macro Very small cleanup. Based on https://github.com/rust-lang/rust/pull/100436 which modifies some of the same code. r? `@cjgillot`
2022-08-27Auto merge of #101074 - JohnTitor:rollup-zwznihq, r=JohnTitorbors-147/+132
Rollup of 11 pull requests Successful merges: - #96240 (Stabilize `const_ptr_offset_from`.) - #99784 (Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by default) - #100811 (Fix wrong compiletest filters on Windows) - #100924 (Smaller improvements of tidy and the unicode generator) - #100953 (Update documentation for `write!` and `writeln!`) - #101018 (rustdoc: omit start/end tags for empty item description blocks) - #101044 (rustdoc: remove unused CSS for `hidden-by-*-hider`) - #101046 (rustdoc: remove incorrect CSS selector `.impl-items table td`) - #101057 (Merge implementations of HIR fn_decl and fn_sig.) - #101062 (rustdoc: remove empty extern_crates and type="text/javascript" on script) - #101063 (Merge duplicated CSS rules) Failed merges: - #101055 (Use smaller span for suggestions) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-27Rollup merge of #101063 - GuillaumeGomez:merge-duplicated-css, r=notriddleYuki Okushi-30/+8
Merge duplicated CSS rules I used the [stylelint](https://stylelint.io/user-guide/configure) tool to check for duplicated CSS rules in order to merge them. r? `@notriddle`
2022-08-27Rollup merge of #101062 - notriddle:notriddle/text-javascript, r=GuillaumeGomezYuki Okushi-5/+7
rustdoc: remove empty extern_crates and type="text/javascript" on script Like #101023, this removes an attribute with a default value.
2022-08-27Rollup merge of #101057 - cjgillot:one-fn-sig, r=compiler-errorsYuki Okushi-31/+9
Merge implementations of HIR fn_decl and fn_sig.
2022-08-27Rollup merge of #101046 - notriddle:notriddle/table-css, r=jshaYuki Okushi-1/+31
rustdoc: remove incorrect CSS selector `.impl-items table td` Fixes #100994 This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480. The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>. This rule was added to help with a `<table>` that was used for displaying the function signature [src] lockup. That lockup was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving this selector unused (at least, for its original purpose).
2022-08-27Rollup merge of #101044 - notriddle:notriddle/css-hidden-by, r=jshaYuki Okushi-6/+0
rustdoc: remove unused CSS for `hidden-by-*-hider` This CSS seems to have become obsolete with the move to `<details>` tags, and its corresponding JavaScript was removed in aee054d05d8b795d35c0b448a4b731b6507aa459
2022-08-27Rollup merge of #101018 - notriddle:notriddle/item-right-docblock-short, ↵Yuki Okushi-8/+16
r=GuillaumeGomez rustdoc: omit start/end tags for empty item description blocks Related to #100952 This is definitely not a complete solution, but it does shrink keysyms/index.html on smithay from 620K to 516K.
2022-08-27Rollup merge of #100953 - joshtriplett:write-docs, r=Mark-SimulacrumYuki Okushi-22/+21
Update documentation for `write!` and `writeln!` https://github.com/rust-lang/rust/pull/37472 added this documentation, but it needs updating: - Remove some documentation duplicated between `writeln!` and `write!` - Update `write!` docs: can now import traits as `_` to avoid conflicts - Expand example to show how to implement qualified trait names
2022-08-27Rollup merge of #100924 - est31:closure_to_fn_ptr, r=Mark-SimulacrumYuki Okushi-18/+17
Smaller improvements of tidy and the unicode generator
2022-08-27Rollup merge of #100811 - czzrr:master, r=Mark-SimulacrumYuki Okushi-1/+9
Fix wrong compiletest filters on Windows As discussed in [#79334](https://github.com/rust-lang/rust/issues/79334), when calling e.g. ``` python x.py test src/test/ui/expr/compound-assignment/eval-order.rs ``` on Windows, compiletest passes the filter `expr/compound-assignment/eval-order.rs` to libtest, which instead should be `expr\compound-assignment\eval-order.rs`, as that is the file found when collecting tests. This is what I fixed. I'm not sure how to organize a test for this. Any suggestions?
2022-08-27Rollup merge of #99784 - est31:deny_cfg_attr_crate_type_name, r=Mark-SimulacrumYuki Okushi-16/+9
Make forward compatibility lint deprecated_cfg_attr_crate_type_name deny by default Turns the forward compatibility lint added by #83744 to deprecate `cfg_attr` usage with `#![crate_type]` and `#![crate_name]` attributes into deny by default. Copying the example from #83744: ```Rust #![crate_type = "lib"] // remains working #![cfg_attr(foo, crate_type = "bin")] // will stop working ``` Over 8 months have passed since #83744 was merged so I'd say this gives ample time for people to have been warned, so we can make the warning stronger. No usage was found via grep.app except for one, which was in an unmaintained code base that didn't seem to be used in the open source eco system. The crater run conducted in #83744 also didn't show up anything. cc #91632 - tracking issue for the lint
2022-08-27Rollup merge of #96240 - fee1-dead-contrib:stabilize_const_offset_from, ↵Yuki Okushi-9/+5
r=Mark-Simulacrum Stabilize `const_ptr_offset_from`. Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848) with a FCP. Closes #92980.
2022-08-27Auto merge of #100732 - dpaoliello:import_name_type, r=wesleywiserbors-46/+614
Implementation of import_name_type Fixes #96534 by implementing https://github.com/rust-lang/compiler-team/issues/525 Symbols that are exported or imported from a binary on 32bit x86 Windows can be named in four separate ways, corresponding to the [import name types](https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#import-name-type) from the PE-COFF spec. The exporting and importing binaries must use the same name encoding, otherwise mismatches can lead to link failures due to "missing symbols" or to 0xc0000139 (`STATUS_ENTRYPOINT_NOT_FOUND`) errors when the executable/library is loaded. For details, see the comments on the raw-dylib feature's https://github.com/rust-lang/rust/issues/58713. To generate the correct import libraries for these DLLs, therefore, rustc must know the import name type for each `extern` function, and there is currently no way for users to provide this information. This change adds a new `MetaNameValueStr` key to the `#[link]` attribute called `import_name_type`, and which accepts one of three values: `decorated`, `noprefix`, and `undecorated`. A single DLL is likely to export all its functions using the same import type name, hence `import_name_type` is a parameter of `#[link]` rather than being its own attribute that is applied per-function. It is possible to have a single DLL that exports different functions using different import name types, but users could express such cases by providing multiple export blocks for the same DLL, each with a different import name type. Note: there is a fourth import name type defined in the PE-COFF spec, `IMPORT_ORDINAL`. This case is already handled by the `#[link_ordinal]` attribute. While it could be merged into `import_type_name`, that would not make sense as `#[link_ordinal]` provides per-function information (namely the ordinal itself). Design decisions (these match the MCP linked above): * For GNU, `decorated` matches the PE Spec and MSVC rather than the default behavior of `dlltool` (i.e., there will be a leading `_` for `stdcall`). * If `import_name_type` is not present, we will keep our current behavior of matching the environment (MSVC vs GNU) default for decorating. * Using `import_name_type` on architectures other than 32bit x86 will result in an error. * Using `import_name_type` with link kinds other than `"raw-dylib"` will result in an error.
2022-08-27Auto merge of #101064 - compiler-errors:rollup-fwm5m5f, r=compiler-errorsbors-927/+2445
Rollup of 9 pull requests Successful merges: - #100724 (Migrate ast lowering to session diagnostic) - #100735 (Migrate `rustc_ty_utils` to `SessionDiagnostic`) - #100738 (Diagnostics migr const eval) - #100744 (Migrate rustc_mir_dataflow to diagnostic structs) - #100776 (Migrate `rustc_lint` errors to `SessionDiagnostic`) - #100817 (sugg: suggest the usage of boolean value when there is a typo in the keyword) - #100836 (Migrate `rustc_attr` crate diagnostics) - #100890 (Migrate rustc_driver to SessionDiagnostic) - #100900 (on `region_errors.rs`) Failed merges: - #100831 (Migrate `symbol_mangling` module to new diagnostics structs) r? `@ghost` `@rustbot` modify labels: rollup
2022-08-26Rollup merge of #100900 - AndyJado:diag-migrate, r=davidtwcoMichael Goulet-76/+211
on `region_errors.rs` `@rustbot` label +A-translation
2022-08-26Rollup merge of #100890 - adriantombu:migrate_diagnostic_rustc_driver, ↵Michael Goulet-12/+95
r=davidtwco Migrate rustc_driver to SessionDiagnostic First timer noob here 👋🏽 I'm having a problem understanding how I can retrieve the span, and how to properly construct the error structs to avoid the current compilation errors. Any help pointing me in the right direction would be much appreciated 🙌🏽
2022-08-26Rollup merge of #100836 - hampuslidin:migrate-attr-crate-diagnostics, ↵Michael Goulet-217/+621
r=davidtwco Migrate `rustc_attr` crate diagnostics Hi! This is my first PR to the rustc project, excited to be part of the development! This PR is part of the diagnostics effort, to make diagnostics translatable. `@rustbot` label +A-translation
2022-08-26Rollup merge of #100817 - vincenzopalazzo:macros/bool_spelling_sugg, r=davidtwcoMichael Goulet-5/+59
sugg: suggest the usage of boolean value when there is a typo in the keyword Fixes https://github.com/rust-lang/rust/issues/100686 This adds a new suggestion when there is a well-known typo With the following program ```rust fn main() { let x = True; } ``` Now we have the following suggestion ``` error[E0425]: cannot find value `True` in this scope --> test.rs:2:13 | 2 | let x = True; | ^^^^ not found in this scope | help: you may want to use a bool value instead | 2 | let x = true; | ~~~~ error: aborting due to previous error ``` Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-08-26Rollup merge of #100776 - Rejyr:diagnostic-migration-rustc-lint, r=davidtwcoMichael Goulet-124/+297
Migrate `rustc_lint` errors to `SessionDiagnostic` Draft PR for migrating `rustc_lint` to `SessionDiagnostic`, as part of the [recent blog post](https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html)
2022-08-26Rollup merge of #100744 - 5225225:migrate-rustc-mir-dataflow, r=davidtwcoMichael Goulet-22/+129
Migrate rustc_mir_dataflow to diagnostic structs
2022-08-26Rollup merge of #100738 - nidnogg:diagnostics_migr_const_eval, r=davidtwcoMichael Goulet-115/+228
Diagnostics migr const eval This PR should eventually contain all diagnostic migrations for the `rustc_const_eval` crate. r? `@davidtwco` `@rustbot` label +A-translation
2022-08-26Rollup merge of #100735 - Facel3ss1:ty-utils-translation, r=davidtwcoMichael Goulet-94/+208
Migrate `rustc_ty_utils` to `SessionDiagnostic` I have migrated the `rustc_ty_utils` crate to use `SessionDiagnostic`, motivated by the [recent blog post about the diagnostic translation effort](https://blog.rust-lang.org/inside-rust/2022/08/16/diagnostic-effort.html). This is my first PR to the Rust repository, so if I have missed anything, or anything needs to be changed, please let me know! 😄 `@rustbot` label +A-translation
2022-08-26Rollup merge of #100724 - ↵Michael Goulet-262/+597
JeanCASPAR:migrate-ast_lowering-to-session-diagnostic, r=davidtwco Migrate ast lowering to session diagnostic I migrated the whole rustc_ast_lowering crate to session diagnostic *except* the for the use of `span_fatal` at /compiler/rustc_ast_lowering/src/expr.rs#L1268 because `#[fatal(...)]` is not yet supported (see https://github.com/rust-lang/rust/pull/100694).
2022-08-27Merge duplicated CSS rulesGuillaume Gomez-30/+8
2022-08-26rustdoc: remove empty extern_crates and type="text/javascript" on scriptMichael Howell-5/+7
Like #101023, this removes an attribute with a default value.
2022-08-26Auto merge of #100043 - RalfJung:scalar-always-init, r=RalfJungbors-935/+506
interpret: remove support for uninitialized scalars With Miri no longer supporting `-Zmiri-allow-uninit-numbers`, we no longer need to support storing uninit data in a `Scalar`. We anyway already only use this representation for types with *initialized* `Scalar` layout (and we have to, due to partial initialization), so let's get rid of the `ScalarMaybeUninit` type entirely. I tried to stage this into meaningful commits, but the one that changes `read_immediate` to always trigger UB on uninit is the largest chunk of the PR and I don't see how it could be subdivided. Fixes https://github.com/rust-lang/miri/issues/2187 r? `@oli-obk`
2022-08-26Merge implementations of HIR fn_decl and fn_sig.Camille GILLOT-31/+9
2022-08-26Auto merge of #101039 - ouz-a:issue-100991, r=compiler-errorsbors-1/+4
Don't catch overflow when running with cargo doc Fixes #100991 r? `@compiler-errors`
2022-08-26Don't catch overflow when running with cargo docouz-a-1/+4
2022-08-26remove now-unused ScalarMaybeUninitRalf Jung-134/+1
2022-08-26make read_immediate error immediately on uninit, so ImmTy can carry ↵Ralf Jung-747/+491
initialized Scalar
2022-08-26remove some now-unnecessary parameters from check_bytesRalf Jung-31/+7
2022-08-26remove enforce_number_init machine hook that Miri no longer needsRalf Jung-24/+8
2022-08-26fix an outdated machine hook nameRalf Jung-7/+7
2022-08-26Implementation of import_name_typeDaniel Paoliello-46/+614
2022-08-26rustdoc: remove incorrect CSS selector `.impl-items table td`Michael Howell-1/+31
Fixes #100994 This selector was added in c7312fbae4979c6d4fdfbd1f55a71cd47d82a480. The bug can be seen at <https://doc.rust-lang.org/1.27.0/alloc/slice/trait.SliceIndex.html#foreign-impls>. This rule was added to help with a `<table>` that was used for displaying the function signature [src] lockup. That lockup was changed in 34bd2b845b3acd84c5a9bddae3ff8081c19ec5e9 to use flexbox instead, leaving this selector unused (at least, for its original purpose).
2022-08-26Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiserbors-60/+184
session: stabilize split debuginfo on linux Stabilize the `-Csplit-debuginfo` flag... - ...on Linux for all values of the flag. Split DWARF has been implemented for a few months, hasn't had any bug reports and has had some promising benchmarking for incremental debug build performance. - ..on other platforms for the default value. It doesn't make any sense that `-Csplit-debuginfo=packed` is unstable on Windows MSVC when that's the default behaviour, but keep the other values unstable.