Commit Graph

196755 Commits

Author SHA1 Message Date
Nikita Popov
b2f247e1bd Explicitly disable zstd support
Make sure we don't pick up a libzstd.so dependency if it happens
to be installed on the system.
2022-08-09 12:39:59 +02:00
Nikita Popov
e77ec2f482 Fix coverage-llvmir test on Windows
@__llvm_profile_runtime is how an external hidden global.
2022-08-09 12:39:59 +02:00
Nikita Popov
1db81713f6 Link libatomic on 32-bit targets
This is needed since https://reviews.llvm.org/D128070.
2022-08-09 12:39:59 +02:00
Nikita Popov
89582e8193 Pass +atomics-32 feature for thumbv6m target
https://reviews.llvm.org/D120026 changed atomics on thumbv6m to
use libatomic, to ensure that atomic load/store are compatible with
atomic RMW/CAS. However, Rust wants to expose only load/store
without libcalls.

https://reviews.llvm.org/D130480 added support for this behind
the +atomics-32 target feature, so enable that feature.
2022-08-09 12:39:59 +02:00
Nikita Popov
9d97606193 Allow old toolchain on some images
LLVM 16 will require GCC >= 7.1. For now, set the flag that
allows using an older toolchain.
2022-08-09 12:39:59 +02:00
Nikita Popov
8c1f9d04e8 Update LLVM submodule 2022-08-09 12:39:59 +02:00
bors
6a11cad7e8 Auto merge of #100207 - notriddle:notriddle/skipped-inline-module, r=Manishearth
rustdoc: do not mark the contents of a skipped module as inlined

Fixes #100204
2022-08-08 04:39:29 +00:00
bors
93ab13b4e8 Auto merge of #100245 - matthiaskrgr:rollup-tfoo650, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #100019 (Revive suggestions for boxed trait objects instead of impl Trait)
 - #100038 (Document the `no-std` target option in config.toml.example)
 - #100194 (Remove even more box syntax uses from src/test)
 - #100206 (test: skip terminfo parsing in Miri)
 - #100230 (Use start_point instead of next_point to point to elided lifetime amp…)
 - #100244 (Add armv4t-none-eabi take2)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-07 21:25:29 +00:00
Matthias Krüger
0f7fe9f997
Rollup merge of #100244 - Lokathor:add-armv4t-none-eabi-take2, r=jackh726
Add armv4t-none-eabi take2

This is the same as the previous PR (https://github.com/rust-lang/rust/pull/99226) but i just made a fresh branch without a merge commit in it.

---

### armv4t-none-eabi target quiz

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target.

That's me!

> Targets must use naming consistent with any existing targets

We're using the existing name as recognized by LLVM and GCC

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

No legal issues here.

>> The target must not introduce license incompatibilities.

No license requirements here.

>> Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).

check

>> The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy.

no new deps, we're just adding a rustc target description file for a target llvm already knows about.

>> Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries.

bare-metal target, doesn't rely on any libs at all.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate

`core` only here. You could build `alloc` too, but you'd have to bring your own global allocator.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible.

LLVM knows how to do it, you just need the GNU Binutils linker because LLVM's linker doesn't work that far back. That's in the docs as part of this PR.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target.

No burdens, LLVM already knows how to do this. Further, because this is a cpu-feature variant of an existing tier3 target the `compiler-builtins` crate has already been updated as necessary to fix any missing builtin function gaps.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

check.
2022-08-07 21:10:27 +02:00
Matthias Krüger
5648add9ef
Rollup merge of #100230 - cjgillot:noice-multibyte-amp, r=compiler-errors
Use start_point instead of next_point to point to elided lifetime amp…

Using `next_point` creates a span which points inside the multibyte token, ICEing.

Fixes https://github.com/rust-lang/rust/issues/100224
2022-08-07 21:10:26 +02:00
Matthias Krüger
07315fe970
Rollup merge of #100206 - RalfJung:miri-terminfo, r=thomcc
test: skip terminfo parsing in Miri

Terminfo parsing takes a significant amount of time in Miri, making libtest startup very slow. To work around that Miri in fact unsets the `TERM` variable. However, this means we don't get colors in `cargo miri test`.

So I propose we add some logic in libtest that skips parsing terminfo files under Miri, and just uses the regular basic coloring commands (taken from the `colored` crate).

