Skip to content

Rollup of 8 pull requests #112730

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

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
e99f7ed
Fix documentation build on FreeBSD
dankm Jun 6, 2023
6d3ff10
run `cargo update` weekly
pitaj Apr 25, 2023
be9b133
Suggest bumping download-ci-llvm-stamp if the build config for llvm i…
jyn514 Jun 14, 2023
88b0858
Correct types in method descriptions of `NonZero*` types
zica87 Jun 15, 2023
886085a
std: only depend on dlmalloc for wasm*-unknown
cuviper Jun 15, 2023
9f50942
Unify history interactions in search
GuillaumeGomez Jun 16, 2023
f431639
Fix invalid handling of "going back in history" when "Directly go to …
GuillaumeGomez Jun 16, 2023
ea55d25
Add regression test for #112676
GuillaumeGomez Jun 16, 2023
3078de7
add dry_run check
beepster4096 Jun 16, 2023
4c6fd75
Replace fvdl with ffx, allow test without install
Jun 16, 2023
08d3065
Fix --rust-build flag in docs
tmandry Jun 16, 2023
12c6f1d
Fix edit fail
tmandry Jun 16, 2023
d553298
Rollup merge of #110805 - pitaj:master, r=Mark-Simulacrum
matthiaskrgr Jun 17, 2023
1051e8f
Rollup merge of #112352 - dankm:fbsd_doc_fix, r=thomcc
matthiaskrgr Jun 17, 2023
6c0ae7b
Rollup merge of #112619 - jyn514:llvm-reminder, r=Mark-Simulacrum
matthiaskrgr Jun 17, 2023
22d1e66
Rollup merge of #112644 - zica87:nonZeroTypes, r=Mark-Simulacrum
matthiaskrgr Jun 17, 2023
855527b
Rollup merge of #112685 - cuviper:wasm-dlmalloc, r=Mark-Simulacrum
matthiaskrgr Jun 17, 2023
87459ff
Rollup merge of #112707 - GuillaumeGomez:back-in-history-fix, r=notri…
matthiaskrgr Jun 17, 2023
39f85e0
Rollup merge of #112719 - djkoloski:fuchsia_test_runner_remove_fvdl, …
matthiaskrgr Jun 17, 2023
fb443f4
Rollup merge of #112722 - DrMeepster:patch-2, r=clubby789
matthiaskrgr Jun 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
# Automatically run `cargo update` periodically

---
name: Bump dependencies in Cargo.lock
on:
schedule:
# Run weekly
- cron: '0 0 * * Sun'
workflow_dispatch:
# Needed so we can run it manually
permissions:
contents: read
defaults:
run:
shell: bash
env:
# So cargo doesn't complain about unstable features
RUSTC_BOOTSTRAP: 1
PR_TITLE: Weekly `cargo update`
PR_MESSAGE: |
Automation to keep dependencies in `Cargo.lock` current.

The following is the output from `cargo update`:
COMMIT_MESSAGE: "cargo update \n\n"

jobs:
not-waiting-on-bors:
name: skip if S-waiting-on-bors
runs-on: ubuntu-latest
steps:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetch state and labels of PR
# Or exit successfully if PR does not exist
JSON=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json labels,state || exit 0)
STATE=$(echo "$JSON" | jq -r '.state')
WAITING_ON_BORS=$(echo "$JSON" | jq '.labels[] | any(.name == "S-waiting-on-bors"; .)')

# Exit with error if open and S-waiting-on-bors
if [[ "$STATE" == "OPEN" && "$WAITING_ON_BORS" == "true" ]]; then
exit 1
fi

update:
name: update dependencies
needs: not-waiting-on-bors
runs-on: ubuntu-latest
steps:
- name: checkout the source code
uses: actions/checkout@v3
with:
submodules: recursive
- name: install the bootstrap toolchain
run: |
# Extract the stage0 version
TOOLCHAIN=$(jq -r '.compiler | {version,date} | join("-")' -- src/stage0.json)
# Install and set as default
rustup toolchain install --no-self-update --profile minimal $TOOLCHAIN
rustup default $TOOLCHAIN

- name: cargo update
# Remove first line that always just says "Updating crates.io index"
run: cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: upload Cargo.lock artifact for use in PR
uses: actions/upload-artifact@v3
with:
name: Cargo-lock
path: Cargo.lock
retention-days: 1
- name: upload cargo-update log artifact for use in PR
uses: actions/upload-artifact@v3
with:
name: cargo-updates
path: cargo_update.log
retention-days: 1

pr:
name: amend PR
needs: update
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: checkout the source code
uses: actions/checkout@v3

- name: download Cargo.lock from update job
uses: actions/download-artifact@v3
with:
name: Cargo-lock
- name: download cargo-update log from update job
uses: actions/download-artifact@v3
with:
name: cargo-updates

- name: craft PR body and commit message
run: |
echo "${COMMIT_MESSAGE}" > commit.txt
cat cargo_update.log >> commit.txt

