Commit Graph

196578 Commits

Author SHA1 Message Date
Santiago Pastorino
95158fdf3a
No need to store parent_def_id in LifetimeCaptureContext 2022-08-04 11:26:56 -03:00
Santiago Pastorino
552f6b0f81
No need to check binders to ignore on new_named_lifetime_with_res's LifetimeRes::Fresh 2022-08-04 11:26:56 -03:00
Santiago Pastorino
6041ed0775
No need to check binders to ignore on new_named_lifetime_with_res's LifetimeRes::Param 2022-08-04 11:26:55 -03:00
Santiago Pastorino
d9e6364755
new_named_lifetime_with_res's LifetimeRes::Fresh should have created def_id already 2022-08-04 11:26:55 -03:00
Santiago Pastorino
3030ab3074
new_named_lifetime_with_res's LifetimeRes::Param should have created def_id already 2022-08-04 11:26:55 -03:00
Santiago Pastorino
14ea17858d
Fail if LifetimeRes is Infer when creating def ids for lifetimes copies 2022-08-04 11:26:55 -03:00
Santiago Pastorino
c390bda356
Record RPITs elided lifetimes in Rptr Tys 2022-08-04 11:26:55 -03:00
Santiago Pastorino
1802d45b12
Record RPITs elided lifetimes in path segments 2022-08-04 11:26:54 -03:00
Santiago Pastorino
81c4d2371a
Restructure visit_ty in a more clear way 2022-08-04 11:26:54 -03:00
Santiago Pastorino
05b989e16e
Skip lifetimes in binders when visiting 2022-08-04 11:26:54 -03:00
Santiago Pastorino
4f334f2b97
Move LifetimeCollectVisitor to rustc_ast_lowering 2022-08-04 11:26:54 -03:00
Santiago Pastorino
9f77688d17
Completely remove captures flag 2022-08-04 11:26:53 -03:00
Santiago Pastorino
20c88a2a30
Do not execute captures code when lowering lifetimes as GenericArg 2022-08-04 11:26:53 -03:00
Santiago Pastorino
9c0d9babd1
Do not execute captures code for async fns 2022-08-04 11:26:53 -03:00
Santiago Pastorino
5a184acfc6
There's no need to check binders_to_ignore using the old code anymore 2022-08-04 11:26:53 -03:00
Santiago Pastorino
19dcbd151b
Explicitly gather lifetimes and definitions for bare async fns 2022-08-04 11:26:52 -03:00
Santiago Pastorino
25825cd4fa
Extract create_and_capture_lifetime_defs function 2022-08-04 11:26:52 -03:00
Santiago Pastorino
fac763168f
Remove NEW_COLLECT_LIFETIMES env var 2022-08-04 11:26:52 -03:00
Santiago Pastorino
399609e841
Add debug! calls 2022-08-04 11:26:52 -03:00
Santiago Pastorino
cda2c04592
Explicitly gather lifetimes and definitions in RPIT 2022-08-04 11:26:51 -03:00
Santiago Pastorino
84a24a1b3c
Unroll while_capturing_lifetimes into lower_opaque_impl_trait 2022-08-04 11:26:51 -03:00
Santiago Pastorino
0f11a0cd24
Add captures flag to capture or not while lowering 2022-08-04 11:26:51 -03:00
Santiago Pastorino
b14c9571fa
Make lower_generic_bound_predicate receive AST bounds instead of HIR bounds 2022-08-04 11:26:51 -03:00
Santiago Pastorino
5c23a2e5a6
Remove old docs on lower_async_fn_ret_ty 2022-08-04 11:26:50 -03:00
bors
6f18f0a9d4 Auto merge of #99953 - cjgillot:in-path-always, r=petrochenkov
Always create elided lifetimes, even if inferred.

`PathSource` gives the context in which a path is encountered.  The same `PathSource` is used for the full path and the `QSelf` part.

Therefore, we can only rely on `PathSource` to know whether typechecking will be able to infer the lifetimes, not whether we need to insert them at all.

Fixes https://github.com/rust-lang/rust/issues/99949
2022-08-04 10:21:40 +00:00
bors
2f2243c9b6 Auto merge of #99843 - oli-obk:is_useful_perf, r=compiler-errors
Some `is_useful` cleanups

#98582 was reverted because it was a perf regression.

https://github.com/rust-lang/rust/pull/99806 reintroduces the changes, but this PR picks individual ones that have no regressions.
2022-08-04 07:35:33 +00:00
bors
caee496150 Auto merge of #100120 - matthiaskrgr:rollup-g6ycykq, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #98771 (Add support for link-flavor rust-lld for iOS, tvOS and watchOS)
 - #98835 (relate `closure_substs.parent_substs()` to parent fn in NLL)
 - #99746 (Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`)
 - #99786 (Recover from C++ style `enum struct`)
 - #99795 (Delay a bug when failed to normalize trait ref during specialization)
 - #100029 (Prevent ICE for `doc_alias` on match arm, statement, expression)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-04 03:52:29 +00:00
