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 13 pull requests #83038

Closed
wants to merge 254 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
254 commits
Select commit Hold shift + click to select a range
f64149d
Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyup
flip1995 Feb 25, 2021
b303f7d
Fix Clippy build and test
flip1995 Feb 25, 2021
2f0e9f7
or_fun_call: fix suggestion for `or_insert(vec![])`
mgacek8 Feb 24, 2021
5c6cd87
Auto merge of #6790 - mgacek8:issue_6748, r=Manishearth
bors Feb 25, 2021
cbe6eec
Add original test case from issue
mdm Feb 25, 2021
d5223be
Auto merge of #6601 - mdm:fix-unit-args-false-positive, r=camsteffen
bors Feb 25, 2021
5dbd45c
Improve needless_borrowed_ref docs
camsteffen Feb 26, 2021
8f47a42
Downgrade manual_map to nursery
dtolnay Feb 26, 2021
12dc030
lintcheck: fix bug when getting the config toml path.
matthiaskrgr Feb 23, 2021
3e1eea6
lintcheck: print stats how lint counts have changed between runs
matthiaskrgr Feb 23, 2021
90cf27e
lintcheck: update logs and do minor fixes
matthiaskrgr Feb 26, 2021
186bf1c
Auto merge of #6796 - dtolnay-contrib:manualmap, r=flip1995
bors Feb 26, 2021
1368cb3
Revert "Test workspace at once"
camsteffen Feb 26, 2021
814b006
Revert "Fix lintcheck by excluding checked crates from workspace"
camsteffen Feb 26, 2021
fb905df
Revert "Add workspace to manifest"
camsteffen Feb 26, 2021
aef6dc2
Add package arguments to dogfood test
camsteffen Feb 26, 2021
d71ed26
Revert "Fix versioncheck test"
camsteffen Feb 26, 2021
6343446
Auto merge of #6800 - matthiaskrgr:lintcheck_stats, r=llogiq
bors Feb 26, 2021
ef87e58
Fix `manual_map`: don't lint when partially moved values are used.
Jarcho Feb 26, 2021
09a827a
Revert #6796: Downgrade manual_map to nursery
Jarcho Feb 26, 2021
3d3cfd3
added new lint `implicit_clone`
anall Feb 12, 2021
7154b23
Auto merge of #6730 - anall:feature/owned_to_owned_methods, r=camsteffen
bors Feb 27, 2021
2b3a731
Add missing diagnostic item Symbols
camsteffen Feb 27, 2021
51617b8
new lint: iter_count
TaKO8Ki Feb 25, 2021
7223ee6
allow clippy::iter_count
TaKO8Ki Feb 25, 2021
204b279
lint for `into_iter().count()`
TaKO8Ki Feb 25, 2021
9958af4
move `lints()` to `iter_count.rs`
TaKO8Ki Feb 25, 2021
cc2b000
return when the ty doesn't have `len()`
TaKO8Ki Feb 25, 2021
8bae279
remove if_chain
TaKO8Ki Feb 26, 2021
77907e6
receive iter method name as an argument
TaKO8Ki Feb 26, 2021
c297174
export `derefs_to_slice` from methods module
TaKO8Ki Feb 26, 2021
6041365
remove pub(crate)
TaKO8Ki Feb 26, 2021
bdeec5d
Use TypeckResults::expr_ty instead of TyCtxt::type_of to fix "Not a t…
Y-Nak Feb 27, 2021
e51bb0e
Add test for ICE 6793
Y-Nak Feb 27, 2021
6971b0d
Auto merge of #6812 - Y-Nak:fix-6792, r=matthiaskrgr
bors Feb 27, 2021
abd2c7e
Auto merge of #6802 - camsteffen:dogfood-fix, r=llogiq
bors Feb 28, 2021
b119b65
tests: add test that roughly ensures that our lint messages conform w…
matthiaskrgr Feb 24, 2021
5370576
fix clippy lint warnings
matthiaskrgr Feb 24, 2021
8eb2bd1
update the lint messages and tests
matthiaskrgr Feb 24, 2021
e107b65
disable lint_message_convention test inside the rustc test suite
matthiaskrgr Feb 25, 2021
e00b1cc
change some lint messages and remove old entries from the ignorelist
matthiaskrgr Feb 26, 2021
24460f7
lintcheck: update logs
matthiaskrgr Feb 26, 2021
ebc5c8f
use different example (C-like) for valid capitalized start of lint me…
matthiaskrgr Feb 28, 2021
da3a573
Fix false positives on procedural macros of `missing_inline_in_public…
Feb 28, 2021
a3278a1
Fix `manual_map`: do not expand macros in suggestions
Jarcho Feb 28, 2021
ac2f041
Auto merge of #6787 - matthiaskrgr:lint_msgs, r=llogiq
bors Feb 28, 2021
d931d1b
lintcheck: refactor: introduce a basic LintcheckConfig struct which h…
matthiaskrgr Feb 26, 2021
2d9932d
lintcheck: don't run clippy in parallel by default
matthiaskrgr Feb 27, 2021
e338604
lintcheck: uses consts for clippy driver and cargo clippy paths
matthiaskrgr Feb 27, 2021
1b1ed93
lintcheck: put the full paths (target/lintcheck/sources/<crate>...) t…
matthiaskrgr Feb 27, 2021
b9a7a2a
lintcheck: add a couple of dtolnays crates to the source list
matthiaskrgr Feb 27, 2021
70d952e
lintcheck: more fixes
matthiaskrgr Feb 28, 2021
1ebaae8
lintcheck: make download path and source path consts, move source dir…
matthiaskrgr Feb 28, 2021
45d6a77
lintcheck: add more embark crate sources to the sources toml
matthiaskrgr Feb 28, 2021
25f9098
update lintcheck_crates logs and fix typos
matthiaskrgr Feb 28, 2021
5ae1e17
Auto merge of #6813 - matthiaskrgr:lintcheck_refactor, r=flip1995
bors Mar 1, 2021
7984e60
Use diagnostic items in into_iter_collections
camsteffen Feb 27, 2021
ada8c72
Add version = "Two" to rustfmt.toml
camsteffen Mar 1, 2021
2c485e3
Don't move `yield` or inline assembly into closure
Jarcho Mar 1, 2021
f21320f
Use diagnostic or language items instead of paths
Jarcho Mar 2, 2021
e50afa4
Auto merge of #6822 - camsteffen:rustfmt, r=llogiq
bors Mar 2, 2021
62ac4bd
create loops dir; arrange manual_flatten lint and utils
nahuakang Feb 7, 2021
408368a
Refactor check_for_loop_arg; rename manual_flatten's lint back to che…
nahuakang Feb 8, 2021
7b0f588
Refactor check_for_loop_over_map_kv to its own module
nahuakang Feb 8, 2021
6e4663d
Refactor check_for_mut_range_bound to its own module
nahuakang Feb 8, 2021
71c9fdf
Refactor check_for_loop_range into its module
nahuakang Feb 8, 2021
71026ca
Refactor check_for_loop_explicit_counter to its own module
nahuakang Feb 8, 2021
1e5e541
Refactor check_for_single_element_loop to its own module
nahuakang Feb 8, 2021
9520cba
Add check_infinite_loop to its own module
nahuakang Feb 9, 2021
453e6b9
Add check_needless_collect to its own module
nahuakang Feb 9, 2021
2c1f676
Add detect_same_item_push to its own module
nahuakang Feb 9, 2021
5b870e1
Move detect_manual_memcpy to its module; split up utils structs
nahuakang Feb 9, 2021
455d047
Refactor never loop to its own module
nahuakang Feb 21, 2021
d0b657c
Refactor while let on iterator lint to its module; rename for loop ex…
nahuakang Feb 21, 2021
287a4f8
Refactor empty loop to its own module
nahuakang Feb 21, 2021
7158c94
Refactor while let loop to its own module
nahuakang Feb 21, 2021
7cfdef6
Move MinifyingSugg into manual_memcpy
nahuakang Feb 21, 2021
ecebfe0
Move check_for_loop_arg back to mod; split into 4 lint files
nahuakang Feb 21, 2021
2229a08
Clean up: Rename some files to be consistent with lint names; import …
nahuakang Feb 21, 2021
845a3a0
Include loops.rs changes from PR#6698
nahuakang Feb 22, 2021
eaf63d6
Unify names of lint entry functions in loops to 'check'
Y-Nak Mar 2, 2021
74bd806
Simplify check_for_loop_arg
Y-Nak Mar 2, 2021
306545f
Create transmute directory
magurotuna Feb 10, 2021
4ac438b
Add transmute/utils.rs
magurotuna Feb 10, 2021
0d7dd00
Move useless_transmute to its own module
magurotuna Feb 10, 2021
ef97764
Move wrong_transmute to its own module
magurotuna Feb 10, 2021
afc9275
Move crosspointer_transmute to its own module
magurotuna Feb 10, 2021
6442d45
Move transmute_ptr_to_ref to its own module
magurotuna Feb 10, 2021
4c65221
Move transmute_int_to_char to its own module
magurotuna Feb 10, 2021
7af3458
Move transmute_bytes_to_str and transmute_ptr_to_ptr to transmute_ref…
magurotuna Feb 10, 2021
f8bc0e2
Move transmute_ptr_to_ptr to its own module
magurotuna Feb 10, 2021
d04ea41
Move transmute_int_to_bool to its own module
magurotuna Feb 10, 2021
acedc7b
Move transmute_int_to_float to its own module
magurotuna Feb 10, 2021
e7d2393
Move transmute_float_to_int to its own module
magurotuna Feb 10, 2021
c57a826
Move unsound_collection_transmute to its own module
magurotuna Feb 10, 2021
25c221e
Move transmutes_expressible_as_ptr_casts to its own module
magurotuna Feb 10, 2021
89ef26a
Cleanup imports
magurotuna Feb 10, 2021
8a8f7b4
Refactor calls to lint check functions
magurotuna Feb 10, 2021
bf00098
Make check_cast private
magurotuna Feb 10, 2021
3cd6ca0
Auto merge of #6716 - magurotuna:refactor-transmute-mod, r=flip1995
bors Mar 2, 2021
eb04beb
Auto merge of #6791 - TaKO8Ki:iter-count, r=matthiaskrgr
bors Mar 2, 2021
19c886b
Remove "for_loop_arg.rs"
Y-Nak Mar 2, 2021
9e4a064
Move naive_bytecount to pedantic
djc Mar 2, 2021
ece3543
Auto merge of #6801 - Jarcho:manual_match_fix, r=phansch
bors Mar 2, 2021
e3f4855
Allow noop_method_call in clippy ui test
rylev Jan 18, 2021
09c4503
Fix borrow and deref
rylev Feb 16, 2021
43d19f6
Auto merge of #6824 - Y-Nak:refactor_loops_module, r=flip1995
bors Mar 3, 2021
5656510
Fix false-positive in `use_self`
daxpedda Mar 3, 2021
03e72d5
Let Cargo track `CLIPPY_ARGS`
Mar 3, 2021
ff51964
Auto merge of #6825 - djc:naive-bytecount-pedantic, r=Manishearth
bors Mar 3, 2021
bbe6416
lintcheck: fix clippy warnings
matthiaskrgr Mar 2, 2021
d783e3d
Auto merge of #6839 - matthiaskrgr:lintcheck_clippy_warnings, r=flip1995
bors Mar 4, 2021
39c5e86
When checking if two empty hir blocks are equal also check to see if …
Jarcho Mar 4, 2021
6680710
Auto merge of #6833 - daxpedda:use-self, r=Manishearth
bors Mar 4, 2021
7be3a32
Auto merge of #6843 - Jarcho:match_on_same_arms_macro, r=Manishearth
bors Mar 4, 2021
37c4b11
lintcheck: add test
matthiaskrgr Mar 4, 2021
3f7ad32
update lintcheck logs
matthiaskrgr Mar 4, 2021
f0e6ce8
Auto merge of #6846 - matthiaskrgr:lintcheck_test, r=Manishearth
bors Mar 4, 2021
26265bb
ci: Sync clippy and clippy_bors workflows
flip1995 Mar 5, 2021
5b2e7e9
Shrink the size of Rvalue by 16 bytes
oli-obk Mar 5, 2021
5ebe6d3
Fix dogfood test
flip1995 Mar 5, 2021
3c502ec
Remove hack that forces dogfood to run on nightly
flip1995 Mar 5, 2021
1d71d9a
Fix dogfood errors in clippy_lints
flip1995 Mar 5, 2021
4aaad08
Fix dogfood errors in clippy_dev
flip1995 Mar 5, 2021
74eb448
Extract directory creation into its own function
flip1995 Mar 5, 2021
9e54538
Auto merge of #6849 - flip1995:dogfood-fix, r=matthiaskrgr
bors Mar 5, 2021
45424c7
lintcheck: add --fix mode which tries to apply lint suggestions to th…
matthiaskrgr Mar 5, 2021
45454f0
Avoid mir in implicit_return
camsteffen Mar 5, 2021
ae8ec07
Avoid mir in missing_errors_doc
camsteffen Mar 5, 2021
5abd8c5
Use typeck_body
camsteffen Mar 5, 2021
54def1e
Auto merge of #6852 - camsteffen:avoid-mir, r=Manishearth
bors Mar 5, 2021
a0b7f9b
useless_format: fix examples in the description
mgacek8 Mar 5, 2021
0941fc0
Make clippy set mir_opt_level using Option
spastorino Mar 4, 2021
6b40d12
Rollup merge of #82736 - spastorino:mir-opt-level-perf-changes, r=oli…
GuillaumeGomez Mar 5, 2021
0153679
Auto merge of #6848 - matthiaskrgr:lintcheck_clippyfix, r=llogiq
bors Mar 5, 2021
13271d3
Auto merge of #6854 - mgacek8:6844_fix_doc_for_useless_format_lint, r…
bors Mar 6, 2021
e4ffff9
Use `LanguageItems::require`
Jarcho Mar 2, 2021
5945e85
Auto merge of #6823 - Jarcho:diagnostic_items, r=phansch
bors Mar 7, 2021
47145de
`len_without_is_empty` will now consider multiple impl blocks
Jarcho Mar 5, 2021
e451d6e
Auto merge of #6853 - Jarcho:len_without_is_empty_fp, r=Manishearth
bors Mar 7, 2021
3877a41
migrate paths to newly-added diagnostic items
anall Feb 27, 2021
9bdc273
relocate functions from `clippy_lints::types`
anall Mar 7, 2021
d02ca3b
Auto merge of #6807 - anall:feature/use_new_diagnostics, r=Manishearth
bors Mar 8, 2021
06fe44e
Add msrv to contents in adding lints md
giraffate Mar 8, 2021
b27cbda
make is_normalizable more strict
anall Mar 8, 2021
e6c643f
Auto merge of #6864 - giraffate:fix_doc_adding_a_new_lint, r=Manishearth
bors Mar 8, 2021
f3b68d3
Auto merge of #82727 - oli-obk:shrinkmem, r=pnkfelix
bors Mar 8, 2021
2d07c33
Rename `ClippyArgsCallbacks` to `RustcCallbacks`
Mar 8, 2021
2d53b6b
Move `test_no_deps_ignores_path_deps_in_workspaces()` out of `dogfood…
Mar 8, 2021
3cd5f44
Don't panic if `CLIPPY_ARGS` is not Unicode
Mar 8, 2021
d0d5232
Auto merge of #6834 - hyd-dev:clippy-args, r=phansch,flip1995,oli-obk
bors Mar 8, 2021
714a826
Create types dir and move old module under it
Y-Nak Feb 11, 2021
df307c0
Move box_vec to its own module
Y-Nak Feb 11, 2021
128f1f5
Move redundant_allocation to its own module
Y-Nak Feb 11, 2021
f110c5e
Move rc_buffer to its own module
Y-Nak Feb 12, 2021
2c2fb39
Move vec_box to its own module
Y-Nak Feb 12, 2021
fbd25e9
Add flags to detect lints are triggered
Y-Nak Feb 12, 2021
b59c879
Move option_option to its own module
Y-Nak Feb 12, 2021
cc3ab1c
Move linked_list to its own module
Y-Nak Feb 12, 2021
53d3ffe
Move borrowed_box to its own module
Y-Nak Feb 12, 2021
2afa7df
Remove unused is_local from borrowed_box
Y-Nak Feb 12, 2021
bb8208d
Import declared lints at the top of the file
Y-Nak Feb 16, 2021
db59c35
Fix some lints in types that fail dogfood
Y-Nak Feb 25, 2021
b207f23
Auto merge of #6725 - Y-Nak:refactor-types-lints, r=flip1995
bors Mar 8, 2021
f2d917e
Don't assume lang items will exist.
Jarcho Mar 8, 2021
c4e2cf9
Opt-in to rustc_private for `rust-analyzer`
DJMcNab Mar 8, 2021
bf98aa6
Fix redundant closure with macros
camsteffen Mar 8, 2021
7e4f5ca
clippy: fix or-pattern in let binding
mark-i-m Mar 8, 2021
8c540dc
Improve the redundant_closure message
camsteffen Mar 8, 2021
2cb5bbf
Auto merge of #6871 - camsteffen:redundant-closure-macro, r=Manishearth
bors Mar 8, 2021
f098007
Separate lints of casts group from types group
Y-Nak Mar 9, 2021
360f065
Move 'is_isize_or_usize' to clippy_utils
Y-Nak Mar 9, 2021
c2cbcd3
Move cast_precision_loss to its own module
Y-Nak Mar 9, 2021
b12d751
Move cast_lossless to its own module
Y-Nak Mar 9, 2021
e322c77
use TyS::walk
anall Mar 9, 2021
e812a8a
use `.all` instead of negative use of `.any`
anall Mar 9, 2021
727e5f1
Auto merge of #6869 - DJMcNab:rust-analyzer-private, r=phansch
bors Mar 9, 2021
0534bf4
Move cast_possible_truncation to its own module
Y-Nak Mar 9, 2021
0975031
Move cast_sign_loss to its own module
Y-Nak Mar 9, 2021
a383e03
Move cast_possible_wrap to its own module
Y-Nak Mar 9, 2021
9709993
Move unnecessary_cast to its own module
Y-Nak Mar 9, 2021
0dce992
Remove 'lint_numeric_casts'
Y-Nak Mar 9, 2021
458f6d1
Move fn_to_numeric_cast to its own module
Y-Nak Mar 9, 2021
9a24877
Move fn_to_numeric_cast_with_truncation to its own module
Y-Nak Mar 9, 2021
ebd1ec0
Move cast_ptr_alignment to its own module
Y-Nak Mar 9, 2021
f33bb3d
Move cast_ref_to_mut to its own module
Y-Nak Mar 9, 2021
43c88c6
Move char_lit_as_u8 to its own module
Y-Nak Mar 9, 2021
824662d
Rollup merge of #82048 - mark-i-m:or-pat-type-ascription, r=petrochenkov
m-ou-se Mar 9, 2021
9e631da
Move ptr_as_ptr to its own module
Y-Nak Mar 9, 2021
3ed0bcc
Auto merge of #6873 - Y-Nak:refactor-casts-lint, r=flip1995
bors Mar 9, 2021
627e910
Auto merge of #6868 - Jarcho:lang_item, r=flip1995
bors Mar 9, 2021
9707599
add comment for when can be removed
anall Mar 9, 2021
8a5f98a
Auto merge of #6866 - anall:ice6840, r=flip1995
bors Mar 9, 2021
e0f982b
Improve doc on `map_flatten`
giraffate Mar 9, 2021
2b781c9
Auto merge of #6876 - giraffate:improve_doc_on_map_flatten, r=flip1995
bors Mar 9, 2021
8e1ce48
Set Clippy authors to "The Rust Clippy Developers"
flip1995 Mar 9, 2021
6f60dd8
Update match branches
JulianKnodt Oct 5, 2020
fb4dc58
Update cranelift
JulianKnodt Dec 29, 2020
cb8bc0b
Switch to changing cp_non_overlap in tform
JulianKnodt Jan 23, 2021
8d5e0f5
Simplify clippy author.
cjgillot Dec 6, 2020
476c528
Do not store attrs in FnKind.
cjgillot Nov 27, 2020
3e721b1
Remove hir::StmtKind::attrs.
cjgillot Nov 25, 2020
acd6014
Remove hir::Local::attrs.
cjgillot Nov 25, 2020
b32cffe
Remove hir::Crate::attrs.
cjgillot Nov 26, 2020
0449607
Remove hir::Arm::attrs.
cjgillot Nov 26, 2020
55f68ea
Remove hir::Variant::attrs.
cjgillot Nov 26, 2020
c3a17db
Remove hir::StructField::attrs.
cjgillot Nov 26, 2020
dd2af14
Remove hir::TraitItem::attrs.
cjgillot Nov 27, 2020
49835d8
Remove hir::ImplItem::attrs.
cjgillot Nov 27, 2020
dc9560c
Remove hir::Item::attrs.
cjgillot Jan 24, 2021
6c66826
Remove hir::Expr::attrs.
cjgillot Nov 27, 2020
fb27517
Auto merge of #6878 - flip1995:authors, r=Manishearth
bors Mar 9, 2021
14e23f1
convert slice doc link to intra-doc links
mockersf Mar 9, 2021
a6624d3
Add spirv extension handling in compiletest
XAMPPRocky Mar 10, 2021
3a3e7eb
update MSYS2 link in README
tspiteri Mar 10, 2021
36a27ec
Auto merge of #79519 - cjgillot:noattr, r=wesleywiser
bors Mar 10, 2021
a4d7046
Fix "run" button position in error index
GuillaumeGomez Mar 10, 2021
a1e25a9
Auto merge of #6794 - camsteffen:needless-borrowed-ref, r=flip1995
bors Mar 10, 2021
8222d48
Auto merge of #6814 - hyd-dev:issue-6486, r=flip1995
bors Mar 10, 2021
0d07153
add back sort_by_key link, allow linter and add comment
mockersf Mar 10, 2021
0666905
remove slice linkcheck exceptions
mockersf Mar 10, 2021
232b9f1
apply review
mockersf Mar 10, 2021
9925ecb
Add reexport tests
aDotInTheVoid Feb 26, 2021
5f24798
Improve some jsondocck errors
aDotInTheVoid Feb 26, 2021
68f50c8
Ignore Vim swap files
camelid Mar 11, 2021
3934dd1
rustdoc: tweak the search index format
notriddle Mar 11, 2021
78c740e
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Mar 11, 2021
ae6be4f
Bump nightly version => 2021-03-11
flip1995 Mar 11, 2021
9c1dd0c
Fix remaining dogfood errors (internal lints)
flip1995 Mar 11, 2021
00c0872
Adjust some `#[cfg]`s to take non-Unix non-Windows operating systems …
Mar 11, 2021
99afc6e
Auto merge of #6881 - flip1995:rustup, r=flip1995
bors Mar 11, 2021
8da222d
Merge commit '99afc6e6ac2ce874c4fed32c083f1e160f533015' into clippyup
flip1995 Mar 11, 2021
f6bb462
Update Cargo.lock
flip1995 Mar 11, 2021
c69b108
Reintroduce accidentally deleted assertions.
oli-obk Mar 11, 2021
ae5cc8a
Update RLS
Xanewok Mar 11, 2021
2a34428
Make THIR data structures public
LeSeulArtichaut Mar 7, 2021
6bf4147
Add `-Z unpretty` flag for the THIR
LeSeulArtichaut Mar 7, 2021
eb714da
Rollup merge of #80385 - camelid:clarify-cell-replace-docs, r=Mark-Si…
JohnTitor Mar 11, 2021
56fee40
Rollup merge of #82571 - aDotInTheVoid:reexport-tests, r=CraftSpider
JohnTitor Mar 11, 2021
2515638
Rollup merge of #82860 - LeSeulArtichaut:unpretty-thir, r=spastorino
JohnTitor Mar 11, 2021
5ad79a2
Rollup merge of #82950 - mockersf:slice-intra-doc-link, r=jyn514
JohnTitor Mar 11, 2021
152bf55
Rollup merge of #82965 - XAMPPRocky:spv-ext, r=nagisa
JohnTitor Mar 11, 2021
3e93b9d
Rollup merge of #82966 - tspiteri:msys2-link, r=Mark-Simulacrum
JohnTitor Mar 11, 2021
155888a
Rollup merge of #82979 - GuillaumeGomez:run-button-pos, r=Nemo157
JohnTitor Mar 11, 2021
bc1f28d
Rollup merge of #83001 - camelid:gitignore-vim-swap, r=Mark-Simulacrum
JohnTitor Mar 11, 2021
f25817b
Rollup merge of #83003 - notriddle:rustdoc-index-v3, r=GuillaumeGomez
JohnTitor Mar 11, 2021
766c875
Rollup merge of #83012 - flip1995:clippyup, r=Manishearth
JohnTitor Mar 11, 2021
8f20ff6
Rollup merge of #83013 - hyd-dev:cfg-unix-windows, r=bjorn3
JohnTitor Mar 11, 2021
d7b7d9a
Rollup merge of #83018 - oli-obk:float_check, r=davidtwco
JohnTitor Mar 11, 2021
eb0b58b
Rollup merge of #83024 - Xanewok:update-rls, r=Dylan-DPC
JohnTitor Mar 11, 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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# configure your local ignore list.
# FIXME: This needs cleanup.
*~
*.swp
*.swo
.#*
.DS_Store
.cproject
Expand Down
3 changes: 3 additions & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ dependencies = [
"clippy_lints",
"compiletest_rs 0.6.0",
"derive-new",
"regex",
"rustc-workspace-hack",
"rustc_tools_util 0.2.0",
"semver 0.11.0",
Expand Down Expand Up @@ -3870,13 +3871,15 @@ dependencies = [
"rustc_metadata",
"rustc_middle",
"rustc_mir",
"rustc_mir_build",
"rustc_parse",
"rustc_plugin_impl",
"rustc_save_analysis",
"rustc_serialize",
"rustc_session",
"rustc_span",
"rustc_target",
"rustc_typeck",
"tracing",
"tracing-subscriber",
"tracing-tree",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ build.

[MSYS2][msys2] can be used to easily build Rust on Windows:

[msys2]: https://msys2.github.io/
[msys2]: https://www.msys2.org/

1. Grab the latest [MSYS2 installer][msys2] and go through the installer.

Expand Down
9 changes: 7 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
status.signal() == Some(libc::SIGILL)
}

#[cfg(windows)]
#[cfg(not(unix))]
fn is_illegal_instruction(_status: &ExitStatus) -> bool {
false
}
Expand Down Expand Up @@ -1198,7 +1198,7 @@ fn exec_linker(
flush_linked_file(&output, out_filename)?;
return output;

#[cfg(unix)]
#[cfg(not(windows))]
fn flush_linked_file(_: &io::Result<Output>, _: &Path) -> io::Result<()> {
Ok(())
}
Expand Down Expand Up @@ -1238,6 +1238,11 @@ fn exec_linker(
err.raw_os_error() == Some(ERROR_FILENAME_EXCED_RANGE)
}

#[cfg(not(any(unix, windows)))]
fn command_line_too_big(_: &io::Error) -> bool {
false
}

struct Escape<'a> {
arg: &'a str,
is_like_msvc: bool,
Expand Down
2 changes: 2 additions & 0 deletions compiler/rustc_driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ rustc_interface = { path = "../rustc_interface" }
rustc_serialize = { path = "../rustc_serialize" }
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }
rustc_mir_build = { path = "../rustc_mir_build" }
rustc_typeck = { path = "../rustc_typeck" }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"] }
Expand Down
17 changes: 17 additions & 0 deletions compiler/rustc_driver/src/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ use rustc_hir_pretty as pprust_hir;
use rustc_middle::hir::map as hir_map;
use rustc_middle::ty::{self, TyCtxt};
use rustc_mir::util::{write_mir_graphviz, write_mir_pretty};
use rustc_mir_build::thir;
use rustc_session::config::{Input, PpAstTreeMode, PpHirMode, PpMode, PpSourceMode};
use rustc_session::Session;
use rustc_span::symbol::Ident;
use rustc_span::FileName;

use std::cell::Cell;
use std::fmt::Write;
use std::path::Path;

pub use self::PpMode::*;
Expand Down Expand Up @@ -469,6 +471,21 @@ pub fn print_after_hir_lowering<'tcx>(
format!("{:#?}", krate)
}),

ThirTree => {
let mut out = String::new();
abort_on_err(rustc_typeck::check_crate(tcx), tcx.sess);
debug!("pretty printing THIR tree");
for did in tcx.body_owners() {
let hir = tcx.hir();
let body = hir.body(hir.body_owned_by(hir.local_def_id_to_hir_id(did)));
let arena = thir::Arena::default();
let thir =
thir::build_thir(tcx, ty::WithOptConstParam::unknown(did), &arena, &body.value);
let _ = writeln!(out, "{:?}:\n{:#?}\n", did, thir);
}
out
}

_ => unreachable!(),
};

Expand Down
3 changes: 1 addition & 2 deletions compiler/rustc_mir_build/src/build/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::build;
use crate::build::scope::DropKind;
use crate::thir::cx::build_thir;
use crate::thir::{Arena, BindingMode, Expr, LintLevel, Pat, PatKind};
use crate::thir::{build_thir, Arena, BindingMode, Expr, LintLevel, Pat, PatKind};
use rustc_attr::{self as attr, UnwindAttr};
use rustc_errors::ErrorReported;
use rustc_hir as hir;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extern crate rustc_middle;

mod build;
mod lints;
mod thir;
pub mod thir;

use rustc_middle::ty::query::Providers;

Expand Down
25 changes: 23 additions & 2 deletions compiler/rustc_mir_build/src/thir/constant.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use rustc_apfloat::Float;
use rustc_ast as ast;
use rustc_middle::mir::interpret::{
Allocation, ConstValue, LitToConstError, LitToConstInput, Scalar,
Expand Down Expand Up @@ -61,20 +62,40 @@ fn parse_float<'tcx>(num: Symbol, fty: ty::FloatTy, neg: bool) -> Result<ConstVa
use rustc_apfloat::ieee::{Double, Single};
let scalar = match fty {
ty::FloatTy::F32 => {
num.parse::<f32>().map_err(|_| ())?;
let rust_f = num.parse::<f32>().map_err(|_| ())?;
let mut f = num.parse::<Single>().unwrap_or_else(|e| {
panic!("apfloat::ieee::Single failed to parse `{}`: {:?}", num, e)
});
assert!(
u128::from(rust_f.to_bits()) == f.to_bits(),
"apfloat::ieee::Single gave different result for `{}`: \
{}({:#x}) vs Rust's {}({:#x})",
rust_f,
f,
f.to_bits(),
Single::from_bits(rust_f.to_bits().into()),
rust_f.to_bits()
);
if neg {
f = -f;
}
Scalar::from_f32(f)
}
ty::FloatTy::F64 => {
num.parse::<f64>().map_err(|_| ())?;
let rust_f = num.parse::<f64>().map_err(|_| ())?;
let mut f = num.parse::<Double>().unwrap_or_else(|e| {
panic!("apfloat::ieee::Double failed to parse `{}`: {:?}", num, e)
});
assert!(
u128::from(rust_f.to_bits()) == f.to_bits(),
"apfloat::ieee::Double gave different result for `{}`: \
{}({:#x}) vs Rust's {}({:#x})",
rust_f,
f,
f.to_bits(),
Double::from_bits(rust_f.to_bits().into()),
rust_f.to_bits()
);
if neg {
f = -f;
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_build/src/thir/cx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use rustc_middle::middle::region;
use rustc_middle::mir::interpret::{LitToConstError, LitToConstInput};
use rustc_middle::ty::{self, Ty, TyCtxt};

crate fn build_thir<'thir, 'tcx>(
pub fn build_thir<'thir, 'tcx>(
tcx: TyCtxt<'tcx>,
owner_def: ty::WithOptConstParam<LocalDefId>,
arena: &'thir Arena<'thir, 'tcx>,
Expand Down
79 changes: 40 additions & 39 deletions compiler/rustc_mir_build/src/thir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,50 +18,51 @@ use rustc_target::abi::VariantIdx;
use rustc_target::asm::InlineAsmRegOrRegClass;

crate mod constant;

crate mod cx;
pub use cx::build_thir;

crate mod pattern;
crate use self::pattern::PatTyProj;
crate use self::pattern::{BindingMode, FieldPat, Pat, PatKind, PatRange};
pub use self::pattern::{Ascription, BindingMode, FieldPat, Pat, PatKind, PatRange, PatTyProj};

mod arena;
crate use arena::Arena;
pub use arena::Arena;

mod util;

#[derive(Copy, Clone, Debug)]
crate enum LintLevel {
pub enum LintLevel {
Inherited,
Explicit(hir::HirId),
}

#[derive(Debug)]
crate struct Block<'thir, 'tcx> {
crate targeted_by_break: bool,
crate region_scope: region::Scope,
crate opt_destruction_scope: Option<region::Scope>,
crate span: Span,
crate stmts: &'thir [Stmt<'thir, 'tcx>],
crate expr: Option<&'thir Expr<'thir, 'tcx>>,
crate safety_mode: BlockSafety,
pub struct Block<'thir, 'tcx> {
pub targeted_by_break: bool,
pub region_scope: region::Scope,
pub opt_destruction_scope: Option<region::Scope>,
pub span: Span,
pub stmts: &'thir [Stmt<'thir, 'tcx>],
pub expr: Option<&'thir Expr<'thir, 'tcx>>,
pub safety_mode: BlockSafety,
}

#[derive(Copy, Clone, Debug)]
crate enum BlockSafety {
pub enum BlockSafety {
Safe,
ExplicitUnsafe(hir::HirId),
PushUnsafe,
PopUnsafe,
}

#[derive(Debug)]
crate struct Stmt<'thir, 'tcx> {
crate kind: StmtKind<'thir, 'tcx>,
crate opt_destruction_scope: Option<region::Scope>,
pub struct Stmt<'thir, 'tcx> {
pub kind: StmtKind<'thir, 'tcx>,
pub opt_destruction_scope: Option<region::Scope>,
}

#[derive(Debug)]
crate enum StmtKind<'thir, 'tcx> {
pub enum StmtKind<'thir, 'tcx> {
Expr {
/// scope for this statement; may be used as lifetime of temporaries
scope: region::Scope,
Expand Down Expand Up @@ -111,23 +112,23 @@ rustc_data_structures::static_assert_size!(Expr<'_, '_>, 144);
/// example, method calls and overloaded operators are absent: they are
/// expected to be converted into `Expr::Call` instances.
#[derive(Debug)]
crate struct Expr<'thir, 'tcx> {
pub struct Expr<'thir, 'tcx> {
/// type of this expression
crate ty: Ty<'tcx>,
pub ty: Ty<'tcx>,

/// lifetime of this expression if it should be spilled into a
/// temporary; should be None only if in a constant context
crate temp_lifetime: Option<region::Scope>,
pub temp_lifetime: Option<region::Scope>,

/// span of the expression in the source
crate span: Span,
pub span: Span,

/// kind of expression
crate kind: ExprKind<'thir, 'tcx>,
pub kind: ExprKind<'thir, 'tcx>,
}

#[derive(Debug)]
crate enum ExprKind<'thir, 'tcx> {
pub enum ExprKind<'thir, 'tcx> {
Scope {
region_scope: region::Scope,
lint_level: LintLevel,
Expand Down Expand Up @@ -316,41 +317,41 @@ crate enum ExprKind<'thir, 'tcx> {
}

#[derive(Debug)]
crate struct FieldExpr<'thir, 'tcx> {
crate name: Field,
crate expr: &'thir Expr<'thir, 'tcx>,
pub struct FieldExpr<'thir, 'tcx> {
pub name: Field,
pub expr: &'thir Expr<'thir, 'tcx>,
}

#[derive(Debug)]
crate struct FruInfo<'thir, 'tcx> {
crate base: &'thir Expr<'thir, 'tcx>,
crate field_types: &'thir [Ty<'tcx>],
pub struct FruInfo<'thir, 'tcx> {
pub base: &'thir Expr<'thir, 'tcx>,
pub field_types: &'thir [Ty<'tcx>],
}

#[derive(Debug)]
crate struct Arm<'thir, 'tcx> {
crate pattern: Pat<'tcx>,
crate guard: Option<Guard<'thir, 'tcx>>,
crate body: &'thir Expr<'thir, 'tcx>,
crate lint_level: LintLevel,
crate scope: region::Scope,
crate span: Span,
pub struct Arm<'thir, 'tcx> {
pub pattern: Pat<'tcx>,
pub guard: Option<Guard<'thir, 'tcx>>,
pub body: &'thir Expr<'thir, 'tcx>,
pub lint_level: LintLevel,
pub scope: region::Scope,
pub span: Span,
}

#[derive(Debug)]
crate enum Guard<'thir, 'tcx> {
pub enum Guard<'thir, 'tcx> {
If(&'thir Expr<'thir, 'tcx>),
IfLet(Pat<'tcx>, &'thir Expr<'thir, 'tcx>),
}

#[derive(Copy, Clone, Debug)]
crate enum LogicalOp {
pub enum LogicalOp {
And,
Or,
}

#[derive(Debug)]
crate enum InlineAsmOperand<'thir, 'tcx> {
pub enum InlineAsmOperand<'thir, 'tcx> {
In {
reg: InlineAsmRegOrRegClass,
expr: &'thir Expr<'thir, 'tcx>,
Expand Down
Loading