echo "${PR_MESSAGE}" > body.md
echo '```txt' >> body.md
cat cargo_update.log >> body.md
echo '```' >> body.md

- name: commit
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git switch --force-create cargo_update
git add ./Cargo.lock
git commit --no-verify --file=commit.txt

- name: push
run: git push --no-verify --force --set-upstream origin cargo_update

- name: edit existing open pull request
id: edit
# Don't fail job if we need to open new PR
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Exit with error if PR is closed
STATE=$(gh pr view cargo_update --repo $GITHUB_REPOSITORY --json state --jq '.state')
if [[ "$STATE" != "OPEN" ]]; then
exit 1
fi

gh pr edit cargo_update --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY

- name: open new pull request
# Only run if there wasn't an existing PR
if: steps.edit.outcome != 'success'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh pr create --title "${PR_TITLE}" --body-file body.md --repo $GITHUB_REPOSITORY
21 changes: 12 additions & 9 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ macro_rules! nonzero_unsigned_operations {
}

/// Adds an unsigned integer to a non-zero value.
#[doc = concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")]
#[doc = concat!("Return [`", stringify!($Ty), "::MAX`] on overflow.")]
///
/// # Examples
///
Expand Down Expand Up @@ -579,7 +579,7 @@ macro_rules! nonzero_signed_operations {

/// Checked absolute value.
/// Checks for overflow and returns [`None`] if
#[doc = concat!("`self == ", stringify!($Int), "::MIN`.")]
#[doc = concat!("`self == ", stringify!($Ty), "::MIN`.")]
/// The result cannot be zero.
///
/// # Example
Expand Down Expand Up @@ -800,7 +800,8 @@ macro_rules! nonzero_signed_operations {
self.get().is_negative()
}

/// Checked negation. Computes `-self`, returning `None` if `self == i32::MIN`.
/// Checked negation. Computes `-self`,
#[doc = concat!("returning `None` if `self == ", stringify!($Ty), "::MIN`.")]
///
/// # Example
///
Expand Down Expand Up @@ -859,8 +860,10 @@ macro_rules! nonzero_signed_operations {
((unsafe { $Ty::new_unchecked(result) }), overflow)
}

/// Saturating negation. Computes `-self`, returning `MAX` if
/// `self == i32::MIN` instead of overflowing.
/// Saturating negation. Computes `-self`,
#[doc = concat!("returning [`", stringify!($Ty), "::MAX`]")]
#[doc = concat!("if `self == ", stringify!($Ty), "::MIN`")]
/// instead of overflowing.
///
/// # Example
///
Expand Down Expand Up @@ -993,7 +996,7 @@ macro_rules! nonzero_unsigned_signed_operations {
}

/// Multiplies two non-zero integers together.
#[doc = concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")]
#[doc = concat!("Return [`", stringify!($Ty), "::MAX`] on overflow.")]
///
/// # Examples
///
Expand Down Expand Up @@ -1102,11 +1105,11 @@ macro_rules! nonzero_unsigned_signed_operations {
#[doc = sign_dependent_expr!{
$signedness ?
if signed {
concat!("Return [`", stringify!($Int), "::MIN`] ",
"or [`", stringify!($Int), "::MAX`] on overflow.")
concat!("Return [`", stringify!($Ty), "::MIN`] ",
"or [`", stringify!($Ty), "::MAX`] on overflow.")
}
if unsigned {
concat!("Return [`", stringify!($Int), "::MAX`] on overflow.")
concat!("Return [`", stringify!($Ty), "::MAX`] on overflow.")
}
}]
///
Expand Down
2 changes: 1 addition & 1 deletion library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ features = ['read_core', 'elf', 'macho', 'pe', 'unaligned', 'archive']
rand = { version = "0.8.5", default-features = false, features = ["alloc"] }
rand_xorshift = "0.3.0"

[target.'cfg(any(all(target_family = "wasm", not(target_os = "emscripten")), all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
dlmalloc = { version = "0.2.3", features = ['rustc-dep-of-std'] }

[target.x86_64-fortanix-unknown-sgx.dependencies]
Expand Down
8 changes: 7 additions & 1 deletion library/std/src/os/unix/net/ancillary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ use crate::slice::from_raw_parts;
use crate::sys::net::Socket;

// FIXME(#43348): Make libc adapt #[doc(cfg(...))] so we don't need these fake definitions here?
#[cfg(all(doc, not(target_os = "linux"), not(target_os = "android"), not(target_os = "netbsd")))]
#[cfg(all(
doc,
not(target_os = "linux"),
not(target_os = "android"),
not(target_os = "netbsd"),
not(target_os = "freebsd")
))]
#[allow(non_camel_case_types)]
mod libc {
pub use libc::c_int;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1766,7 +1766,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
//
// Note that if we encounter `PATH` we make sure to append to our own `PATH`
// rather than stomp over it.
if target.contains("msvc") {
if !builder.config.dry_run() && target.contains("msvc") {
for &(ref k, ref v) in builder.cc.borrow()[&target].env() {
if k != "PATH" {
cmd.env(k, v);
Expand Down
Loading