Skip to content

Automated pull from upstream master#84

Merged
bors-ferrocene[bot] merged 250 commits intomainfrom
automation/pull-upstream/drqd7ala
Nov 6, 2023
Merged

Automated pull from upstream master#84
bors-ferrocene[bot] merged 250 commits intomainfrom
automation/pull-upstream/drqd7ala

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Nov 6, 2023

This PR pulls the following changes from the upstream repository:

BenWiederhake and others added 30 commits June 25, 2023 23:39
Co-authored-by: Samuel Tardieu <sam@rfc1149.net>
Co-authored-by: Samuel Tardieu <sam@rfc1149.net>
Co-authored-by: Catherine Flores <catherine.3.flores@gmail.com>
For runtime dependencies we have a much stricter license check.
Combining the license check code with that for regular tools makes it
harder to follow.
Rather than just for rustc_driver. rustc-main also depends on rustc_smir
which may get unique dependencies in the future.
This removes a dependency on fuchsia-cprng which doesn't have any
license info.
Otherwise the results may be outdated compared to a build at a later
time. Also disable checking for the backtrace workspace until Cargo.lock
is committed.
When using *Command Line Tools for Xcode* version 15.0, clang will warn about
`argument unused during compilation: '-stdlib=libc++'` if this flag is present
when compiling C files only (i.e. no C++ files).

To avoid this warning, we can add the flag only to CXXFLAGS and not to CFLAGS.
[`map_identity`]: recognize tuple identity function

Fixes #7189

This lint now recognizes `.map(|(a, b)| (a, b))` as a useless `map` call.

changelog: [`map_identity`]: recognize tuple identity function
matthiaskrgr and others added 15 commits November 5, 2023 12:41
Don't pass `-stdlib=libc++` when building C files on macOS

When using *Command Line Tools for Xcode* version 15.0, clang will warn about `argument unused during compilation: '-stdlib=libc++'` if this flag is present when compiling C files only (i.e. no C++ files).

To avoid this warning, we can add the flag only to CXXFLAGS and not to CFLAGS.

---

[Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/clang.20warning.3A.20argument.20unused.20during.20compilation.20.28libc.2B.2B.29)
…k-Simulacrum

bootstrap/setup: create hooks directory if non-existing

When running `./x setup` on a local repository I chose to install a `pre-push` git hook, but this happened:

```shell
Would you like to install the git hook?: [y/N] y
error: could not create hook .git/hooks/pre-push: do you already have the git hook installed?
No such file or directory (os error 2)
thread 'main' panicked at src/core/build_steps/setup.rs:462:9:
install_git_hook_maybe(&config) failed with No such file or directory (os error 2)
```

This was caused because the `.git/hooks` directory did not exist in my local repository. Creating it manually and re-running the command works fine.

This PR tests for the above directory and if it does not exist then it _tries_ to create it before hard linking the pre-push hook - we use `fs::create_dir()` and disregard the result (ie. it could fail if the directory was created in the meantime) and proceed to call `fs::hard_link()` all the same.
Remove unused LoadResult::DecodeIncrCache variant
Add diagnostic items for a few of core's builtin macros

Specifically, `env`, `option_env`, and `include`. There are a number of reasons why people might want to look at these in lints (For example, to ensure that things behave consistently, detect things that might make builds less reproducible, etc).