As far as I can see, these two commands are all that libtest ever needs from terminfo, so Miri doesn't even lose any functionality through this. If you want I can entirely remove the terminfo parsing code and just use these commands instead.

Cc https://github.com/rust-lang/miri/issues/2292 `@saethlin`
2022-08-07 21:10:25 +02:00
Matthias Krüger
790377a0b9
Rollup merge of #100194 - est31:box_syntax_tests, r=Mark-Simulacrum
Remove even more box syntax uses from src/test

Prior work, notably #88316 has removed box syntax from most of the testsuite.
However, some tests were left out.
This commit removes box_syntax uses from more locations in src/test.
This migrates the tests where `box` is mostly an "implementation detail" and not the primary thing being tested by the test.
Furthermore, some tests from the mir-opt test suite are not being migrated.
2022-08-07 21:10:24 +02:00
Matthias Krüger
ae5e659c39
Rollup merge of #100038 - nicholasbishop:bishop-add-no-std, r=Mark-Simulacrum
Document the `no-std` target option in config.toml.example
2022-08-07 21:10:23 +02:00
Matthias Krüger
7be359e51b
Rollup merge of #100019 - TaKO8Ki:suggest-boxed-trait-objects-instead-of-impl-trait, r=compiler-errors
Revive suggestions for boxed trait objects instead of impl Trait

The suggestion implemented in #75608 was not working properly, so I fixed it.
2022-08-07 21:10:22 +02:00
bors
d394408fb3 Auto merge of #100218 - nicholasbishop:bishop-update-cb, r=Mark-Simulacrum
Update compiler_builtins to 0.1.78

Among other things, this pulls in https://github.com/rust-lang/compiler-builtins/pull/475, which fixes some i128/u128 arithmetic operations on the `x86_64-unknown-uefi` target.
2022-08-07 18:44:41 +00:00
Lokathor
b4a82998e5
Update SUMMARY.md 2022-08-07 12:42:25 -06:00
Lokathor
008ce49944
Create armv4t_none_eabi.md 2022-08-07 12:41:38 -06:00
Lokathor
a8b4454047
Create armv4t_none_eabi.rs 2022-08-07 12:40:41 -06:00
bors
9ee22ff7e8 Auto merge of #99833 - andrewpollack:fuchsia-rust-ci-zircon-lib-improvement, r=Mark-Simulacrum
Fuchsia CI zircon lib improvement

Removing Zircon build process, instead pulling `sysroot` and related libs directly from Fuchsia SDK

cc. `@tmandry` `@djkoloski`
2022-08-07 15:58:30 +00:00
Ralf Jung
5076c902a4 test: skip terminfo parsing in Miri 2022-08-07 11:56:12 -04:00
Andrew Pollack
fa4ce7abd9 Shifting CI to pull Zircon libraries directly from Fuchsia SDK
PR feedback

PR Followups

Updating clang download

Updating clang download

Restructuring env used

Restructuring env used

Adding chmod

Adding chmod

Adding chmod
2022-08-07 15:19:14 +00:00
bors
5a9c3a2daa Auto merge of #99983 - RalfJung:more-layout-checks, r=eddyb
More layout sanity checks

r? `@eddyb`
2022-08-07 13:17:54 +00:00
Camille GILLOT
f6af4efec5 Use start_point instead of next_point to point to elided lifetime ampersand. 2022-08-07 14:35:11 +02:00
Takayuki Maeda
82f2c08200 fix wrong suggestions for boxed trait objects instead of impl trait 2022-08-07 16:50:08 +09:00
Takayuki Maeda
fc43bd60c0 revive suggestions for boxed trait objects instead of impl Trait 2022-08-07 16:50:06 +09:00
bors
5651759746 Auto merge of #100091 - chenyukang:add-check-for-link-ordinal, r=michaelwoerister
Check link ordinal to make sure it is targetted  for foreign function

Fix #100009, when link ordinal is not target for foreign functions, emit an error.

cc `@dpaoliello`
2022-08-07 05:37:29 +00:00
bors
24cf45a591 Auto merge of #100004 - jyn514:exclude-single-test, r=Mark-Simulacrum
Move `x test --skip` to be part of `--exclude`

