Skip to content
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 10 pull requests #90176

Closed
wants to merge 114 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
e4b8714
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-r…
calebcartwright Jul 26, 2021
778f035
ci: remove unnecessary cargo-make install on windows jobs
calebcartwright Jul 27, 2021
e7fa070
fix: make --edition 2021 visible in --help
outloudvi Jul 22, 2021
0b21ea2
Unyeet const param defaults
BoxyUwU Apr 28, 2021
8c52aae
Bump deps
klensy Jun 3, 2021
e9038b8
rfc3052: Remove authors field from Cargo manifests
lf- Jul 27, 2021
8cbee56
ci: functionally delete appveyor
calebcartwright Jul 30, 2021
2323cbc
Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
bors Aug 2, 2021
fefb542
fix: handle GAT types in impls with self bounds
calebcartwright Aug 7, 2021
5d8eb8d
fix: don't drop drop generic args on assoc ty constraints
calebcartwright Aug 8, 2021
1d6002a
Enable triagebot assignment in rustfmt
nipunn1313 Aug 8, 2021
64bf8df
Introduce hir::ExprKind::Let - Take 2
c410-f3r Aug 8, 2021
7769ed0
Document private items for rustfmt
jyn514 Jul 14, 2021
e1dac88
Auto merge of #87119 - jyn514:rustfmt-doc-private, r=Mark-Simulacrum
bors Aug 17, 2021
667a2da
Fix stable toggle on gh pages configuration site
ayazhafiz May 31, 2020
6959d03
Show configs from different versions on github pages
ayazhafiz Jun 1, 2020
916c238
fixup! Show configs from different versions on github pages
ayazhafiz Jun 1, 2020
1045c62
Add github-style highlighting for code blocks (#4224)
ayazhafiz Jun 1, 2020
c5f1d96
Adds direct linking using header ids (#4272)
aszenz Jun 23, 2020
31c97ce
Adds query param for version no (#4270)
aszenz Jun 23, 2020
3195d6c
docs: Preserve updated query param content and add config option links
ayazhafiz Jul 3, 2020
bf47fc1
Ensure that doc url hash IDs are scrolled to on page load
ayazhafiz Jul 16, 2020
f5c782f
fixup! Ensure that doc url hash IDs are scrolled to on page load
ayazhafiz Jul 16, 2020
5c7ac69
Warn when rate limit is on docs page
ayazhafiz Jul 16, 2020
3c36a0c
Exluding v0.8.1 and v0.7 from the config dropdown
jdollar Oct 3, 2020
042c2ec
Added Updated default version to Rustfmt docs config
gunadhya Jan 15, 2021
ec86cfd
Fix redirect issue
gunadhya Jan 21, 2021
f787288
Fix for version config option anchor
davidBar-On Mar 3, 2021
25ebc35
Fix more “a”/“an” typos
steffahn Aug 22, 2021
9bc0dbe
Fix typos “an”→“a” and a few different ones that appeared in the same…
steffahn Aug 22, 2021
c8bd550
Add test for visibility on a trait item (currently wrong)
dtolnay Aug 20, 2021
fd6b025
Preserve visibility on trait items inside trait and impl
dtolnay Aug 20, 2021
c4d4699
Stabilise unix_process_await_more, extra ExitStatusExt methods
ijackson Aug 24, 2021
e81c393
fix: remove wrong reformatting of qualified paths in struct patterns
ashvin021 Aug 25, 2021
076916f
Introduce `~const`
fee1-dead Aug 25, 2021
20ddab3
Fix rustfmt test
fee1-dead Aug 27, 2021
a603756
Temporary fix rustfmt for let-else
camsteffen Jul 25, 2021
ca9b050
Implement `One` option for imports_granularity (#4669)
magurotuna Jan 30, 2021
c71c68c
Add <title> to docs
akiomik Sep 1, 2021
d19f69c
test: add missing source for #4943
cowboy-bebug Aug 30, 2021
33d1368
test: add test for #4257
cowboy-bebug Aug 30, 2021
bfc6046
test: add test for #4954
cowboy-bebug Aug 30, 2021
ae5696a
test: add test for #4322
cowboy-bebug Aug 30, 2021
48b8e45
Detect bare blocks with type ascription that were meant to be a `stru…
estebank Sep 2, 2021
1674eea
Fix #88256, remove duplicated diagnostic
chenyukang Sep 4, 2021
6271ded
Auto merge of #88493 - chenyukang:fix-duplicated-diagnostic, r=estebank
bors Sep 6, 2021
59063e8
fix: newline width calc in combine w/ comments (#4123)
calebcartwright Apr 16, 2020
a59cac2
fix: use correct spans for params with attrs
calebcartwright Sep 6, 2021
c2f0e99
try to write the parameter on a new line in case the attribute/parame…
scampi Oct 6, 2020
3d8cd57
tests: add files for issue 4579
calebcartwright Sep 6, 2021
4dd9b85
Added next_up and next_down for f32/f64.
orlp Sep 7, 2021
57548aa
fix: resolve idempotency issue in extern body elements
calebcartwright Sep 8, 2021
a806883
fix: handle param doc comments for macro scenarios
calebcartwright Sep 8, 2021
b10ab51
rustfmt doc code blocks with multiple comma-separated attributes
nipunn1313 Aug 8, 2021
d647ebf
Revert "Allow formatting `Anonymous{Struct, Union}` declarations"
pnkfelix Sep 8, 2021
e014277
Ignore automatically derived impls of `Clone` and `Debug` in dead cod…
FabianWolff May 21, 2021
127ec9a
Keep a parent LocalDefId in SpanData.
cjgillot Apr 18, 2021
8743472
Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petr…
bors Sep 11, 2021
67a59f6
opts: rephrase wording for --all and -p
lnicola Nov 8, 2019
d4ffd1e
Support @generated marker to skip code formatting
topecongiro Jul 10, 2020
9d65b7d
feat: upper- or lowercase hexadecimal literals
ArjenL Jul 15, 2021
52e1a52
Rollup merge of #88775 - pnkfelix:revert-anon-union-parsing, r=davidtwco
Manishearth Sep 15, 2021
17cb2b1
feat: add --check flag to cargo fmt (#3890)
calebcartwright Oct 27, 2019
7aa69e5
refactor: use iter workaround for contains() gap
calebcartwright Sep 17, 2021
dd445ab
Trailing comma on match block goes missing when guard is on its own line
ulyssa Sep 15, 2021
9060bc5
Migrate to 2021
Mark-Simulacrum Sep 19, 2021
74df7b3
deps: update cargo_metadata to include 'path'
calebcartwright Sep 20, 2021
7f6229b
tests: restructure and extend cargo-fmt tests
calebcartwright Sep 20, 2021
4b9d637
refactor: simplify local dep lookups
calebcartwright Sep 21, 2021
cb144c3
In Configurations.md demonstrate both cases for noop selections
rukai Sep 10, 2021
a5138b3
Prevent removal of qualified path for tuple struct inside macro
ytmimi Sep 27, 2021
e3203ef
Add tests for binop_separator = Back
ulyssa Sep 20, 2021
f0f449d
Wrap long array and slice patterns.
pcwalton Sep 18, 2021
0866b96
Apply suggestions from code review
yaahc Oct 5, 2021
40f4993
Update derive attibute span to start after opening '('
ytmimi Sep 24, 2021
365a2f8
Add additional test cases for issue 4984
ytmimi Sep 29, 2021
8b58cce
Stabilize match_block_trailing_comma. (#4145)
emilio May 16, 2020
d418057
Prevent structs with ".." from being rewritten with alignment
ytmimi Oct 11, 2021
f7c4a44
Adjust non-empty tuple struct span to start before fields
ytmimi Oct 5, 2021
f2fb3c9
Update connector search in ControlFlow::rewrite_pat_expr for for loops
ytmimi Oct 6, 2021
c9c1932
feat: stabilize disable_all_formatting
calebcartwright Oct 14, 2021
c801593
Add support for specifying multiple clobber_abi in `asm!`
asquared31415 Oct 14, 2021
a9a1393
Add -Z location-detail flag
hudson-ayers Oct 14, 2021
7323696
Fix aarch tests
asquared31415 Oct 17, 2021
0cff306
ci: fix release asset upload job
calebcartwright Oct 14, 2021
5f4811e
Handle DefinitiveListTactic::SpecialMacro when writing pre-comments
ytmimi Oct 14, 2021
1ae5c35
Replace match expression with match! macro
ytmimi Oct 19, 2021
9231263
Merge branch 'master' into 1.4.38-subtree
calebcartwright Oct 20, 2021
5f79583
chore: bump toolchain, fix conflict
calebcartwright Oct 20, 2021
b9178dc
Merge pull request #5036 from calebcartwright/1.4.38-subtree
calebcartwright Oct 20, 2021
efa8f55
chore: bump version and changelog
calebcartwright Oct 20, 2021
714e904
Merge commit 'efa8f5521d3813cc897ba29ea0ef98c7aef66bb6' into rustfmt-…
calebcartwright Oct 20, 2021
0697f56
update rustfmt
calebcartwright Oct 20, 2021
d3ecb02
ensure cargo-fmt tests are excluded from root workspace
calebcartwright Oct 20, 2021
65b3c85
Add edition configuration to compiletest
llogiq Oct 19, 2021
e1d94b8
Configure saved panic locations based on location-detail flag
hudson-ayers Oct 14, 2021
8090f67
document the unstable location-detail flag
hudson-ayers Oct 14, 2021
b802629
add tests for -Zlocation-detail
hudson-ayers Oct 15, 2021
170214f
fix doc issue in rustfmt
calebcartwright Oct 21, 2021
afcee19
Make RSplit<T, P>: Clone not require T: Clone
calebsander Oct 21, 2021
4a43976
Implement split_array and split_array_mut
Mar 17, 2021
c736c2a
Add comment documenting why we can't use a simpler solution
smmalis37 Oct 22, 2021
7d7ebf8
add feature flag for `type_changing_struct_update`
crlf0710 Oct 10, 2021
2ed5665
Apply suggestions from code review
yaahc Oct 22, 2021
301a4f2
Rollup merge of #83233 - jethrogb:split_array, r=yaahc
matthiaskrgr Oct 22, 2021
f24b5da
Rollup merge of #88300 - ijackson:exitstatusext-methods, r=yaahc
matthiaskrgr Oct 22, 2021
6e6adb4
Rollup merge of #88728 - orlp:float-next-up-down, r=yaahc
matthiaskrgr Oct 22, 2021
1ff1ae1
Rollup merge of #89316 - asquared31415:multiple-clobber-abi, r=Amanieu
matthiaskrgr Oct 22, 2021
38d274f
Rollup merge of #89730 - crlf0710:type_changing_feature, r=jackh726
matthiaskrgr Oct 22, 2021
f95ad81
Rollup merge of #89920 - hudson-ayers:location-detail-control, r=davi…
matthiaskrgr Oct 22, 2021
246fcd7
Rollup merge of #90070 - llogiq:compiletest-config-edition, r=Mark-Si…
matthiaskrgr Oct 22, 2021
5321c71
Rollup merge of #90087 - calebcartwright:rustfmt-subtree, r=calebcart…
matthiaskrgr Oct 22, 2021
33dd4d1
Rollup merge of #90117 - calebsander:fix/rsplit-clone, r=yaahc
matthiaskrgr Oct 22, 2021
82c549c
Rollup merge of #90166 - smmalis37:patch-1, r=joshtriplett
matthiaskrgr Oct 22, 2021
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
80 changes: 37 additions & 43 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,23 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81a18687293a1546b67c246452202bbbf143d239cb43494cc163da14979082da"

[[package]]
name = "camino"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52d74260d9bf6944e2208aa46841b4b8f0d7ffc0849a06837b2f510337f86b2b"
dependencies = [
"serde",
]

[[package]]
name = "cargo"
version = "0.58.0"
dependencies = [
"anyhow",
"atty",
"bytesize",
"cargo-platform",
"cargo-platform 0.1.2",
"cargo-test-macro",
"cargo-test-support",
"cargo-util",
Expand Down Expand Up @@ -374,6 +383,15 @@ dependencies = [
"serde",
]

[[package]]
name = "cargo-platform"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27"
dependencies = [
"serde",
]

[[package]]
name = "cargo-test-macro"
version = "0.1.0"
Expand Down Expand Up @@ -421,23 +439,24 @@ dependencies = [

[[package]]
name = "cargo_metadata"
version = "0.8.2"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "700b3731fd7d357223d0000f4dbf1808401b694609035c3c411fbc0cd375c426"
checksum = "d5a5f7b42f606b7f23674f6f4d877628350682bc40687d3fae65679a58d55345"
dependencies = [
"semver 0.9.0",
"semver 0.11.0",
"serde",
"serde_derive",
"serde_json",
]

[[package]]
name = "cargo_metadata"
version = "0.12.0"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5a5f7b42f606b7f23674f6f4d877628350682bc40687d3fae65679a58d55345"
checksum = "c297bd3135f558552f99a0daa180876984ea2c4ffa7470314540dff8c654109a"
dependencies = [
"semver 0.11.0",
"camino",
"cargo-platform 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 1.0.3",
"serde",
"serde_json",
]
Expand Down Expand Up @@ -1070,9 +1089,9 @@ dependencies = [

[[package]]
name = "env_logger"
version = "0.6.2"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3"
checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
dependencies = [
"atty",
"humantime 1.3.0",
Expand All @@ -1083,12 +1102,12 @@ dependencies = [

[[package]]
name = "env_logger"
version = "0.7.1"
version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36"
checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
dependencies = [
"atty",
"humantime 1.3.0",
"humantime 2.0.1",
"log",
"regex",
"termcolor",
Expand Down Expand Up @@ -1698,15 +1717,6 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485"

[[package]]
name = "itertools"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
dependencies = [
"either",
]

[[package]]
name = "itertools"
version = "0.9.0"
Expand Down Expand Up @@ -4673,19 +4683,19 @@ dependencies = [

[[package]]
name = "rustfmt-nightly"
version = "1.4.37"
version = "1.4.38"
dependencies = [
"annotate-snippets",
"anyhow",
"bytecount",
"cargo_metadata 0.8.2",
"cargo_metadata 0.14.0",
"derive-new",
"diff",
"dirs",
"env_logger 0.6.2",
"env_logger 0.8.4",
"getopts",
"ignore",
"itertools 0.8.2",
"itertools 0.9.0",
"lazy_static",
"log",
"regex",
Expand Down Expand Up @@ -4768,23 +4778,13 @@ dependencies = [
"libc",
]

[[package]]
name = "semver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [
"semver-parser 0.7.0",
"serde",
]

[[package]]
name = "semver"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"
dependencies = [
"semver-parser 0.10.2",
"semver-parser",
"serde",
]

Expand All @@ -4797,12 +4797,6 @@ dependencies = [
"serde",
]

[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"

[[package]]
name = "semver-parser"
version = "0.10.2"
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ pub struct InlineAsm {
pub template: Vec<InlineAsmTemplatePiece>,
pub template_strs: Box<[(Symbol, Option<Symbol>, Span)]>,
pub operands: Vec<(InlineAsmOperand, Span)>,
pub clobber_abi: Option<(Symbol, Span)>,
pub clobber_abis: Vec<(Symbol, Span)>,
pub options: InlineAsmOptions,
pub line_spans: Vec<Span>,
}
Expand Down Expand Up @@ -2707,7 +2707,7 @@ pub enum ItemKind {
/// E.g., `extern {}` or `extern "C" {}`.
ForeignMod(ForeignMod),
/// Module-level inline assembly (from `global_asm!()`).
GlobalAsm(InlineAsm),
GlobalAsm(Box<InlineAsm>),
/// A type alias (`type`).
///
/// E.g., `type Foo = Bar<u8>;`.
Expand Down
47 changes: 40 additions & 7 deletions compiler/rustc_ast_lowering/src/asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use super::LoweringContext;

use rustc_ast::*;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_set::FxHashSet;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_span::{Span, Symbol};
Expand All @@ -27,22 +28,47 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
.emit();
}

let mut clobber_abi = None;
let mut clobber_abis = FxHashMap::default();
if let Some(asm_arch) = asm_arch {
if let Some((abi_name, abi_span)) = asm.clobber_abi {
match asm::InlineAsmClobberAbi::parse(asm_arch, &self.sess.target, abi_name) {
Ok(abi) => clobber_abi = Some((abi, abi_span)),
for (abi_name, abi_span) in &asm.clobber_abis {
match asm::InlineAsmClobberAbi::parse(asm_arch, &self.sess.target, *abi_name) {
Ok(abi) => {
// If the abi was already in the list, emit an error
match clobber_abis.get(&abi) {
Some((prev_name, prev_sp)) => {
let mut err = self.sess.struct_span_err(
*abi_span,
&format!("`{}` ABI specified multiple times", prev_name),
);
err.span_label(*prev_sp, "previously specified here");

// Multiple different abi names may actually be the same ABI
// If the specified ABIs are not the same name, alert the user that they resolve to the same ABI
let source_map = self.sess.source_map();
if source_map.span_to_snippet(*prev_sp)
!= source_map.span_to_snippet(*abi_span)
{
err.note("these ABIs are equivalent on the current target");
}

err.emit();
}
None => {
clobber_abis.insert(abi, (abi_name, *abi_span));
}
}
}
Err(&[]) => {
self.sess
.struct_span_err(
abi_span,
*abi_span,
"`clobber_abi` is not supported on this target",
)
.emit();
}
Err(supported_abis) => {
let mut err =
self.sess.struct_span_err(abi_span, "invalid ABI for `clobber_abi`");
self.sess.struct_span_err(*abi_span, "invalid ABI for `clobber_abi`");
let mut abis = format!("`{}`", supported_abis[0]);
for m in &supported_abis[1..] {
let _ = write!(abis, ", `{}`", m);
Expand Down Expand Up @@ -308,8 +334,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {

// If a clobber_abi is specified, add the necessary clobbers to the
// operands list.
if let Some((abi, abi_span)) = clobber_abi {
let mut clobbered = FxHashSet::default();
for (abi, (_, abi_span)) in clobber_abis {
for &clobber in abi.clobbered_regs() {
// Don't emit a clobber for a register already clobbered
if clobbered.contains(&clobber) {
continue;
}

let mut output_used = false;
clobber.overlapping_regs(|reg| {
if used_output_regs.contains_key(&reg) {
Expand All @@ -326,6 +358,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
},
self.lower_span(abi_span),
));
clobbered.insert(clobber);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_ast_pretty/src/pprust/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2199,8 +2199,8 @@ impl<'a> State<'a> {

let mut args = vec![AsmArg::Template(InlineAsmTemplatePiece::to_string(&asm.template))];
args.extend(asm.operands.iter().map(|(o, _)| AsmArg::Operand(o)));
if let Some((abi, _)) = asm.clobber_abi {
args.push(AsmArg::ClobberAbi(abi));
for (abi, _) in &asm.clobber_abis {
args.push(AsmArg::ClobberAbi(*abi));
}
if !asm.options.is_empty() {
args.push(AsmArg::Options(asm.options));
Expand Down
Loading