Commit Graph

196653 Commits

Author SHA1 Message Date
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
Ralf Jung
9097ce9054 fix is_disaligned logic for nested packed structs 2022-08-03 09:59:08 -04:00
bors
04f72f9538 Auto merge of #100023 - saethlin:send-sync-chunksmut, r=m-ou-se
Add back Send and Sync impls on ChunksMut iterators

Fixes https://github.com/rust-lang/rust/issues/100014

These were accidentally removed in #94247 because the representation was changed from `&mut [T]` to `*mut T`, which has `!Send + !Sync`.
2022-08-03 13:17:58 +00:00
klensy
0548e8ed06 fix trailing whitespace in error message 2022-08-03 15:46:34 +03:00
bors
7308c22c6a 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)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-03 10:26:01 +00:00
Fabian Wolff
e3c7e04a44 Warn about dead tuple struct fields 2022-08-03 12:17:23 +02:00
Takayuki Maeda
b5e1ac721f add regression test for #90871 2022-08-03 18:51:21 +09:00
Ali MJ Al-Nasrawy
78adc0139c cosmetic changes 2022-08-03 12:46:04 +03:00
Guillaume Gomez
3a6093ebca remove Clean trait implementation for hir::IsAuto 2022-08-03 11:39:09 +02:00
Guillaume Gomez
a72e96c427 remove Clean trait implementation for ty::Region 2022-08-03 11:39:05 +02:00
b-naber
1405ce35ac fix typo 2022-08-03 11:04:10 +02:00
topjohnwu
6f87b7500a Set llvm configs when building lld 2022-08-03 01:54:24 -07:00
Dylan DPC
e92b2415aa
Rollup merge of #100079 - camelid:fix-doc-star-search, r=Dylan-DPC
Replace `* -> vec` with `-> vec` in docs

Fixes #100078.

Rustdoc's current syntax is `-> vec`.
2022-08-03 13:45:53 +05:30
Dylan DPC
8d465cc551
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.
2022-08-03 13:45:52 +05:30
Dylan DPC
acf691234f
Rollup merge of #99738 - notriddle:notriddle/multiple-modules-w-same-name, r=camelid
rustdoc: avoid inlining modules with duplicate names

Fixes rust-lang/rust#99734
2022-08-03 13:45:51 +05:30
Dylan DPC
cb9932ea64
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.

Cc `@workingjubilee`
2022-08-03 13:45:50 +05:30
Dylan DPC
5730f12b37
Rollup merge of #99371 - ChrisDenton:simplify-gen-random-keys, r=thomcc
Remove synchronization from Windows `hashmap_random_keys`

Unfortunately using synchronization when generating hashmap keys can prevent it being used in `DllMain`.

~~Fixes #99341~~
2022-08-03 13:45:49 +05:30
Jack Huey
955fcad758 Add bound_impl_subject and bound_return_ty 2022-08-03 01:02:46 -04:00
bors
e141246cbb 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 (⬆️ rust-analyzer)
 - #100070 (Clarify Cargo.toml comments)
 - #100074 (rustc-docs: Be less specific about the representation of `+bundle`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-03 04:50:42 +00:00
Jack Huey
96a69dce2c Change sized_constraints to return EarlyBinder 2022-08-03 00:14:24 -04:00
hdelc
2be00947bf Add items to DocAliasBadLocation check error match arm
- Added `Impl`, `Closure`, ForeignMod` targets
- `Target::name` changed for `Target::Impl`
- Error output for `Target::ForeignMod` changed to "foreign module"
2022-08-02 23:11:22 -04:00
Eric Huss
39358bf00c Update rls 2022-08-02 20:08:30 -07:00
Jack Huey
e21624dc80 Add bound_predicates_of and bound_explicit_predicates_of 2022-08-02 22:44:08 -04:00
Takayuki Maeda
a0a2ec3326 add tests for Debug formatters and precision formatters 2022-08-03 11:28:00 +09:00
Ralf Jung
2bde0e7bbc update anyhow 2022-08-02 22:14:48 -04:00
Takayuki Maeda
4233a13ceb suggest a positional formatting argument instead of a captured argument 2022-08-03 11:12:31 +09:00
Jakob Degen
efa5eaa5d1 Avoid invalidating the CFG in MirPatch.
As a part of this change, we adjust MirPatch to not needlessly create unnecessary resume blocks.
2022-08-02 18:57:54 -07:00
bors
b759b2efad 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.

r? rust-lang/types
2022-08-03 01:55:20 +00:00
Michael Goulet
16a3601f62 Delay a bug when failed to normalize trait ref during specialization 2022-08-03 01:37:02 +00:00
Ralf Jung
da3e11fc42 wordsmithing 2022-08-02 20:43:48 -04:00
Eric Huss
c627d402b4 Remove CARGO_TEST_DISABLE_GIT_CLI
This was a leftover from the Appveyor days.
2022-08-02 16:59:35 -07:00
Eric Huss
05bdd9633b Update cargo 2022-08-02 16:59:30 -07:00
Daniel Sommermann
9cf556dca9 Fix backwards-compatibility check for tests with +whole-archive
Fixes #100066
2022-08-02 15:47:18 -07:00
Michael Howell
8724ca3114 rustdoc: avoid inlining foreigns with duplicate names 2022-08-02 14:48:23 -07:00
bors
e4417cf020 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

These features will be implemented in future PRs.
2022-08-02 21:17:31 +00:00