`--skip` is inconsistent with the rest of the interface and redundant with `--exclude`.
Fix --exclude to work properly for files and directories rather than having a separate flag.

Fixes https://github.com/rust-lang/rust/issues/96342. cc https://github.com/rust-lang/rust/pull/96493#issuecomment-1200521720

r? `@Mark-Simulacrum`
2022-08-07 02:56:48 +00:00
est31
0a03825f76 Remove even more box syntax uses from src/test
Prior work, notably 6550021124 from #88316
has removed box syntax from most of the testsuite. However,
some tests were left out.
This commit removes box_syntax uses from more locations in src/test.
Some tests that are very box syntax specific are not being migrated.
2022-08-07 04:22:20 +02:00
Nicholas Bishop
3c432032f0 Update compiler_builtins to 0.1.78 2022-08-06 20:49:48 -04:00
bors
cc71eef498 Auto merge of #100213 - matthiaskrgr:rollup-mqe7t1n, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - #100071 (deps: dedupe `annotate-snippets` crate versions)
 - #100127 (Remove Windows function preloading)
 - #100130 (Avoid pointing out `return` span if it has nothing to do with type error)
 - #100169 (Optimize `pointer::as_aligned_to`)
 - #100175 (ascii -> ASCII in code comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-06 23:38:28 +00:00
Matthias Krüger
ee0b755fe6
Rollup merge of #100175 - fxn:patch-1, r=Mark-Simulacrum
ascii -> ASCII in code comment

Easy one I spotted while reading source code.
2022-08-07 01:19:35 +02:00
Matthias Krüger
f0ff31fa09
Rollup merge of #100169 - WaffleLapkin:optimize_is_aligned_to, r=workingjubilee
Optimize `pointer::as_aligned_to`

This PR replaces `addr % align` with `addr & align - 1`, which is correct due to `align` being a power of two.

Here is a proof that this makes things better: [[godbolt]](https://godbolt.org/z/Wbq3hx6YG).

This PR also removes `assume(align != 0)`, with the new impl it does not improve anything anymore ([[godbolt]](https://rust.godbolt.org/z/zcnrG4777), [[original concern]](https://github.com/rust-lang/rust/pull/95643#discussion_r843326903)).
2022-08-07 01:19:34 +02:00
Matthias Krüger
1a96f31f76
Rollup merge of #100130 - compiler-errors:erroneous-return-span, r=lcnr
Avoid pointing out `return` span if it has nothing to do with type error

This code:

```rust
fn f(_: String) {}

fn main() {
    let x = || {
        if true {
            return ();
        }
        f("");
    };
}
```

Emits this:
```
   Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
 --> src/main.rs:8:11
  |
8 |         f("");
  |           ^^- help: try using a conversion method: `.to_string()`
  |           |
  |           expected struct `String`, found `&str`
  |
note: return type inferred to be `String` here
 --> src/main.rs:6:20
  |
6 |             return ();
  |                    ^^
```

Specifically, that note has nothing to do with the type error in question. This is because the change implemented in #84244 tries to point out the `return` span on _any_ type coercion error within a closure that happens after a `return` statement, regardless of if the error has anything to do with it.

This is really easy to trigger -- just needs a closure (or an `async`) and an early return (or any other form, e.g. `?` operator suffices) -- and super distracting in production codebases. I'm letting #84128 regress because that issue is much harder to fix correctly, and I can re-open that issue after this lands.

As a drive-by, I added a `resolve_vars_if_possible` to the coercion error logic, which leads to some error improvements. Unrelated to the issue above, though.
2022-08-07 01:19:33 +02:00
Matthias Krüger
879c17f3f9
Rollup merge of #100127 - ChrisDenton:remove-init, r=thomcc
Remove Windows function preloading

After `@Mark-Simulacrum` asked me to provide guidance for when optionally imported functions should be preloaded, I realised my justifications were now quite weak. I think the strongest argument that can be made is that it avoids some degree of nondeterminism when calling these functions (in as far as system API calls can be said to be deterministic). However, I don't think that's particularly convincing unless there's a real world use case where it matters. Further discussion with `@thomcc` has strengthened my feeling that preloading isn't really needed.

Note that `WaitOnAddress` needed some adjustment to work without preloading. I opted not to use a macro for this special case as it seemed silly to do so for just one thing (and I don't like macros tbh).
2022-08-07 01:19:32 +02:00
Matthias Krüger
aaa054e53c
Rollup merge of #100071 - klensy:annotate-snippets-bump, r=Mark-Simulacrum
deps: dedupe `annotate-snippets` crate versions

Dedupes `annotate-snippets` crate versions (https://github.com/rust-lang/annotate-snippets-rs/blob/0.9.1/CHANGELOG.md). Should work, but there is not a lot of tests.

Looks like switching to that crate a bit stalled.
2022-08-07 01:19:32 +02:00
bors
2befdefdda Auto merge of #100117 - nicholasbishop:bishop-update-cc, r=Mark-Simulacrum
Bump cc version in bootstrap

Among other changes, the newer cc release pulls in this fix:
b2792e33ff

This fixes errors when building compiler_builtins for UEFI targets.
2022-08-06 21:10:52 +00:00
Nicholas Bishop
61c8c0a0a1 Document the no-std target option in config.toml.example 2022-08-06 16:50:10 -04:00
Michael Howell
2289955546 rustdoc: do not mark the contents of a skipped module as inlined 2022-08-06 13:20:04 -07:00
bors
44bd81da68 Auto merge of #99524 - cuviper:relnotes-1.63.0, r=Mark-Simulacrum
Add release notes for Rust 1.63.0
2022-08-06 17:50:41 +00:00
bors
5c54be35c6 Auto merge of #100195 - matthiaskrgr:rollup-ovzyyb0, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #100094 (Detect type mismatch due to loop that might never iterate)
 - #100132 (Use (actually) dummy place for let-else divergence)
 - #100167 (Recover `require`, `include` instead of `use` in item)
 - #100193 (Remove more Clean trait implementations)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2022-08-06 15:09:59 +00:00
Matthias Krüger
811b0368aa
Rollup merge of #100193 - GuillaumeGomez:rm-clean-impls, r=notriddle
Remove more Clean trait implementations

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

r? `@notriddle`
2022-08-06 16:16:00 +02:00
Matthias Krüger
18ddb41184
Rollup merge of #100167 - chenyukang:require-suggestion, r=estebank
Recover `require`, `include` instead of `use` in item

Fix #100140
2022-08-06 16:15:59 +02:00
Matthias Krüger
eabf1a2e8e
Rollup merge of #100132 - compiler-errors:issue-100103, r=tmiasko
Use (actually) dummy place for let-else divergence

Fixes #100103
2022-08-06 16:15:56 +02:00
Matthias Krüger
b0b798e1e2
Rollup merge of #100094 - lyming2007:issue-98982, r=estebank
Detect type mismatch due to loop that might never iterate

When loop as tail expression causes a miss match type E0308 error, recursively get the return statement and add diagnostic information on it.
2022-08-06 16:15:56 +02:00
bors
76b0484740 Auto merge of #99893 - compiler-errors:issue-99387, r=davidtwco
Delay formatting trimmed path until lint/error is emitted

Fixes #99387

r? `@davidtwco`
2022-08-06 12:29:11 +00:00
Guillaume Gomez
71edb3168f remove Clean trait implementation for hir::PolyTraitRef 2022-08-06 11:54:54 +02:00
Guillaume Gomez
ca70ed8c81 remove Clean trait implementation for hir::GenericBound 2022-08-06 11:52:27 +02:00
bors
bb71929892 Auto merge of #100172 - Mark-Simulacrum:bump-165, r=Mark-Simulacrum
Bump to 1.65.0

r? `@Mark-Simulacrum`
2022-08-06 09:37:32 +00:00
bors
bd04658eb6 Auto merge of #99743 - compiler-errors:fulfillment-context-cleanups, r=jackh726
Some `FulfillmentContext`-related cleanups

Use `ObligationCtxt` in some places, remove some `FulfillmentContext`s in others...

r? types
2022-08-06 06:48:15 +00:00
bors
55f46419af Auto merge of #100035 - workingjubilee:merge-functions, r=nikic
Enable function merging when opt is for size

It is, of course, natural to want to merge aliasing functions when
optimizing for code size, since that can eliminate several bytes.
And an exhaustive match helps make the code less brittle.

Closes #98215.
2022-08-05 23:11:49 +00:00