Concretely, in PL/Rust (well, `plrustc`) we have lints that forbid these (which I'd like to [add to clippy as restriction lints](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Landing.20a.20flotilla.20of.20lints.3F) eventually), and `dylint` also has [lints that look for `env!`/`option_env!`](https://github.com/trailofbits/dylint/blob/109a07e9f27a9651ef33b6677ccaddd21466e97a/examples/general/env_cargo_path/src/lib.rs) (although perhaps not `include`), which would benefit from this.

My experience is that it's pretty annoying to (robustly) check uses of builtin macros without these IME, although that's perhaps just my own fault (e.g. I could be doing it wrong).

At `@Nilstrieb's` suggestion, I've added a comment that explains why these are here, even though they are not used in the compiler. This is mostly to discourage removal, although it's not a big deal if it happens (I'm certainly not suggesting the presence of these be in any way stable).

---

In theory this is a library PR (in that it's in library/core), but I'm going to roll compiler because the existence of this or not is much more likely something they care about rather than libs. Hopefully nobody objects to this.

r? compiler
Rollup of 4 pull requests

Successful merges:

 - #116017 (Don't pass `-stdlib=libc++` when building C files on macOS)
 - #117524 (bootstrap/setup: create hooks directory if non-existing)
 - #117588 (Remove unused LoadResult::DecodeIncrCache variant)
 - #117596 (Add diagnostic items for a few of core's builtin macros)

r? `@ghost`
`@rustbot` modify labels: rollup
Feature gate enums in offset_of

As requested at rust-lang/rust#106655 (comment), put enums in offset_of behind their own feature gate.

`@rustbot` label F-offset_of
Signed-off-by: onur-ozkan <work@onurozkan.dev>
…-Simulacrum

improve compiler&tool documenting and re-enable cranelift on CI

First commit addresses the linking issue with compiler crates. Second one ensures that compiler crates are linked correctly (with later commits we added this check for tools as well), allowing us to detect these hard-to-catch bugs on CI. Following three commits cherry-picked from #117328 to re-enable the Cranelift backend on CI.

More info: rust-lang/rust#117430

cc `@bjorn3` `@RalfJung`
…l, r=Mark-Simulacrum

Avoid unnecessary comparison in partition_equal

The branchy Hoare partition `partition_equal` as part of `slice::sort_unstable` has a bug that makes it perform a comparison of the last element twice.

Measuring inputs with a Zipfian distribution with characterizing exponent s == 1.0, yields a ~0.05% reduction in the total number of comparisons performed.
generate beta manifests as pre-requisit to rust-lang/rustup#1329

<rust-lang/rustup#1329 (comment)> mentioned (a while ago) this would be the next step
Override `Waker::clone_from` to avoid cloning `Waker`s unnecessarily

This would be very useful for futures — I think it’s pretty much always what they want to do instead of `*waker = cx.waker().clone()`.

Tracking issue: rust-lang/rust#98287

r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs
Fix excessive initialization and reads beyond EOF in `io::copy(_, Vec<u8>)` specialization

fixes #117545 and bczhc/bzip3-rs#8
Add the `Span` of the `move` keyword to the HIR.

This is required to implement a lint like the one described here: rust-lang/rust-clippy#11721
This commit is generated by `ferrocene/tools/pull-upstream/pull.sh`.
The list of excluded files is defined in `.gitattributes`.
@github-actions github-actions bot added automation Issue or PR created by an automation backport:never PR that should never be backported labels Nov 6, 2023
Copy link
Contributor

@Dajamante Dajamante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@bors-ferrocene
Copy link
Contributor

bors-ferrocene bot commented Nov 6, 2023

👎 Rejected by PR status

@Dajamante
Copy link
Contributor

bors merge

@bors-ferrocene
Copy link
Contributor

bors-ferrocene bot commented Nov 6, 2023

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

Copy link
Contributor

@Dajamante Dajamante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

@bors-ferrocene
Copy link
Contributor

bors-ferrocene bot commented Nov 6, 2023

🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set.

@bors-ferrocene
Copy link
Contributor

bors-ferrocene bot commented Nov 6, 2023

Stopped waiting for PR status (Github check) without running due to duplicate requests to run. You may check Bors to see that this PR is included in a batch by one of the other requests.

@bors-ferrocene
Copy link
Contributor

bors-ferrocene bot commented Nov 6, 2023

Build succeeded:

  • full

@bors-ferrocene bors-ferrocene bot merged commit a01e81f into main Nov 6, 2023
@bors-ferrocene bors-ferrocene bot deleted the automation/pull-upstream/drqd7ala branch November 6, 2023 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation Issue or PR created by an automation backport:never PR that should never be backported merged-in:1.75

Projects

None yet

Development

Successfully merging this pull request may close these issues.