bors
1ad56350cd Auto merge of #100123 - matthiaskrgr:rollup-aylwvyc, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #98877 (Set llvm configs when building lld)
 - #100068 (Fix backwards-compatibility check for tests with `+whole-archive`)
 - #100083 (rustdoc: use a more compact encoding for source-files.js)
 - #100102 (Fix typo)
 - #100104 (Remove more Clean trait implementations)
 - #100105 (Add regression test for #90871)
 - #100107 (fix trailing whitespace in error message)
 - #100111 (Provide suggestion on missing `let` in binding statement)
 - #100119 (FilesTimes support does not build for ESP-IDF)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-04 01:10:08 +00:00
bors
59d99f56d8 Auto merge of #100065 - ehuss:update-cargo, r=ehuss
Update cargo, rls

14 commits in 85b500ccad8cd0b63995fd94a03ddd4b83f7905b..4fd148c47e733770c537efac5220744945d572ef
2022-07-24 21:10:46 +0000 to 2022-08-03 15:03:52 +0000
- Revert "Drop check for mingw32-make." (rust-lang/cargo#10934)
- Add reasons to all ignored tests. (rust-lang/cargo#10929)
- Grammar fixup unused patch message (rust-lang/cargo#10933)
- Always allow hg to be missing on CI. (rust-lang/cargo#10931)
- Fix formats_source test requiring rustfmt. (rust-lang/cargo#10918)
- Disable scrape_examples_complex_reverse_dependencies (rust-lang/cargo#10921)
- Contrib: Add docs on the rustbot ready command (rust-lang/cargo#10916)
- Support for negative --jobs parameter, counting backwards from max CPUs (rust-lang/cargo#10844)
- Add requirements to cargo_test. (rust-lang/cargo#9892)
- Contrib: Document submodule update process (rust-lang/cargo#10913)
- Contrib: Add docs on how to use crater (rust-lang/cargo#10912)
- Contrib: Document new-release process (rust-lang/cargo#10914)
- Override to resolver=1 in published package (rust-lang/cargo#10911)
- fix(add): Update the lock file (rust-lang/cargo#10902)

1 commits in fcf1f94c9ab2acc18cfd4368a4aeb38e77da9649..4d8b0a19986a4daab37287a5b5fe2da0775d1873
2022-07-14 17:19:11 +0200 to 2022-08-02 22:34:34 -0400
- Update cargo (rust-lang/rls#1782)
2022-08-03 22:16:07 +00:00
Matthias Krüger
a44532c13c
Rollup merge of #100119 - ivmarkov:master, r=joshtriplett
FilesTimes support does not build for ESP-IDF

Commit 1f5d8d49eb broke STD for `target_os = "espidf"`.

In future, we might come up with something more sophisticated (as in using the `utime` function which *is* available on the ESP-IDF platform), but for now we are treating ESP-IDF just like `Redox` in that the new API fails at runtime. Most important for us ATM is to restore successful compilation of STD on our platform.
2022-08-03 22:30:50 +02:00
Matthias Krüger
d4bd4ae27a
Rollup merge of #100111 - estebank:missing-let, r=compiler-errors
Provide suggestion on missing `let` in binding statement

Fix #78907.

Fallout from the type ascription syntax.
2022-08-03 22:30:49 +02:00
Matthias Krüger
551224019b
Rollup merge of #100107 - klensy:tr-w, r=compiler-errors
fix trailing whitespace in error message
2022-08-03 22:30:49 +02:00
Matthias Krüger
9c04ffbab2
Rollup merge of #100105 - TaKO8Ki:add-regression-test-for-90871, r=compiler-errors
Add regression test for #90871

closes #90871
2022-08-03 22:30:48 +02:00
Matthias Krüger
cd2619be67
Rollup merge of #100104 - GuillaumeGomez:rm-clean-impls, r=Dylan-DPC
Remove more Clean trait implementations

Follow-up of https://github.com/rust-lang/rust/pull/99638.

r? ``@notriddle``
2022-08-03 22:30:47 +02:00
Matthias Krüger
6919a07eb8
Rollup merge of #100102 - b-naber:typo-higher-ranked-sub, r=Dylan-DPC
Fix typo

r? ```@jackh726```
2022-08-03 22:30:46 +02:00
Matthias Krüger
d3b573d4c4
Rollup merge of #100083 - notriddle:notriddle/source-files-js, r=GuillaumeGomez
rustdoc: use a more compact encoding for source-files.js

This reduces the compiler-doc file from 40K to 36K, a 10% reduction in size.
2022-08-03 22:30:46 +02:00
Matthias Krüger
5a5f4993ad
Rollup merge of #100068 - dcsommer:master, r=petrochenkov
Fix backwards-compatibility check for tests with `+whole-archive`

Fixes #100066
2022-08-03 22:30:45 +02:00
Matthias Krüger
6a987f5e37
Rollup merge of #98877 - topjohnwu:fix-lld, r=jyn514
Set llvm configs when building lld

Several LLVM configs applied when building LLVM should also be applied when building LLD.

For example, without the fix, setting both `llvm.thin-lto=true` and `rust.lld=true` when building on Linux will fail, since we need to manually override the compiler and linker to `clang`, but those will not be used when building LLD, causing link errors.

r? ```@jyn514```
2022-08-03 22:30:44 +02:00
Matthias Krüger
f8e6617239
Rollup merge of #100029 - hdelc:master, r=cjgillot
Prevent ICE for `doc_alias` on match arm, statement, expression

Fixes #99777.

This is a pretty minimal fix that should be safe, since rustdoc doesn't generate documentation for match arms, statements, or expressions. I mentioned in the linked issue that the `doc_alias` target checking should probably be improved to avoid future ICEs, but as a new contributor, I'm not confident enough with the HIR types to make a larger change.
2022-08-03 22:29:31 +02:00
Matthias Krüger
02fcec2ac8
Rollup merge of #99795 - compiler-errors:delay-specialization-normalize-error, r=spastorino
Delay a bug when failed to normalize trait ref during specialization

The error messages still kinda suck here but they don't ICE anymore...

Fixes #45814
Fixes #43037

r? types
2022-08-03 22:29:30 +02:00
Matthias Krüger
9c18fdc71f
Rollup merge of #99786 - obeis:issue-99625, r=compiler-errors
Recover from C++ style `enum struct`

Closes #99625
2022-08-03 22:29:29 +02:00
Matthias Krüger
0de7f756f0
Rollup merge of #99746 - compiler-errors:more-trait-engine, r=jackh726
Use `TraitEngine` in more places that don't specifically need `FulfillmentContext::new_in_snapshot`

Not sure if this change is worthwhile, but couldn't hurt re: chalkification

r? types
2022-08-03 22:29:27 +02:00
Matthias Krüger
88e9417156
Rollup merge of #98835 - aliemjay:relate_closure_substs, r=nikomatsakis
relate `closure_substs.parent_substs()` to parent fn in NLL

Fixes #98589

The discrepancy between early- and late-bound lifetimes is because we map early-bound lifetimes into those found in the `closure_substs` while late-bound lifetimes are mapped into liberated free regions:
5f98537eb7/compiler/rustc_borrowck/src/universal_regions.rs (L255-L261)

r? `@rust-lang/types`
2022-08-03 22:29:26 +02:00
Matthias Krüger
7b0360e516
Rollup merge of #98771 - Thog:rust-lld-apple-target, r=petrochenkov
Add support for link-flavor rust-lld for iOS, tvOS and watchOS

This adds support for rust-lld for Apple *OS targets.

This was tested against targets ``aarch64-apple-ios`` and ``aarch64-apple-ios-sim`` with [a simple test program](https://github.com/Thog/rust-lld-apple-target_test).

It currently doesn't work with targets ``armv7-apple-ios`` and ``armv7s-apple-ios`` because of ``symbols.o`` not being generated with the correct CPU subtype. This will require changes in the ``object`` crate to expose an API.

As ``ld64.lld`` requires ``-platform_version`` with the minimal version supported and an sdk version, I made ``rustc_target::apple_base`` public to get access to ``*os_deployment_target``  helper functions and also added ``tvos_deployment_target`` as it was missing.
2022-08-03 22:29:25 +02:00
Eric Huss
bc65aaea78 Update cargo 2022-08-03 12:57:28 -07:00
bors
1b57946a40 Auto merge of #100088 - RalfJung:anyhow, r=Mark-Simulacrum
update anyhow

Fixes https://github.com/rust-lang/rust/issues/100062 by incorporating https://github.com/dtolnay/anyhow/pull/249
2022-08-03 19:34:24 +00:00
Ivan Markov
e86c128aa3 FilesTimes support does not build for ESP-IDF 2022-08-03 19:30:23 +00:00
Esteban Küber
939c2b6313 Provide suggestion on missing let in binding statement
Fix #78907.
2022-08-03 09:29:29 -07:00
bors
d6b96b61e7 Auto merge of #100064 - RalfJung:disaligned, r=petrochenkov
fix is_disaligned logic for nested packed structs

https://github.com/rust-lang/rust/pull/83605 broke the `is_disaligned` logic by bailing out of the loop in `is_within_packed` early. This PR fixes that problem and adds suitable tests.

Fixes https://github.com/rust-lang/rust/issues/99838
2022-08-03 16:09:56 +00:00
mary
78bbe57c88 Add support for link-flavor rust-lld for iOS, tvOS and watchOS
This adds support for rust-lld for Apple *OS targets.

This was tested against targets "aarch64-apple-ios" and "aarch64-apple-ios-sim".

For targets "armv7-apple-ios" and "armv7s-apple-ios", it doesn't link because of
"symbols.o" not being generated with the correct CPU subtype (changes in
the "object" crate needs to be done to support it).
2022-08-03 15:41:05 +00:00