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 15 pull requests #90118

Closed
wants to merge 133 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
133 commits
Select commit Hold shift + click to select a range
734bfde
Disallow octal zeros in IPv4 addresses
syvb Jul 8, 2021
69de693
Clarify docs on what IPv4 octal addresses are
syvb Jul 9, 2021
b9b97bb
Reject too-long IPs quicker
syvb Jul 9, 2021
a331e5f
Simplify leading zero checks
syvb Jul 11, 2021
ace518d
Add example with a bunch of leading zeos
syvb Jul 11, 2021
d65ab29
Remove unnecessary condition in Barrier::wait()
twetzel59 Jul 24, 2021
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
403d269
Specify maximum IP address length
syvb Aug 10, 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
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
85d6029
`AbstractConst::root`: Always run `subst` when `Node` is `Leaf`
eopb Sep 4, 2021
22c2738
Minor cleanup: make imports more consistent
eopb Sep 4, 2021
6e40618
Remove left over comment
eopb Sep 4, 2021
fc5633f
Make fields on `AbstractConst` private
eopb Sep 4, 2021
b7d9998
Add line that was unintentionally removed
eopb 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
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
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
0cff306
ci: fix release asset upload job
calebcartwright Oct 14, 2021
5f4811e
Handle DefinitiveListTactic::SpecialMacro when writing pre-comments
ytmimi Oct 14, 2021
4a37b9c
Avoid overflow in `VecDeque::with_capacity_in()`.
hkratz Oct 18, 2021
93f80bf
Remove comment saying that we don't build debug rustc in CI, since we do
tgnottingham Oct 18, 2021
aefbd40
Add test for debug logging during incremental compilation
tgnottingham Oct 18, 2021
f2a234e
config: add the option to enable LLVM tests
durin42 Oct 18, 2021
1ae5c35
Replace match expression with match! macro
ytmimi Oct 19, 2021
e8b5af1
Upgrade browser-ui-test version to 0.4.5 (it allows to have multi-lin…
GuillaumeGomez Oct 19, 2021
05eb6f3
Cleanup dead code in hir::map::blocks.
cjgillot Oct 19, 2021
99b8c01
Address lcnr review
eopb Oct 19, 2021
6e98688
Replace FnLikeNode by FnKind.
cjgillot Oct 19, 2021
aad48f7
replace format!("") with String::new()
klensy Oct 9, 2021
f3fb821
use array explicitly instead of vec for const content (even if optimi…
klensy Oct 9, 2021
2fc7806
Make `From` impls of NonZero integer const.
lilasta Oct 20, 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
be30e60
remove duplicate subst
eopb Oct 20, 2021
457f578
Add test for line-number setting
GuillaumeGomez Oct 19, 2021
0aa68a8
Prevent invalid values from existing in Vec::swap_remove
SkiFire13 Oct 20, 2021
50dc319
Add test for duplicated sidebar entries for reexported macro
GuillaumeGomez Oct 20, 2021
69ca324
Add test to ensure that the missing_doc_code_examples is not triggere…
GuillaumeGomez Oct 20, 2021
d3ecb02
ensure cargo-fmt tests are excluded from root workspace
calebcartwright Oct 20, 2021
86b3dd9
stabilize CString::from_vec_with_nul[_unchecked]
CleanCut Sep 26, 2021
39af41e
fix 'since' version number
CleanCut Oct 20, 2021
d03a803
Rollup merge of #86984 - Smittyvb:ipv4-octal-zero, r=m-ou-se
JohnTitor Oct 21, 2021
a2eb20f
Rollup merge of #87440 - twetzel59:fix-barrier-no-op, r=yaahc
JohnTitor Oct 21, 2021
65c70d1
Rollup merge of #88644 - eopb:abstractconst_leaf_subst, r=lcnr
JohnTitor Oct 21, 2021
504d16a
Rollup merge of #89292 - CleanCut:stabilize-cstring_from_vec_with_nul…
JohnTitor Oct 21, 2021
9b5f471
Rollup merge of #90010 - rusticstuff:vecdeque_with_capacity_in_overfl…
JohnTitor Oct 21, 2021
ad8df27
Rollup merge of #90029 - tgnottingham:incr-debug-logging-test, r=Mark…
JohnTitor Oct 21, 2021
6a30dd3
Rollup merge of #90031 - durin42:allow-llvm-tests, r=Mark-Simulacrum
JohnTitor Oct 21, 2021
aadd5d2
Rollup merge of #90048 - GuillaumeGomez:line-number-setting, r=jsha
JohnTitor Oct 21, 2021
2e9d967
Rollup merge of #90071 - cjgillot:no-blocks, r=oli-obk
JohnTitor Oct 21, 2021
558dace
Rollup merge of #90074 - klensy:upvar-all, r=wesleywiser
JohnTitor Oct 21, 2021
3b51106
Rollup merge of #90077 - woppopo:const_nonzero_from, r=oli-obk
JohnTitor Oct 21, 2021
e0963fe
Rollup merge of #90087 - calebcartwright:rustfmt-subtree, r=calebcart…
JohnTitor Oct 21, 2021
248d914
Rollup merge of #90097 - GuillaumeGomez:duplicated-sidebar-entry-reex…
JohnTitor Oct 21, 2021
5300f62
Rollup merge of #90098 - GuillaumeGomez:add-test-foreign-impl-missing…
JohnTitor Oct 21, 2021
0cb360d
Rollup merge of #90099 - SkiFire13:fix-vec-swap-remove, r=dtolnay
JohnTitor Oct 21, 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 @@ -1069,9 +1088,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 @@ -1082,12 +1101,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 @@ -1688,15 +1707,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 @@ -4663,19 +4673,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 @@ -4758,23 +4768,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 @@ -4787,12 +4787,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
5 changes: 2 additions & 3 deletions compiler/rustc_const_eval/src/const_eval/fn_queries.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_middle::hir::map::blocks::FnLikeNode;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt;
use rustc_span::symbol::Symbol;
Expand Down Expand Up @@ -44,8 +43,8 @@ fn is_const_fn_raw(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
} else {
false
}
} else if let Some(fn_like) = FnLikeNode::from_node(node) {
if fn_like.constness() == hir::Constness::Const {
} else if let Some(fn_kind) = node.fn_kind() {
if fn_kind.constness() == hir::Constness::Const {
return true;
}

Expand Down
27 changes: 27 additions & 0 deletions compiler/rustc_hir/src/hir.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::def::{CtorKind, DefKind, Res};
use crate::def_id::DefId;
crate use crate::hir_id::{HirId, ItemLocalId};
use crate::intravisit::FnKind;
use crate::LangItem;

use rustc_ast::util::parser::ExprPrecedence;
Expand Down Expand Up @@ -3258,6 +3259,32 @@ impl<'hir> Node<'hir> {
_ => None,
}
}

pub fn fn_kind(self) -> Option<FnKind<'hir>> {
match self {
Node::Item(i) => match i.kind {
ItemKind::Fn(ref sig, ref generics, _) => {
Some(FnKind::ItemFn(i.ident, generics, sig.header, &i.vis))
}
_ => None,
},
Node::TraitItem(ti) => match ti.kind {
TraitItemKind::Fn(ref sig, TraitFn::Provided(_)) => {
Some(FnKind::Method(ti.ident, sig, None))
}
_ => None,
},
Node::ImplItem(ii) => match ii.kind {
ImplItemKind::Fn(ref sig, _) => Some(FnKind::Method(ii.ident, sig, Some(&ii.vis))),
_ => None,
},
Node::Expr(e) => match e.kind {
ExprKind::Closure(..) => Some(FnKind::Closure),
_ => None,
},
_ => None,
}
}
}

// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
Expand Down
8 changes: 8 additions & 0 deletions compiler/rustc_hir/src/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@ impl<'a> FnKind<'a> {
FnKind::Closure => None,
}
}

pub fn constness(self) -> Constness {
self.header().map_or(Constness::NotConst, |header| header.constness)
}

pub fn asyncness(self) -> IsAsync {
self.header().map_or(IsAsync::NotAsync, |header| header.asyncness)
}
}

/// An abstract representation of the HIR `rustc_middle::hir::map::Map`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,8 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> {
// similar to the asyncness fn in rustc_ty_utils::ty
let hir_id = self.tcx().hir().local_def_id_to_hir_id(local_def_id);
let node = self.tcx().hir().get(hir_id);
let fn_like = rustc_middle::hir::map::blocks::FnLikeNode::from_node(node)?;

Some(fn_like.asyncness())
let fn_kind = node.fn_kind()?;
Some(fn_kind.asyncness())
}

// Here, we check for the case where the anonymous region
Expand Down
Loading