-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #134844
Rollup of 5 pull requests #134844
Conversation
Detect when a manual `Default` implementation isn't using the existing default field values and suggest using `..` instead: ``` error: `Default` impl doesn't use the declared default field values --> $DIR/manual-default-impl-could-be-derived.rs:14:1 | LL | / impl Default for A { LL | | fn default() -> Self { LL | | A { LL | | y: 0, | | - this field has a default value ... | LL | | } | |_^ | = help: use the default values in the `impl` with `Struct { mandatory_field, .. }` to avoid them diverging over time note: the lint level is defined here --> $DIR/manual-default-impl-could-be-derived.rs:5:9 | LL | #![deny(default_overrides_default_fields)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ```
Nothing significant here, just syncing the following small changes: - rust-lang/compiler-builtins#727 - rust-lang/compiler-builtins#730 - rust-lang/compiler-builtins#736 - rust-lang/compiler-builtins#737
The old FIXME implies that we don't support escaped newlines, but in fact it was added in the same patch that added support for escaped newlines. The new FIXME makes it clear that we do currently support this, and that the FIXME is for doing so in a less ad-hoc way.
- Document test intent, backlink to rust-lang#13890 and fix PR rust-lang#13903. - Fix the test logic: the `Makefile` version seems to not actually be exercising the "library search traverses symlink" logic, because the actual symlinked-to-library is present under the directory tree when `bar.rs` is compiled, because the `$(RUSTC)` invocation has an implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e. it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it used `ln -nsf outdir/$(NAME) $(TMPDIR)`. Co-authored-by: Oneirical <[email protected]>
- The Makefile version *never* ran because of Makefile syntax confusion. - The test would've always failed because precompiled std is not built with `-Z cf-protection=branch`, but linkers require all input object files to indicate IBT support in order to enable IBT for the executable, which is not the case for std. - Thus, the test input file is instead changed to a `no_std` + `no_core` program. Co-authored-by: Jerry Wang <[email protected]> Co-authored-by: Oneirical <[email protected]>
…-base, r=compiler-errors Implement `default_overrides_default_fields` lint Detect when a manual `Default` implementation isn't using the existing default field values and suggest using `..` instead: ``` error: `Default` impl doesn't use the declared default field values --> $DIR/manual-default-impl-could-be-derived.rs:14:1 | LL | / impl Default for A { LL | | fn default() -> Self { LL | | A { LL | | y: 0, | | - this field has a default value ... | LL | | } | |_^ | = help: use the default values in the `impl` with `Struct { mandatory_field, .. }` to avoid them diverging over time note: the lint level is defined here --> $DIR/manual-default-impl-could-be-derived.rs:5:9 | LL | #![deny(default_overrides_default_fields)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ``` r? `@compiler-errors` This is a simpler version of rust-lang#134441, detecting the simpler case when a field with a default should have not been specified in the manual `Default::default()`, instead using `..` for it. It doesn't provide any suggestions, nor the checks for "equivalences" nor whether the value used in the imp being used would be suitable as a default field value.
…check-IBT, r=lqd Migrate `branch-protection-check-IBT` to rmake.rs - The Makefile version *never* ran because of Makefile syntax confusion because `ifeq ($(filter x86,$(LLVM_COMPONENTS)),x86_64)` [compares `x86` to `x86_64`, which always evaluates to false](rust-lang#126720 (comment)). - The test would've always failed because precompiled std is not built with `-Z cf-protection=branch`, but linkers require all input object files to indicate IBT support in order to enable IBT for the executable, which is not the case for std. - Thus, the test input file is instead changed to a `no_std` program. - The test is currently limited to only `x86_64-unknown-linux-gnu` host, there are various other problems when the test is cross-compiled that I didn't want to fix atm, and is left as an exercise for the `-Z cf-protection` implementers. The GNU property note was added by rust-lang#110304 in order to address rust-lang#103001. Partially supersedes rust-lang#129156. The rmake.rs port was initially authored by `@Rejyr` in rust-lang#126720. This PR is co-authored with `@Oneirical` and `@Rejyr.` r? `@bjorn3` or reroll try-job: x86_64-mingw-1 try-job: x86_64-mingw-2 try-job: x86_64-msvc try-job: x86_64-apple-1 try-job: x86_64-apple-2
…inks, r=lqd Migrate `libs-through-symlink` to rmake.rs Part of rust-lang#121876. This PR migrates `tests/run-make/libs-through-symlink/` to use rmake.rs. - Regression test for rust-lang#13890. - Original fix PR is rust-lang#13903. - Document test intent, backlink to rust-lang#13890 and fix PR rust-lang#13903. - Fix the test logic: the `Makefile` version seems to not actually be exercising the "library search traverses symlink" logic, because the actual symlinked-to-library is present under the `$(TMPDIR)` directory tree when `bar.rs` is compiled, because the `$(RUSTC)` invocation has an implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e. it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it used `ln -nsf outdir/$(NAME) $(TMPDIR)`. The rmake.rs version now explicitly separates the two directory trees and sets the CWD of the `bar.rs` rustc invocation so that the actual library is *not* present under its CWD tree. I.e. it is now ``` $test_output/ # rustc foo.rs -o actual_lib_dir/libfoo.rlib actual_lib_dir/ libfoo.rlib symlink_lib_dir/ # CWD set; rustc -L . bar.rs libfoo.rlib --> $test_output/actual_lib_dir/libfoo.rlib ``` Partially supersedes rust-lang#129011. This PR is co-authored with `@Oneirical.` r? compiler
Update `compiler-builtins` to 0.1.140 Nothing significant here, just syncing the following small changes: - rust-lang/compiler-builtins#727 - rust-lang/compiler-builtins#730 - rust-lang/compiler-builtins#736 - rust-lang/compiler-builtins#737
compiletest: Only pass the post-colon value to `parse_normalize_rule` Addresses one of the FIXMEs noted in rust-lang#134759. I started working on the other FIXME, but it became complex enough that I wanted to split it off from this PR. r? jieyouxu
@bors r+ rollup=never p=5 |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: 7cb084932e In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Finished benchmarking commit (8b3f7ac): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary 1.4%, secondary -2.1%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 2.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 761.454s -> 761.626s (0.02%) |
Rollup of 5 pull requests Successful merges: - rust-lang#134737 (Implement `default_overrides_default_fields` lint) - rust-lang#134760 (Migrate `branch-protection-check-IBT` to rmake.rs) - rust-lang#134829 (Migrate `libs-through-symlink` to rmake.rs) - rust-lang#134832 (Update `compiler-builtins` to 0.1.140) - rust-lang#134840 (compiletest: Only pass the post-colon value to `parse_normalize_rule`) r? `@ghost` `@rustbot` modify labels: rollup
Successful merges:
default_overrides_default_fields
lint #134737 (Implementdefault_overrides_default_fields
lint)branch-protection-check-IBT
to rmake.rs #134760 (Migratebranch-protection-check-IBT
to rmake.rs)libs-through-symlink
to rmake.rs #134829 (Migratelibs-through-symlink
to rmake.rs)compiler-builtins
to 0.1.140 #134832 (Updatecompiler-builtins
to 0.1.140)parse_normalize_rule
#134840 (compiletest: Only pass the post-colon value toparse_normalize_rule
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup