bors [Thu, 4 Aug 2022 10:21:40 +0000 (10:21 +0000)]
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.
bors [Thu, 4 Aug 2022 03:52:29 +0000 (03:52 +0000)]
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)
bors [Thu, 4 Aug 2022 01:10:08 +0000 (01:10 +0000)]
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)
bors [Wed, 3 Aug 2022 22:16:07 +0000 (22:16 +0000)]
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)
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.
Matthias Krüger [Wed, 3 Aug 2022 20:30:44 +0000 (22:30 +0200)]
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.
Matthias Krüger [Wed, 3 Aug 2022 20:29:31 +0000 (22:29 +0200)]
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.
Matthias Krüger [Wed, 3 Aug 2022 20:29:26 +0000 (22:29 +0200)]
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:
https://github.com/rust-lang/rust/blob/5f98537eb7b5f42c246a52c550813c3cff336069/compiler/rustc_borrowck/src/universal_regions.rs#L255-L261
Matthias Krüger [Wed, 3 Aug 2022 20:29:25 +0000 (22:29 +0200)]
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.
bors [Wed, 3 Aug 2022 16:09:56 +0000 (16:09 +0000)]
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.
mary [Fri, 1 Jul 2022 15:12:46 +0000 (15:12 +0000)]
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).
bors [Wed, 3 Aug 2022 10:26:01 +0000 (10:26 +0000)]
Auto merge of #100100 - Dylan-DPC:rollup-llcaaq8, r=Dylan-DPC
Rollup of 5 pull requests
Successful merges:
- #99371 (Remove synchronization from Windows `hashmap_random_keys`)
- #99614 (do not claim that transmute is like memcpy)
- #99738 (rustdoc: avoid inlining modules with duplicate names)
- #99800 (Fix futex module imports on wasm+atomics)
- #100079 (Replace `* -> vec` with `-> vec` in docs)
Dylan DPC [Wed, 3 Aug 2022 08:15:52 +0000 (13:45 +0530)]
Rollup merge of #99800 - sandydoo:bugfix/wasm-futex, r=m-ou-se
Fix futex module imports on wasm+atomics
The futex modules were rearranged a bit in #98707, which meant that wasm+atomics would no longer compile on nightly. I don’t believe any other targets were impacted by this.
Dylan DPC [Wed, 3 Aug 2022 08:15:50 +0000 (13:45 +0530)]
Rollup merge of #99614 - RalfJung:transmute-is-not-memcpy, r=thomcc
do not claim that transmute is like memcpy
Saying transmute is like memcpy is not a well-formed statement, since memcpy is by-ref whereas transmute is by-val. The by-val nature of transmute inherently means that padding is lost along the way. (This is not specific to transmute, this is how all by-value operations work.) So adjust the docs to clarify this aspect.
bors [Wed, 3 Aug 2022 04:50:42 +0000 (04:50 +0000)]
Auto merge of #100082 - matthiaskrgr:rollup-ywu4iux, r=matthiaskrgr
Rollup of 6 pull requests
Successful merges:
- #99933 (parallelize HTML checking tool)
- #99958 (Improve position named arguments lint underline and formatting names)
- #100008 (Update all pre-cloned submodules on startup)
- #100049 (:arrow_up: rust-analyzer)
- #100070 (Clarify Cargo.toml comments)
- #100074 (rustc-docs: Be less specific about the representation of `+bundle`)
bors [Wed, 3 Aug 2022 01:55:20 +0000 (01:55 +0000)]
Auto merge of #99509 - lcnr:commit_unconditionally, r=jackh726
remove `commit_unconditionally`
`commit_unconditionally` is a noop unless we somehow inspect the current state of our snapshot. The only thing which does that is the leak check which was only used in one place where `commit_if_ok` is probably at least as, or even more, correct.
bors [Tue, 2 Aug 2022 21:17:31 +0000 (21:17 +0000)]
Auto merge of #92268 - jswrenn:transmute, r=oli-obk
Initial implementation of transmutability trait.
*T'was the night before Christmas and all through the codebase, not a miri was stirring — no hint of `unsafe`!*
This PR provides an initial, **incomplete** implementation of *[MCP 411: Lang Item for Transmutability](https://github.com/rust-lang/compiler-team/issues/411)*. The `core::mem::BikeshedIntrinsicFrom` trait provided by this PR is implemented on-the-fly by the compiler for types `Src` and `Dst` when the bits of all possible values of type `Src` are safely reinterpretable as a value of type `Dst`.
What this PR provides is:
- [x] [support for transmutations involving primitives](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/primitives)
- [x] [support for transmutations involving arrays](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/arrays)
- [x] [support for transmutations involving structs](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/structs)
- [x] [support for transmutations involving enums](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/enums)
- [x] [support for transmutations involving unions](https://github.com/jswrenn/rust/tree/transmute/src/test/ui/transmutability/unions)
- [x] [support for weaker validity checks](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/unions/should_permit_intersecting_if_validity_is_assumed.rs) (i.e., `Assume::VALIDITY`)
- [x] visibility checking
What isn't yet implemented:
- [ ] transmutability options passed using the `Assume` struct
- [ ] [support for references](https://github.com/jswrenn/rust/blob/transmute/src/test/ui/transmutability/references.rs)
- [ ] smarter error messages
Matthias Krüger [Tue, 2 Aug 2022 21:07:45 +0000 (23:07 +0200)]
Rollup merge of #99958 - PrestonFrom:issue_99907, r=compiler-errors
Improve position named arguments lint underline and formatting names
For named arguments used as implicit position arguments, underline both
the opening curly brace and either:
* if there is formatting, the next character (which will either be the
closing curl brace or the `:` denoting the start of formatting args)
* if there is no formatting, the entire arg span (important if there is
whitespace like `{ }`)
This should make it more obvious where the named argument should be.
Additionally, in the lint message, emit the formatting argument names
without a dollar sign to avoid potentially confusion.