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

Use tuple inference for closures #21

Closed
wants to merge 3,352 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
3352 commits
Select commit Hold shift + click to select a range
619ca76
Refactoring: use inner function
giraffate Sep 7, 2020
5d085ad
Some refactoring
giraffate Sep 7, 2020
b869aa5
Add saturating methods for `Duration`
marmeladema Aug 30, 2020
ed4dcc0
Make rustdoc output deterministic for UI tests
jyn514 Sep 8, 2020
71569e4
Auto merge of #75138 - jumbatm:session-diagnostic-derive, r=oli-obk
bors Sep 8, 2020
3a3a085
Unstable book rust-attrs does not work on generics
pickfire Sep 8, 2020
1f78509
Improve wording of E0607 explanation
camelid Sep 8, 2020
98a5506
Add "For example,"
camelid Sep 8, 2020
0c9bf13
Add a script to automatically update Rust/Clang versions
jyn514 Sep 8, 2020
fa79db8
Auto merge of #76210 - Mark-Simulacrum:tracing-update, r=oli-obk
bors Sep 8, 2020
e82584a
Auto merge of #75585 - RalfJung:demotion, r=oli-obk
bors Sep 8, 2020
35fc835
Auto merge of #76423 - Mark-Simulacrum:stable-bootstrap, r=jyn514
bors Sep 8, 2020
f64ddc6
triagebot: enable github releases synchronization
pietroalbini Sep 8, 2020
fb97024
update Miri
RalfJung Sep 8, 2020
c8262fd
Add missed spaces to GCC-WARNING.txt
artemmukhin Sep 8, 2020
5a6b426
Auto merge of #76308 - wesleywiser:enable_simplifyarmidentity_mir_opt…
bors Sep 8, 2020
0065e33
rustbuild: don't set PYTHON_EXECUTABLE and WITH_POLLY cmake vars sinc…
matthiaskrgr Sep 8, 2020
7bc0bf7
Auto merge of #76469 - RalfJung:miri, r=RalfJung
bors Sep 8, 2020
2c9f82e
Add some tests to `same_item_push`
giraffate Sep 8, 2020
952c046
Refactoring: tests in `same_item_push`
giraffate Sep 8, 2020
1d8ae3a
Address `items_after_statement`
giraffate Sep 8, 2020
a899ad2
Change suggestion to `create_dir_all({})` from `std::fs::create_dir_a…
hkmatsumoto Sep 8, 2020
c81935e
make `ConstEvaluatable` more strict
lcnr Aug 6, 2020
ef6100e
convert to future compat lint
lcnr Aug 6, 2020
c10ad0d
review
lcnr Aug 6, 2020
7804644
add tests
lcnr Aug 6, 2020
1dd00e6
add tracking issue, fix rebase
lcnr Sep 1, 2020
4226a17
fix test
lcnr Sep 8, 2020
c3c84ad
Convert MAXIMUM_ZST_CAPACITY to be calculated in a
moonheart08 Sep 8, 2020
5099914
Auto merge of #76332 - Mark-Simulacrum:bootstrap-llvm, r=pietroalbini
bors Sep 8, 2020
75e471a
Add MaybeUninit::drop.
m-ou-se Sep 8, 2020
caef832
Fix doc comment on MaybeUninit::drop.
m-ou-se Sep 8, 2020
e02952c
Update library/alloc/src/collections/vec_deque.rs
moonheart08 Sep 8, 2020
75a2c68
Update comment in config.toml.example
petrochenkov Sep 8, 2020
e0df2f8
Create new E0774 code error
GuillaumeGomez Sep 5, 2020
1d02f4f
Update tests
GuillaumeGomez Sep 5, 2020
0aaf56f
Remove a stray ignore-tidy-undocumented-unsafe
moonheart08 Sep 8, 2020
e83190b
Merge remote-tracking branch 'upstream/master' into rustup
ebroto Sep 8, 2020
8d6cf3a
Auto merge of #6018 - ebroto:rustup, r=ebroto
bors Sep 8, 2020
98231bf
Make duration_since documentation more clear
cw-alexander-brausch Aug 31, 2020
8b54f1e
Auto merge of #6016 - giraffate:restrict_same_item_push, r=ebroto
bors Sep 8, 2020
325acef
Use intra-doc links in `core::ptr`
camelid Sep 8, 2020
f23670e
Adjust Clippy for CONST_ITEM_MUTATION lint
Aaron1011 Sep 8, 2020
4434e8c
Adjust Clippy for CONST_ITEM_MUTATION lint
Aaron1011 Sep 8, 2020
8b2106f
Update cargo
ehuss Sep 8, 2020
87302a2
Rollup merge of #76162 - abrausch:documentation-fix-duration_since, r…
Dylan-DPC Sep 8, 2020
4ac88c0
Rollup merge of #76355 - calebcartwright:reduce-rustfmt-visibility, r…
Dylan-DPC Sep 8, 2020
3cec71e
Rollup merge of #76374 - pickfire:patch-4, r=Cldfire
Dylan-DPC Sep 8, 2020
b2ca513
Rollup merge of #76379 - petrochenkov:nodegen, r=Mark-Simulacrum
Dylan-DPC Sep 8, 2020
222b885
Rollup merge of #76389 - MaulingMonkey:pr-natvis-hashmap-vsc, r=petro…
Dylan-DPC Sep 8, 2020
d45faff
Rollup merge of #76396 - dylni:fix-typo-in-tracking-issue-template, r…
Dylan-DPC Sep 8, 2020
1083833
Rollup merge of #76401 - JulianKnodt:i68366, r=lcnr
Dylan-DPC Sep 8, 2020
1aef86c
Rollup merge of #76402 - elichai:patch-2, r=wesleywiser
Dylan-DPC Sep 8, 2020
1270734
Rollup merge of #76403 - scileo:doc-all-impls, r=lcnr
Dylan-DPC Sep 8, 2020
389321a
Rollup merge of #76498 - ehuss:update-cargo, r=ehuss
Dylan-DPC Sep 8, 2020
90782cb
Auto merge of #76502 - Dylan-DPC:rollup-2c4zz0t, r=Dylan-DPC
bors Sep 9, 2020
c19b237
Add -Zgraphviz_dark_mode
richkadel Sep 8, 2020
15ccdeb
Update to hashbrown 0.9
mbrubeck Sep 3, 2020
ebd15e7
Implement HashSet in terms of hashbrown::HashSet
mbrubeck Aug 10, 2020
49aef96
Add HashMap::drain_filter and HashSet::drain_filter
mbrubeck Aug 10, 2020
fb1fab5
Tests for HashMap/HashSet::drain_filter
mbrubeck Sep 7, 2020
d24026b
Fix broken link
camelid Sep 9, 2020
c66789d
Capitalize safety comments
Flying-Toast Sep 9, 2020
2799aec
Capitalize safety comments
Flying-Toast Sep 9, 2020
78f4cbb
Auto merge of #76418 - jyn514:readme, r=Dylan-DPC
bors Sep 9, 2020
780ca14
Auto merge of #76453 - camelid:fix-css-crate-list, r=GuillaumeGomez,o…
bors Sep 9, 2020
0855263
Auto merge of #76463 - camelid:improve-E0607-explanation, r=jyn514
bors Sep 9, 2020
c81b43d
Add `-Z combine_cgu` flag
Sep 9, 2020
3f5e617
Auto merge of #76406 - GuillaumeGomez:create-e0774, r=pickfire,jyn514
bors Sep 9, 2020
656a17b
Rename MaybeUninit::drop to assume_init_drop.
m-ou-se Sep 9, 2020
a14efd1
Rename MaybeUninit::read to assume_init_read.
m-ou-se Sep 9, 2020
e215e79
:arrow_up: rust-analyzer
Sep 9, 2020
8b39250
Fix non-determinism in generated format string.
jumbatm Sep 9, 2020
683d1bc
Auto merge of #76513 - rust-lang:rust-analyzer-2020-09-09, r=jonas-sc…
bors Sep 9, 2020
5d7e7c2
Add revisions to const generic issue UI tests.
hameerabbasi Sep 9, 2020
7889373
make as_leaf return a raw pointer, to reduce aliasing assumptions
RalfJung Jul 2, 2020
8158d56
BTreeMap: avoid aliasing by avoiding slices
ssomers Aug 16, 2020
b4bdc07
Auto merge of #76445 - jyn514:doctests, r=Mark-Simulacrum,ollie27
bors Sep 9, 2020
be28b62
remove redundant clones
matthiaskrgr Sep 9, 2020
4db1029
link to the Box docs in related lint documentation.
matthiaskrgr Sep 9, 2020
0016405
Remove unused PlaceContext::NonUse(NonUseContext::Coverage)
tmiasko Sep 9, 2020
de195f2
print the unit type `()` in related lint messages.
matthiaskrgr Sep 9, 2020
a94b2cb
Add safety docs about T's invariants in MaybeUninit::assume_init_drop.
m-ou-se Sep 9, 2020
43c7a9b
Fix broken doc links in MaybeUninit.
m-ou-se Sep 9, 2020
493c037
Eliminate mut reference UB in Drop impl for Rc<T>
carbotaniuman Sep 9, 2020
d92155b
Auto merge of #73971 - ssomers:slice_slasher, r=Mark-Simulacrum
bors Sep 9, 2020
74e0719
fix test on 32 bit systems
lcnr Sep 9, 2020
8f43fa0
Add WeakInner<'_> and have Weak::inner() return it
carbotaniuman Sep 9, 2020
bb57c9f
Format
carbotaniuman Sep 9, 2020
e2be5f5
Auto merge of #74595 - lcnr:ConstEvaluatable-fut-compat, r=oli-obk
bors Sep 9, 2020
10d3f8a
Move `rustllvm` into `rustc_llvm`
petrochenkov Jul 26, 2020
884a1b4
Fix anchor links
camelid Sep 9, 2020
f7aee33
Also fixed monospace font for d3-graphviz engine
richkadel Sep 9, 2020
2b54ab8
BTreeMap: pull the map's root out of NodeRef
ssomers Aug 16, 2020
07dbe49
Rollup merge of #75094 - 0dvictor:cgu, r=oli-obk
tmandry Sep 9, 2020
5ea5551
Rollup merge of #75984 - kornelski:typeormodule, r=matthewjasper
tmandry Sep 9, 2020
b4b8a52
Rollup merge of #76141 - jyn514:config.toml, r=Mark-Simulacrum
tmandry Sep 9, 2020
bab0968
Rollup merge of #76313 - richkadel:mir-spanview-2, r=wesleywiser
tmandry Sep 9, 2020
d0c2a2d
Rollup merge of #76430 - pickfire:patch-7, r=steveklabnik
tmandry Sep 9, 2020
df84ac7
Rollup merge of #76465 - jyn514:auto-versioning, r=elichai
tmandry Sep 9, 2020
09bfb7e
Rollup merge of #76473 - ortem:fix-gcc-warning, r=jonas-schievink
tmandry Sep 9, 2020
0d20cf8
Rollup merge of #76481 - moonheart08:vec_deque_constify, r=sfackler
tmandry Sep 9, 2020
342b406
Rollup merge of #76493 - moonheart08:unique-quick, r=jyn514
tmandry Sep 9, 2020
c18fa46
Rollup merge of #76504 - Flying-Toast:master, r=lcnr
tmandry Sep 9, 2020
98f59bc
Rollup merge of #76515 - jumbatm:issue76496-reproducibility-regressio…
tmandry Sep 9, 2020
09a364e
Rollup merge of #76516 - pietroalbini:github-releases, r=Mark-Simulacrum
tmandry Sep 9, 2020
09c6149
Rollup merge of #76522 - matthiaskrgr:redundant_clone, r=jonas-schievink
tmandry Sep 9, 2020
32714eb
Rollup merge of #76523 - tmiasko:non-use-context-coverage, r=wesleywiser
tmandry Sep 9, 2020
97eb606
Auto merge of #76540 - tmandry:rollup-5ogt8x0, r=tmandry
bors Sep 9, 2020
f42dac0
Document btree's unwrap_unchecked
ssomers Jul 23, 2020
00e64ba
Validate removal of AscribeUserType, FakeRead, and Shallow borrow
tmiasko Sep 10, 2020
fdff7de
Revert "Rollup merge of #76285 - matklad:censor-spacing, r=petrochenkov"
tmandry Sep 10, 2020
01bf350
Reword `trivial_casts` lint to better explain.
alilleybrinker Sep 10, 2020
f09372a
Rollup merge of #74787 - petrochenkov:rustllvm, r=cuviper
tmandry Sep 10, 2020
fa56cf5
Rollup merge of #76458 - mbrubeck:hash_drain_filter, r=Amanieu
tmandry Sep 10, 2020
9fa0794
Rollup merge of #76472 - matthiaskrgr:llvm_cmake_vars, r=Mark-Simulacrum
tmandry Sep 10, 2020
d013e60
Rollup merge of #76497 - camelid:intra-doc-links-for-core-ptr, r=jyn514
tmandry Sep 10, 2020
ba6e2b3
Rollup merge of #76500 - richkadel:mir-graphviz-dark, r=tmandry
tmandry Sep 10, 2020
8bf03c3
Rollup merge of #76543 - ssomers:btree_cleanup_4, r=Mark-Simulacrum
tmandry Sep 10, 2020
193503e
Rollup merge of #76556 - tmandry:revert-76285, r=tmandry
tmandry Sep 10, 2020
a1894e4
Auto merge of #76558 - tmandry:rollup-bskim2r, r=tmandry
bors Sep 10, 2020
82cb379
Fix broken test on MSVC
calebzulawski Sep 10, 2020
961f183
Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk
bors Sep 10, 2020
8819721
Auto merge of #75573 - Aaron1011:feature/const-mutation-lint, r=oli-obk
bors Sep 10, 2020
8667f93
implement `const_evaluatable_checked` feature MVP
lcnr Sep 10, 2020
2815db1
Respond to review comments.
hameerabbasi Sep 10, 2020
36903d7
Add revisions to const generic default UI tests.
hameerabbasi Sep 10, 2020
bec8e5f
Add revisions to const generic UI tests.
hameerabbasi Sep 10, 2020
300b0ac
fix tidy, small cleanup
lcnr Sep 10, 2020
e0f46a1
Auto merge of #6024 - matthiaskrgr:unit_type, r=phansch
bors Sep 10, 2020
a18b34d
Auto merge of #76291 - matklad:spacing, r=petrochenkov
bors Sep 10, 2020
8b05998
small typo fix in rustc_parse docs
yokodake Sep 10, 2020
25b2f48
Auto merge of #76378 - petrochenkov:lldtest, r=Mark-Simulacrum
bors Sep 10, 2020
a5cdc06
ci: avoid moving the build directory on GHA
pietroalbini Sep 10, 2020
6bfe132
take reference to Place directly instead of taking reference to Box<P…
matthiaskrgr Sep 10, 2020
e2a511f
use String::from instead of format!() macro to craft string clippy::u…
matthiaskrgr Sep 10, 2020
e11c667
don't clone types that are copy (clippy::clone_on_copy)
matthiaskrgr Sep 10, 2020
9bb10cc
use push(char) instead of push_str(&str) to add single chars to strings
matthiaskrgr Sep 10, 2020
d7a9707
Add missing examples on core traits' method
GuillaumeGomez Sep 10, 2020
2d56512
Cleanup of rustup
flip1995 Sep 10, 2020
87a4495
Auto merge of #6027 - flip1995:rustup, r=flip1995
bors Sep 10, 2020
0e9769e
Auto merge of #6023 - matthiaskrgr:box, r=flip1995
bors Sep 10, 2020
fd4dd00
Syntactically permit unsafety on mods
dtolnay Aug 23, 2020
55efa96
Auto merge of #5931 - montrivo:unit-arg, r=flip1995
bors Sep 10, 2020
f7b6ace
Use IOV_MAX and UIO_MAXIOV constants in limit vectored I/O
Thomasdezeeuw Sep 10, 2020
7c3e1ff
Update libc in Cargo.lock
Thomasdezeeuw Sep 10, 2020
fd5859a
Add docs about crate level documentation support
AMythicDev Sep 3, 2020
5034d47
Auto merge of #5980 - matsujika:create-dir, r=flip1995
bors Sep 10, 2020
ca6c695
Merge commit '5034d47f721ff4c3a3ff2aca9ef2ef3e1d067f9f' into clippyup
flip1995 Sep 10, 2020
4f2d941
Only copy LLVM into rust-dev with internal LLVM
Mark-Simulacrum Sep 10, 2020
8c35a92
Auto merge of #76564 - pietroalbini:ci-avoid-wasting-10-minutes, r=Ma…
bors Sep 10, 2020
c0894e7
typeck/expr: inaccessible private fields
davidtwco Sep 9, 2020
409c141
typeck/pat: inaccessible private fields
davidtwco Sep 10, 2020
5aed495
Rollup merge of #75857 - dtolnay:unsafe, r=nagisa
tmandry Sep 10, 2020
91c3ef8
Rollup merge of #76289 - arijit79:master, r=jyn514
tmandry Sep 10, 2020
7565ccc
Rollup merge of #76514 - hameerabbasi:const-generics-revs, r=lcnr
tmandry Sep 10, 2020
9f8a782
Rollup merge of #76524 - davidtwco:issue-76077-inaccessible-private-f…
tmandry Sep 10, 2020
2df1487
Rollup merge of #76548 - tmiasko:validate, r=davidtwco
tmandry Sep 10, 2020
f9df658
Rollup merge of #76555 - alilleybrinker:reword_trivial_casts_lint_doc…
tmandry Sep 10, 2020
ac85a4d
Rollup merge of #76559 - lcnr:const-evaluatable, r=oli-obk
tmandry Sep 10, 2020
ae46b9e
Rollup merge of #76563 - yokodake:patch-1, r=jonas-schievink
tmandry Sep 10, 2020
94ae5d1
Rollup merge of #76565 - matthiaskrgr:box_place, r=oli-obk
tmandry Sep 10, 2020
c8f9c72
Rollup merge of #76567 - matthiaskrgr:clone_on_copy, r=varkor
tmandry Sep 10, 2020
044f717
Rollup merge of #76568 - GuillaumeGomez:add-missing-examples, r=jyn514
tmandry Sep 10, 2020
ad3a6f7
Auto merge of #76582 - tmandry:rollup-lwwc93b, r=tmandry
bors Sep 10, 2020
283d4c4
Ignore `|` and `+` tokens during proc-macro pretty-print check
Aaron1011 Sep 10, 2020
a1947b3
Auto merge of #76574 - flip1995:clippyup, r=Manishearth
bors Sep 10, 2020
de4bd9f
Attach `TokenStream` to `ast::Block`
Aaron1011 Aug 21, 2020
1823dea
Attach `TokenStream` to `ast::Ty`
Aaron1011 Aug 21, 2020
d5a04a9
Collect tokens when handling `:literal` matcher
Aaron1011 Aug 21, 2020
3815e91
Attach tokens to `NtMeta` (`ast::AttrItem`)
Aaron1011 Aug 21, 2020
55082ce
Attach `TokenStream` to `ast::Path`
Aaron1011 Aug 21, 2020
c101116
Attach `TokenStream` to `ast::Visibility`
Aaron1011 Aug 21, 2020
156ef2b
Attach tokens to `ast::Stmt`
Aaron1011 Sep 10, 2020
fec0479
Fully integrate token collection for additional AST structs
Aaron1011 Aug 22, 2020
ee04f9a
Auto merge of #74437 - ssomers:btree_no_root_in_noderef, r=Mark-Simul…
bors Sep 10, 2020
15aa6f3
add debug-logging to config.toml
guswynn Sep 10, 2020
954361a
Update `std::os` module documentation.
CDirkx Sep 11, 2020
94b4de0
Auto merge of #75800 - Aaron1011:feature/full-nt-tokens, r=petrochenkov
bors Sep 11, 2020
f5b7dd8
Auto merge of #76381 - petrochenkov:nomingwcomp, r=Mark-Simulacrum
bors Sep 11, 2020
a742547
Auto merge of #75611 - JulianKnodt:cg_enum_err, r=lcnr
bors Sep 11, 2020
439b766
replacing sub's that can wrap by saturating_sub's
ad-anssi Sep 11, 2020
9abc6bd
Add revisions to const generic const_evaluatable_checked tests.
hameerabbasi Sep 11, 2020
5e188f5
Add revisions to const generic type-dependent UI tests.
hameerabbasi Sep 11, 2020
d778203
Auto merge of #76573 - Mark-Simulacrum:bootstrap-with-external-llvm, …
bors Sep 11, 2020
1854f8b
Warn for #[unstable] on trait impls when it has no effect.
m-ou-se Sep 9, 2020
e5c645f
Turn useless #[unstable] attributes into errors.
m-ou-se Sep 10, 2020
f6fbf66
Mark RefUnwindSafe impls for stable atomic types as stable.
m-ou-se Sep 10, 2020
cf8e5d1
Mark Error impl for LayoutErr as stable.
m-ou-se Sep 10, 2020
89fb34f
Turn unstable trait impl error into a lint, so it can be disabled.
m-ou-se Sep 10, 2020
471fb62
Allow unstable From impl for [Raw]Waker.
m-ou-se Sep 10, 2020
1c1bfba
Add test for unstable trait impl lint.
m-ou-se Sep 10, 2020
f9059a4
add non-regression test for issue #76597
ad-anssi Sep 11, 2020
b729368
Address review comments
carbotaniuman Sep 11, 2020
3193d52
Remove host parameter from step configurations
Mark-Simulacrum Sep 6, 2020
b4eb099
Verify we compile std without involving a b host compiler
Mark-Simulacrum Sep 6, 2020
78125ec
Stop implicitly appending triples to config.toml hosts and targets
Mark-Simulacrum Sep 6, 2020
64b8fd7
Add `peek` and `peek_from` to `UnixStream` and `UnixDatagram`
rijenkii Aug 21, 2020
62068a5
repairing broken error message and rustfix application for the new test
ad-anssi Sep 11, 2020
56f5c7f
comments + add max_level_info so false works with debug_assertions on
guswynn Sep 11, 2020
0be66d7
just max_level_info
guswynn Sep 11, 2020
c394624
Ignore unnecessary unsafe warnings
Thomasdezeeuw Sep 11, 2020
c213c68
box ResolutionFailures on the heap
jyn514 Sep 11, 2020
57250ef
Use `span_label` instead of `note`
jyn514 Sep 11, 2020
b2a5a7a
Remove unnecessary clone
jyn514 Sep 11, 2020
141bb23
Auto merge of #76415 - Mark-Simulacrum:bootstrap-cross-compilation, r…
bors Sep 11, 2020
c63f634
Give better diagnostic when using a private tuple struct constructor
guswynn Sep 8, 2020
5ea3eaf
Name the current module
jyn514 Sep 11, 2020
14cc177
Improve `ineffective_unstable_trait_impl` error message.
m-ou-se Sep 11, 2020
bc57bd8
Auto merge of #76499 - guswynn:priv_des, r=petrochenkov
bors Sep 11, 2020
bb9ce7c
Add missing examples on binary core traits
GuillaumeGomez Sep 11, 2020
9911160
Auto merge of #73761 - rijenkii:master, r=KodrAus
bors Sep 11, 2020
5e126c9
better diag when const ranges are used in patterns
guswynn Sep 1, 2020
12c10e3
Auto merge of #73951 - pickfire:liballoc-intoiter, r=Mark-Simulacrum
bors Sep 11, 2020
94a7ea2
Auto merge of #74328 - yoshuawuyts:stabilize-future-readiness-fns, r=…
bors Sep 12, 2020
8b6838b
Auto merge of #75021 - cuviper:array_chunks_mut, r=scottmcm
bors Sep 12, 2020
0f5c769
Auto merge of #75756 - jyn514:diagnostic-suggestions, r=estebank
bors Sep 12, 2020
b8752ff
update the version of itertools and parking_lot
andjo403 Sep 12, 2020
2e2e7de
Auto merge of #76222 - guswynn:const_diag, r=estebank
bors Sep 12, 2020
7344f93
Rollup merge of #76114 - marmeladema:duration-saturating-ops, r=shepm…
RalfJung Sep 12, 2020
5d90d6e
Rollup merge of #76297 - lcnr:const-ty-alias, r=varkor
RalfJung Sep 12, 2020
c20356e
Rollup merge of #76484 - fusion-engineering-forks:maybe-uninit-drop, …
RalfJung Sep 12, 2020
a49451c
Rollup merge of #76530 - carbotaniuman:fix-rc, r=RalfJung
RalfJung Sep 12, 2020
2477f07
Rollup merge of #76583 - CDirkx:os-doc, r=jonas-schievink
RalfJung Sep 12, 2020
90c5b8f
Rollup merge of #76599 - hameerabbasi:const-generics-revs, r=lcnr
RalfJung Sep 12, 2020
0ed4bc5
Rollup merge of #76615 - GuillaumeGomez:missing-examples-binary-ops, …
RalfJung Sep 12, 2020
2d6cbd2
Auto merge of #76637 - RalfJung:rollup-eaykf93, r=RalfJung
bors Sep 12, 2020
fb47bda
Add host= configuration for msvc/darwin
Mark-Simulacrum Sep 12, 2020
85109af
Auto merge of #76561 - Thomasdezeeuw:iov-constant-limits, r=Amanieu
bors Sep 12, 2020
bd51226
Auto merge of #76632 - andjo403:updateDep, r=Mark-Simulacrum
bors Sep 12, 2020
e788b1a
Print all step timings
Mark-Simulacrum Sep 12, 2020
7adeb2c
Auto merge of #76639 - Mark-Simulacrum:ci-hosts, r=pietroalbini
bors Sep 12, 2020
9891908
Auto merge of #76538 - fusion-engineering-forks:check-useless-unstabl…
bors Sep 12, 2020
a7b092f
Download LLVM from CI to bootstrap
Mark-Simulacrum Sep 4, 2020
2e87a6e
Set link-shared if LLVM ThinLTO is enabled in config.rs
Mark-Simulacrum Sep 12, 2020
dbb73f8
Auto merge of #73461 - calebzulawski:validate-attribute-placement, r=…
bors Sep 12, 2020
498dab0
Auto merge of #76306 - tmiasko:nrvo-debuginfo, r=ecstatic-morse
bors Sep 13, 2020
04b72b4
Auto merge of #76349 - Mark-Simulacrum:dl-llvm, r=alexcrichton
bors Sep 13, 2020
a67d248
Properly encode spans with a dummy location and non-root `SyntaxContext`
Aaron1011 Sep 13, 2020
dd33766
Auto merge of #76585 - Aaron1011:ignore-vert-plus, r=petrochenkov
bors Sep 13, 2020
4e48010
Auto merge of #76588 - guswynn:debug_logging, r=jyn514,Mark-Simulacrum
bors Sep 13, 2020
b6c8455
Auto merge of #76658 - Aaron1011:fix/encode-dummy-loc-span, r=lcnr
bors Sep 13, 2020
17d3277
Auto merge of #76598 - ad-anssi:diagnostic_errors_fix, r=estebank
bors Sep 13, 2020
a11331a
rustc_typeck: construct {Closure,Generator}Substs more directly.
eddyb Jul 13, 2020
7cd0c00
Use tuple inference
roxelo Jul 19, 2020
ee9ec55
address comments and rebase on master
roxelo Jul 22, 2020
35cf8f6
Address more comments
roxelo Jul 23, 2020
1f457d3
adding some checks/guards
jenniferwills Jul 28, 2020
6c6276a
Resolve some failing tests and rebase changes on most recent changes
roxelo Sep 15, 2020
a0e40cc
fix pull
roxelo Sep 15, 2020
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
19 changes: 19 additions & 0 deletions src/librustc_middle/ty/sty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,11 @@ impl<'tcx> ClosureSubsts<'tcx> {
self.split().tupled_upvars_ty.expect_ty().tuple_fields()
}

#[inline]
pub fn upvar_tuple_ty(self) -> Ty<'tcx> {
self.split().tupled_upvars_ty.expect_ty()
}

/// Returns the closure kind for this closure; may return a type
/// variable during inference. To get the closure kind during
/// inference, use `infcx.closure_kind(substs)`.
Expand Down Expand Up @@ -488,6 +493,11 @@ impl<'tcx> GeneratorSubsts<'tcx> {
self.split().tupled_upvars_ty.expect_ty().tuple_fields()
}

#[inline]
pub fn upvar_tuple_ty(self) -> Ty<'tcx> {
self.split().tupled_upvars_ty.expect_ty()
}

/// Returns the type representing the resume type of the generator.
pub fn resume_ty(self) -> Ty<'tcx> {
self.split().resume_ty.expect_ty()
Expand Down Expand Up @@ -630,6 +640,15 @@ impl<'tcx> UpvarSubsts<'tcx> {
};
tupled_upvars_ty.expect_ty().tuple_fields()
}

#[inline]
pub fn upvar_tuple_ty(self) -> Ty<'tcx> {
let tupled_upvars_ty = match self {
roxelo marked this conversation as resolved.
Show resolved Hide resolved
UpvarSubsts::Closure(substs) => substs.as_closure().split().tupled_upvars_ty,
roxelo marked this conversation as resolved.
Show resolved Hide resolved
UpvarSubsts::Generator(substs) => substs.as_generator().split().tupled_upvars_ty,
};
tupled_upvars_ty.expect_ty()
}
}

#[derive(Debug, Copy, Clone, PartialEq, PartialOrd, Ord, Eq, Hash, RustcEncodable, RustcDecodable)]
Expand Down
30 changes: 20 additions & 10 deletions src/librustc_trait_selection/opaque_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,24 +716,34 @@ where
ty::Closure(_, ref substs) => {
// Skip lifetime parameters of the enclosing item(s)

for upvar_ty in substs.as_closure().upvar_tys() {
upvar_ty.visit_with(self);
}
if !substs.as_closure().is_valid() {
roxelo marked this conversation as resolved.
Show resolved Hide resolved
// Not yet resolved.
ty.super_visit_with(self);
} else {
for upvar_ty in substs.as_closure().upvar_tys() {
upvar_ty.visit_with(self);
}

substs.as_closure().sig_as_fn_ptr_ty().visit_with(self);
substs.as_closure().sig_as_fn_ptr_ty().visit_with(self);
}
}

ty::Generator(_, ref substs, _) => {
// Skip lifetime parameters of the enclosing item(s)
// Also skip the witness type, because that has no free regions.

for upvar_ty in substs.as_generator().upvar_tys() {
upvar_ty.visit_with(self);
}
if !substs.as_generator().is_valid() {
roxelo marked this conversation as resolved.
Show resolved Hide resolved
// Not yet resolved.
ty.super_visit_with(self);
} else {
for upvar_ty in substs.as_generator().upvar_tys() {
upvar_ty.visit_with(self);
}

substs.as_generator().return_ty().visit_with(self);
substs.as_generator().yield_ty().visit_with(self);
substs.as_generator().resume_ty().visit_with(self);
substs.as_generator().return_ty().visit_with(self);
substs.as_generator().yield_ty().visit_with(self);
substs.as_generator().resume_ty().visit_with(self);
}
}
_ => {
ty.super_visit_with(self);
Expand Down
7 changes: 6 additions & 1 deletion src/librustc_trait_selection/traits/query/dropck_outlives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,12 @@ pub fn trivial_dropck_outlives<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> bool {
// check if *any* of those are trivial.
ty::Tuple(ref tys) => tys.iter().all(|t| trivial_dropck_outlives(tcx, t.expect_ty())),
ty::Closure(_, ref substs) => {
substs.as_closure().upvar_tys().all(|t| trivial_dropck_outlives(tcx, t))
if !substs.as_closure().is_valid() {
// Not yet resolved.
false
} else {
substs.as_closure().upvar_tys().all(|t| trivial_dropck_outlives(tcx, t))
}
}

ty::Adt(def, _) => {
Expand Down
30 changes: 26 additions & 4 deletions src/librustc_trait_selection/traits/select/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,13 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {

ty::Closure(_, substs) => {
// (*) binder moved here
Where(ty::Binder::bind(substs.as_closure().upvar_tys().collect()))
let ty = self.infcx.shallow_resolve(substs.as_closure().upvar_tuple_ty());
if let ty::Infer(ty::TyVar(_)) = ty.kind {
// Not yet resolved.
Ambiguous
} else {
Where(ty::Binder::bind(substs.as_closure().upvar_tys().collect()))
}
}

ty::Adt(..) | ty::Projection(..) | ty::Param(..) | ty::Opaque(..) => {
Expand Down Expand Up @@ -1701,11 +1707,27 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
tys.iter().map(|k| k.expect_ty()).collect()
}

ty::Closure(_, ref substs) => substs.as_closure().upvar_tys().collect(),
ty::Closure(_, ref substs) => {
let ty = self.infcx.shallow_resolve(substs.as_closure().upvar_tuple_ty());
if let ty::Infer(ty::TyVar(_)) = ty.kind {
// Not yet resolved.
warn!("asked to assemble constituent types of unexpected type: {:?}", t);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be bug!, like the calls above

Vec::new()
} else {
substs.as_closure().upvar_tys().collect()
}
}

ty::Generator(_, ref substs, _) => {
let witness = substs.as_generator().witness();
substs.as_generator().upvar_tys().chain(iter::once(witness)).collect()
let ty = self.infcx.shallow_resolve(substs.as_generator().upvar_tuple_ty());
if let ty::Infer(ty::TyVar(_)) = ty.kind {
// Not yet resolved.
warn!("asked to assemble constituent types of unexpected type: {:?}", t);
Vec::new()
} else {
let witness = substs.as_generator().witness();
substs.as_generator().upvar_tys().chain(iter::once(witness)).collect()
}
}

ty::GeneratorWitness(types) => {
Expand Down
15 changes: 11 additions & 4 deletions src/librustc_trait_selection/traits/wf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,17 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
// are not directly inspecting closure types
// anyway, except via auto trait matching (which
// only inspects the upvar types).
walker.skip_current_subtree(); // subtree handled below
for upvar_ty in substs.as_closure().upvar_tys() {
// FIXME(eddyb) add the type to `walker` instead of recursing.
self.compute(upvar_ty.into());
let ty = self.infcx.shallow_resolve(substs.as_closure().upvar_tuple_ty());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can just be self.compute(substs.as_closure().upvar_tuple_ty()), I believe, as inference variables will already be resolved in that recursive call

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if let ty::Infer(ty::TyVar(_)) = ty.kind {
// Not yet resolved.
walker.skip_current_subtree();
self.compute(ty.into());
} else {
walker.skip_current_subtree(); // subtree handled below
roxelo marked this conversation as resolved.
Show resolved Hide resolved
for upvar_ty in substs.as_closure().upvar_tys() {
// FIXME(eddyb) add the type to `walker` instead of recursing.
self.compute(upvar_ty.into());
}
}
}

Expand Down
18 changes: 5 additions & 13 deletions src/librustc_typeck/check/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
self.tcx.closure_base_def_id(expr_def_id.to_def_id()),
);

let tupled_upvars_ty =
self.tcx.mk_tup(self.tcx.upvars_mentioned(expr_def_id).iter().flat_map(|upvars| {
upvars.iter().map(|(&var_hir_id, _)| {
// Create type variables (for now) to represent the transformed
// types of upvars. These will be unified during the upvar
// inference phase (`upvar.rs`).
self.infcx.next_ty_var(TypeVariableOrigin {
// FIXME(eddyb) distinguish upvar inference variables from the rest.
kind: TypeVariableOriginKind::ClosureSynthetic,
span: self.tcx.hir().span(var_hir_id),
})
})
}));
let tupled_upvars_ty = self.infcx.next_ty_var(TypeVariableOrigin {
// FIXME(eddyb) distinguish upvar inference variables from the rest.
kind: TypeVariableOriginKind::ClosureSynthetic,
span: self.tcx.hir().span(expr.hir_id),
});

if let Some(GeneratorTypes { resume_ty, yield_ty, interior, movability }) = generator_types
{
Expand Down
23 changes: 19 additions & 4 deletions src/librustc_typeck/check/coercion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ use crate::astconv::AstConv;
use crate::check::FnCtxt;
use rustc_errors::{struct_span_err, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use rustc_infer::infer::{Coercion, InferOk, InferResult};
use rustc_middle::ty::adjustment::{
Expand Down Expand Up @@ -221,11 +222,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
// unsafe qualifier.
self.coerce_from_fn_pointer(a, a_f, b)
}
ty::Closure(_, substs_a) => {
ty::Closure(closure_def_id_a, substs_a) => {
// Non-capturing closures are coercible to
// function pointers or unsafe function pointers.
// It cannot convert closures that require unsafe.
self.coerce_closure_to_fn(a, substs_a, b)
self.coerce_closure_to_fn(a, closure_def_id_a, substs_a, b)
}
_ => {
// Otherwise, just use unification rules.
Expand Down Expand Up @@ -762,6 +763,7 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
fn coerce_closure_to_fn(
&self,
a: Ty<'tcx>,
closure_def_id_a: DefId,
substs_a: SubstsRef<'tcx>,
b: Ty<'tcx>,
) -> CoerceResult<'tcx> {
Expand All @@ -772,7 +774,15 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> {
let b = self.shallow_resolve(b);

match b.kind {
ty::FnPtr(fn_ty) if substs_a.as_closure().upvar_tys().next().is_none() => {
// At this point we haven't done capture analysis, which means
// that the ClosureSubsts just contains an inference variable instead
// of tuple of captured types.
//
// All we care here is if any variable is being captured and not the exact paths,
// so we check `upvars_mentioned` for root variables being captured.
ty::FnPtr(fn_ty)
if self.tcx.upvars_mentioned(closure_def_id_a.expect_local()).is_none() =>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion from aman:try size ==1 instead of is_none()

Copy link
Member

@arora-aman arora-aman Jul 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe self.tcx.upvars_mentioned(closure_def_id_a.expect_local().map_or(true, |u| u.is_empty())

{
// We coerce the closure, which has fn type
// `extern "rust-call" fn((arg0,arg1,...)) -> _`
// to
Expand Down Expand Up @@ -907,7 +917,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let (a_sig, b_sig) = {
let is_capturing_closure = |ty| {
if let &ty::Closure(_, substs) = ty {
roxelo marked this conversation as resolved.
Show resolved Hide resolved
substs.as_closure().upvar_tys().next().is_some()
let ty = self.infcx.shallow_resolve(substs.as_closure().upvar_tuple_ty());
roxelo marked this conversation as resolved.
Show resolved Hide resolved
if let ty::Infer(ty::TyVar(_)) = ty.kind {
substs.as_closure().upvar_tys().next().is_some()
} else {
false
}
} else {
false
}
Expand Down
8 changes: 5 additions & 3 deletions src/librustc_typeck/check/upvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
"analyze_closure: id={:?} substs={:?} final_upvar_tys={:?}",
closure_hir_id, substs, final_upvar_tys
);
for (upvar_ty, final_upvar_ty) in substs.upvar_tys().zip(final_upvar_tys) {
self.demand_suptype(span, upvar_ty, final_upvar_ty);
}

// Build a tuple (U0..Un) of the final upvar types U0..Un
// and unify the upvar tupe type in the closure with it:
let final_upvar_tuple_type = self.tcx.mk_tup(final_upvar_tys.iter());
self.demand_suptype(span, substs.upvar_tuple_ty(), final_upvar_tuple_type);

// If we are also inferred the closure kind here,
// process any deferred resolutions.
Expand Down