Skip to content

prepare v1.4.27 release #4529

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

Merged
merged 3 commits into from
Nov 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ jobs:
if [ "${{ matrix.os }}" = "windows-latest" ]; then
cp target/release/{rustfmt.exe,cargo-fmt.exe,rustfmt-format-diff.exe,git-rustfmt.exe} "$staging/"
7z a "$staging.zip" "$staging"
echo "::set-env name=ASSET::$staging.zip"
echo "ASSET=$staging.zip" >> $GITHUB_ENV
else
cp target/release/{rustfmt,cargo-fmt,rustfmt-format-diff,git-rustfmt} "$staging/"
tar czf "$staging.tar.gz" "$staging"
echo "::set-env name=ASSET::$staging.tar.gz"
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
fi

- name: Upload Release Asset
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
include:
- channel: nightly
target: i686-pc-windows-gnu
mingw-7z-path: mingw

env:
CFG_RELEASE_CHANNEL: nightly
Expand All @@ -41,42 +40,6 @@ jobs:
- name: checkout
uses: actions/checkout@v2

# The Windows runners do not (yet) have a proper msys/mingw environment
# pre-configured like AppVeyor does, though they will likely be added in the future.
# https://github.com/actions/virtual-environments/issues/30
#
# In the interim, this ensures mingw32 is installed and available on the PATH
# for the i686-pc-windows-gnu target. This approach is used because it's common in
# other rust projects and there are issues/limitations with the msys2 chocolatey nuget
# package and numworks/setup-msys2 action.
# https://github.com/rust-lang/rust/blob/master/src/ci/scripts/install-mingw.sh#L59
# https://github.com/rust-lang/rustup/blob/master/appveyor.yml
#
# Use GitHub Actions cache support to avoid downloading the .7z file every time
# to be cognizant of the AWS egress cost impacts
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
- name: cache mingw.7z
id: cache-mingw
with:
path: ${{ matrix.mingw-7z-path }}
key: ${{ matrix.channel }}-${{ matrix.target }}-mingw
uses: actions/cache@v1
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
- name: download mingw.7z
run: |
# Disable the download progress bar which can cause perf issues
$ProgressPreference = "SilentlyContinue"
md -Force ${{ matrix.mingw-7z-path }}
Invoke-WebRequest https://ci-mirrors.rust-lang.org/rustc/i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z -OutFile ${{ matrix.mingw-7z-path }}/mingw.7z
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly' && steps.cache-mingw.outputs.cache-hit != 'true'
shell: powershell
- name: install mingw32
run: |
7z x -y ${{ matrix.mingw-7z-path }}/mingw.7z -oC:\msys64 | Out-Null
echo ::add-path::C:\msys64\mingw32\bin
if: matrix.target == 'i686-pc-windows-gnu' && matrix.channel == 'nightly'
shell: powershell

# Run build
- name: setup
uses: actions-rs/toolchain@v1
Expand Down
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## [Unreleased]

## [1.4.27] 2020-11-16

### Fixed

- Leading comments in an extern block are no longer dropped (a bug that exists in v1.4.26). ([#4528](https://github.com/rust-lang/rustfmt/issues/4528))

### Install/Download Options
- **crates.io package** - *pending*
- **rustup (nightly)** - *pending*
- **GitHub Release Binaries** - [Release v1.4.27](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.27)
- **Build from source** - [Tag v1.4.27](https://github.com/rust-lang/rustfmt/tree/v1.4.27), see instructions for how to [install rustfmt from source][install-from-source]

## [1.4.26] 2020-11-14

### Changed
Expand Down Expand Up @@ -47,7 +59,7 @@ if toks.eat_token(Token::Word("modify"))? && toks.eat_token(Token::Word("labels"

### Install/Download Options
- **crates.io package** - *pending*
- **rustup (nightly)** - *pending*
- **rustup (nightly)** - Starting in `2020-11-16`
- **GitHub Release Binaries** - [Release v1.4.26](https://github.com/rust-lang/rustfmt/releases/tag/v1.4.26)
- **Build from source** - [Tag v1.4.26](https://github.com/rust-lang/rustfmt/tree/v1.4.26), see instructions for how to [install rustfmt from source][install-from-source]

Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "rustfmt-nightly"
version = "1.4.26"
version = "1.4.27"
authors = ["Nicholas Cameron <ncameron@mozilla.com>", "The Rustfmt developers"]
description = "Tool to find and fix Rust formatting issues"
repository = "https://github.com/rust-lang/rustfmt"
Expand Down
11 changes: 0 additions & 11 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,14 +161,6 @@ enum BodyElement<'a> {
ForeignItem(&'a ast::ForeignItem),
}

impl BodyElement<'_> {
pub(crate) fn span(&self) -> Span {
match self {
BodyElement::ForeignItem(fi) => fi.span(),
}
}
}

/// Represents a fn's signature.
pub(crate) struct FnSig<'a> {
decl: &'a ast::FnDecl,
Expand Down Expand Up @@ -277,9 +269,6 @@ impl<'a> FmtVisitor<'a> {
self.block_indent = self.block_indent.block_indent(self.config);

if !item.body.is_empty() {
// Advance to first item (statement or inner attribute)
// within the block.
self.last_pos = item.body[0].span().lo();
for item in &item.body {
self.format_body_element(item);
}
Expand Down
8 changes: 8 additions & 0 deletions tests/source/issue_4528.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![allow(clippy::no_effect)]

extern "C" {
// N.B., mutability can be easily incorrect in FFI calls -- as
// in C, the default is mutable pointers.
fn ffi(c: *mut u8);
fn int_ffi(c: *mut i32);
}
8 changes: 8 additions & 0 deletions tests/target/issue_4528.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#![allow(clippy::no_effect)]

extern "C" {
// N.B., mutability can be easily incorrect in FFI calls -- as
// in C, the default is mutable pointers.
fn ffi(c: *mut u8);
fn int_ffi(c: *mut i32);
}