Commit Graph

220797 Commits

Author SHA1 Message Date
bors
bf57e8ada6 Auto merge of #108080 - oli-obk:FnPtr-trait, r=lcnr
Add a builtin `FnPtr` trait that is implemented for all function pointers

r? `@ghost`

Rebased version of https://github.com/rust-lang/rust/pull/99531 (plus adjustments mentioned in the PR).

If perf is happy with this version, I would like to land it, even if the diagnostics fix in 9df8e1befb5031a5bf9d8dfe25170620642d3c59 only works for `FnPtr` specifically, and does not generally improve blanket impls.
2023-03-28 12:50:01 +00:00
bors
60660371ef Auto merge of #109557 - fee1-dead-contrib:mv-const-traits, r=oli-obk
Move const trait bounds checks to MIR constck

Fixes #109543. When checking paths in HIR typeck, we don't want to check for const predicates since all we want might just be a function pointer. Therefore we move this to MIR constck and check that bounds are met during MIR constck.

r? `@oli-obk`
2023-03-28 09:43:19 +00:00
Deadbeef
054009d17e fix long line 2023-03-28 08:52:46 +00:00
Deadbeef
b17e6680d6 Move const trait bounds checks to MIR constck
Fixes #109543. When checking paths in HIR typeck, we don't want to check
for const predicates since all we want might just be a function pointer.
Therefore we move this to MIR constck and check that bounds are met
during MIR constck.
2023-03-28 08:39:55 +00:00
bors
f418859d8a Auto merge of #109690 - matthiaskrgr:rollup-6p5m0es, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - #108548 (Clarify the 'use a constant in a pattern' error message)
 - #109565 (Improve documentation for E0223)
 - #109661 (Fix LVI test post LLVM 16 update)
 - #109667 (Always set `RUSTC_BOOTSTRAP` with `x doc`)
 - #109669 (Update books)
 - #109678 (Don't shadow the `dep_node` var in `incremental_verify_ich_failed`)
 - #109682 (Add `#[inline]` to CStr trait implementations)
 - #109685 (Make doc comment a little bit more accurate)
 - #109687 (Document the heuristics IsTerminal uses on Windows)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-28 07:02:21 +00:00
Matthias Krüger
a69496002c
Rollup merge of #109687 - joshtriplett:document-windows-isterminal-heuristics, r=BurntSushi
Document the heuristics IsTerminal uses on Windows

Suggested by `@BurntSushi.`
2023-03-28 07:01:12 +02:00
Matthias Krüger
cad4893a52
Rollup merge of #109685 - est31:not_llvm_but_backend, r=jyn514
Make doc comment a little bit more accurate

It queries not LLVM in particular but the codegen backend *in general*. While cranelift does not provide target features, other codegen backends do.

Found while looking for [this answer](https://github.com/rust-lang/rust/issues/108680#issuecomment-1484324690).
2023-03-28 07:01:12 +02:00
Matthias Krüger
90b6c715df
Rollup merge of #109682 - clubby789:c-str-inline, r=scottmcm
Add `#[inline]` to CStr trait implementations

Fixes #109674

I noticed other usages of traits on `CStr` weren't being inlined, so also added hints to the other implementations
2023-03-28 07:01:11 +02:00
Matthias Krüger
fceb3d49f4
Rollup merge of #109678 - compiler-errors:dont-shadow-in-incremental_verify_ich_failed, r=Nilstrieb
Don't shadow the `dep_node` var in `incremental_verify_ich_failed`

It's better to debug print `DepNode` instead of `ErrorGuaranteed` one line below :^)

fixes #109676
2023-03-28 07:01:11 +02:00
Matthias Krüger
c1ed1180f7
Rollup merge of #109669 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/nomicon

1 commits in 1f3e4cd4fd88b5b5d45feb86a11b6d2f93e5a974..b5f7500fc40775096c2bbd204eae096612cf9047
2023-03-27 13:47:36 UTC to 2023-03-27 13:47:36 UTC

- Fix typo in 3.8 Subtyping and Variance (rust-lang/nomicon#395)

## rust-lang/reference

4 commits in 24c87f6663aed55b05d2cc286878f28f21918825..3c47807a3131b3c7cacb508f52632078d253cd0a
2023-03-26 18:42:43 UTC to 2023-03-14 18:28:23 UTC

- Relax ordering rules for `asm!` operands (rust-lang/reference#1323)
- Improve labeled blocks documentation (rust-lang/reference#1342)
- Inline assembly: Fix repeated and unordered items in guaranteed directives (rust-lang/reference#1341)
- Clarify that free constants are always evaluated at compile time (rust-lang/reference#1328)

## rust-lang/rust-by-example

7 commits in af0998b7473839ca75563ba3d3e7fd0160bef235..cfbfd648ce33926c3490f24de9a5b56cce404b88
2023-03-21 12:05:17 UTC to 2023-03-21 11:58:20 UTC

- Fix two typos in the asm chapter (rust-lang/rust-by-example#1692)
- Change `runtime` error to `compile time` error (rust-lang/rust-by-example#1690)
- Fix tests running on non-x86 platforms. (rust-lang/rust-by-example#1687)
- Remove trailing semicolon from macro expression (rust-lang/rust-by-example#1683)
- Explained why it should not work in Chapter 4.1 (rust-lang/rust-by-example#1682)
- Fix comment to mention the correct type of error (rust-lang/rust-by-example#1680)
- Improve the content for `read_lines` (rust-lang/rust-by-example#1679)

## rust-lang/rustc-dev-guide

9 commits in b1b6d693cd1461e53de4132c1b183ace31cd36e5..d08baa166b463537229eeb737c4ccadabd83cf78
2023-03-26 17:55:53 UTC to 2023-03-14 03:50:20 UTC

- Add locale_resources (rust-lang/rustc-dev-guide#1651)
- Don't require $GITHUB_TOKEN to build locally (rust-lang/rustc-dev-guide#1652)
- bootsrapping stages overview list (rust-lang/rustc-dev-guide#1555)
- Update labels overview (rust-lang/rustc-dev-guide#1639)
- first mention of type, and add a link (rust-lang/rustc-dev-guide#1643)
- Add SIP solution for macOS users (rust-lang/rustc-dev-guide#1636)
- Add chapter on fuzzing (rust-lang/rustc-dev-guide#1646)
- Fix "Crate disambiguator" in libs-and-metadata.md (rust-lang/rustc-dev-guide#1648)
- Update rustdoc-internals.md (rust-lang/rustc-dev-guide#1644)
2023-03-28 07:01:10 +02:00
Matthias Krüger
1af75b1e96
Rollup merge of #109667 - clubby789:fix-stage0-doc, r=ozkanonur
Always set `RUSTC_BOOTSTRAP` with `x doc`

Fixes #100060

Note that there is still a warning - the `unused_allocation` lint does not fire in stage 0, but that's just a matter of waiting for #104363 to land in beta
2023-03-28 07:01:10 +02:00
Matthias Krüger
a608e501ec
Rollup merge of #109661 - fortanix:raoul/EDP-107-fix_lvi_mitigation_tests_llvm_16, r=cuviper
Fix LVI test post LLVM 16 update

#109474 updated LLVM to 16. This causes the LVI mitigation tests for the `x86_64-fortanix-unknown-sgx` platform to fail. This PR fixes those tests again.

cc: `@jethrogb`
2023-03-28 07:01:09 +02:00
Matthias Krüger
eee3f484f9
Rollup merge of #109565 - WaffleLapkin:better_docs_for_e0223, r=oli-obk
Improve documentation for E0223

See discussion in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Inconsistency.20in.20prohibiting.20.60Type.3A.3AAssocType.60
2023-03-28 07:01:08 +02:00
Matthias Krüger
a7c07cf731
Rollup merge of #108548 - jamen:master, r=compiler-errors
Clarify the 'use a constant in a pattern' error message

```rs
use std::borrow::Cow;

const ERROR_CODE: Cow<'_, str> = Cow::Borrowed("23505");

fn main() {
    let x = Cow::from("23505");

    match x {
        ERROR_CODE => {}
    }
}
```
```
error: to use a constant of type `Cow` in a pattern, `Cow` must be annotated with `#[derive(PartialEq, Eq)]`
 --> src/main.rs:9:9
  |
9 |         ERROR_CODE => {}
  |         ^^^^^^^^^^

error: could not compile `playground` due to previous error
```

It seems helpful to link to StructuralEq in this message. I was a little confused, because `Cow<'_, str>` implements PartialEq and Eq, but they're not derived, which I learned is necessary for structural equality and using constants in patterns (thanks to the Rust community Discord server)

For tests, should I update every occurrence of this message? I see tests where this is still a warning and I'm not sure if I should update those.
2023-03-28 07:01:08 +02:00
bors
cbc064b341 Auto merge of #109577 - jonhoo:long-tar-names, r=Mark-Simulacrum
[rust-installer] Allow long link names in tar files

Without this, users trying to run `x.py dist` under a sufficiently long path run into problems when we build the resulting tarballs due to length limits in the original tar spec. The error looks like:

        Finished release [optimized + debuginfo] target(s) in 0.34s
    Copying stage0 std from stage0 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / x86_64-unknown-linux-musl)
    Building stage0 tool rust-installer (x86_64-unknown-linux-gnu)
        Finished release [optimized] target(s) in 0.35s
    Dist rust-std-1.67.1-x86_64-unknown-linux-musl
    Error: failed to generate installer

    Caused by:
        0: failed to tar file '/home/AAAAAAAAAAAAAA/BBBBBB/CCCC/DDD/EEEEE/FFFFFFFFFFFF/GGGGGGGGGGGGGGGG/HHHHHHHHHH/IIIIIIIIIIIIIII/JJJJJ/KKKKKKK/src/build/tmp/tarball/rust-std/x86_64-unknown-linux-musl/rust-std-1.67.1-x86_64-unknown-linux-musl/rust-std-x86_64-unknown-linux-musl/lib/rustlib/x86_64-unknown-linux-musl/lib/self-contained/libc.a'
        1: provided value is too long when setting link name for
    Build completed unsuccessfully in 0:00:03

The fix is to make use of the widely-supported GNU tar extensions which lift this restriction. Switching to [`tar::Builder::append_link`] takes care of that for us. See also alexcrichton/tar-rs#273.

[`tar::Builder::append_link`]: https://docs.rs/tar/0.4.38/tar/struct.Builder.html#method.append_link
2023-03-28 04:24:24 +00:00
Josh Triplett
b38732f25c Add "Platform-specific behavior" heading and link to changes disclaimer 2023-03-28 11:26:43 +09:00
Josh Triplett
1354a38afd Document the heuristics IsTerminal uses on Windows 2023-03-28 10:49:35 +09:00
bors
5ce70ed8da Auto merge of #109561 - raphamorim:master, r=cuviper
Use llvm 16.0.0 instead of 16.0.0-rc4 for build-clang.sh

Ref: https://github.com/rust-lang/rust/pull/107224

This PR doesn't make any update on LLVM submodule used by Rust repo, but would be super keen to update it, if necessary (https://rustc-dev-guide.rust-lang.org/backend/updating-llvm.html). LLVM 16.0.0 has been [released](https://discourse.llvm.org/t/llvm-16-0-0-release/69326) on March 18, while Rust 1.70 will become stable on June 1.

- https://releases.llvm.org/16.0.0/docs/ReleaseNotes.html
2023-03-28 01:03:27 +00:00
est31
7bbc8ef022 Make doc comment a little bit more accurate
It queries not LLVM in particular but the codegen backend *in general*.
While cranelift does not provide target features, other codegen backends do.
2023-03-28 02:19:46 +02:00
clubby789
901f10899c Add #[inline] to CStr trait implementations 2023-03-28 01:09:31 +01:00
bors
5bf139e360 Auto merge of #109440 - WaffleLapkin:make_tidy_slower, r=jyn514
Don't skip all directories when tidy-checking

This fixes a regression from https://github.com/rust-lang/rust/pull/108772 which basically made it that tidy style checks only `README.md` and `COMPILER_TESTS.md`.
2023-03-27 22:19:56 +00:00
Michael Goulet
f738b44c6d no shadow plz 2023-03-27 20:47:15 +00:00
bors
2036fdd24f Auto merge of #109668 - GuillaumeGomez:rollup-j01if4b, r=GuillaumeGomez
Rollup of 6 pull requests

Successful merges:

 - #109330 (rustdoc: Fix ICE for intra-doc link on intermediate re-export)
 - #109354 (Remove the `NodeId` of `ast::ExprKind::Async`)
 - #109445 (Allow passing the --nocapture flag to compiletest)
 - #109512 (bump `askama_derive` to 0.12.1)
 - #109637 (Add missing needs-asm-support annotation to ui/simple_global_asm.rs)
 - #109666 (Correct ASCII case comment)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-27 19:44:36 +00:00
Maybe Waffle
904dd2c398 Bless tidy 2023-03-27 18:58:07 +00:00
Maybe Waffle
8af42f695d Remove useless Clone bounds 2023-03-27 18:52:47 +00:00
Maybe Waffle
436afdf1fe Don't skip all directories when tidy-checking 2023-03-27 18:52:47 +00:00
Maybe Waffle
3c4fabc341 Improve documentation for E0223 2023-03-27 18:00:22 +00:00
rustbot
7cba12c5a9 Update books 2023-03-27 13:00:59 -04:00
Guillaume Gomez
c0dec2bbe3
Rollup merge of #109666 - clubby789:ascii-case-comment, r=fee1-dead
Correct ASCII case comment

Fixes #109508
2023-03-27 18:56:22 +02:00
Guillaume Gomez
17f2c2bbd3
Rollup merge of #109637 - bjorn3:add_test_annotation, r=tmiasko
Add missing needs-asm-support annotation to ui/simple_global_asm.rs
2023-03-27 18:56:21 +02:00
Guillaume Gomez
bb96606f8b
Rollup merge of #109512 - fee1-dead-contrib:bump-askama_derive, r=Mark-Simulacrum
bump `askama_derive` to 0.12.1

Which uses syn 2.0.

cc #109302
2023-03-27 18:56:21 +02:00
Guillaume Gomez
df453d9528
Rollup merge of #109445 - Teapot4195:issue-109407-fix, r=ozkanonur
Allow passing the --nocapture flag to compiletest

closes #109407
2023-03-27 18:56:20 +02:00
Guillaume Gomez
b1e8be783f
Rollup merge of #109354 - Swatinem:rm-closureid, r=compiler-errors
Remove the `NodeId` of `ast::ExprKind::Async`

This is a followup to https://github.com/rust-lang/rust/pull/104833#pullrequestreview-1314537416.

In my original attempt, I was using `LoweringContext::expr`, which was not correct as it creates a fresh `DefId`.
It now uses the correct `DefId` for the wrapping `Expr`, and also makes forwarding `#[track_caller]` attributes more explicit.
2023-03-27 18:56:19 +02:00
Guillaume Gomez
52c8084f91
Rollup merge of #109330 - GuillaumeGomez:intermediate-reexport-intra-doc-ice, r=petrochenkov
rustdoc: Fix ICE for intra-doc link on intermediate re-export

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

This PR is based on #109266 as it includes its commit to make this work.

`@petrochenkov:` It was exactly as you predicted, adding the `DefId` to the attributes fixed the error for intermediate re-exports as well. Thanks a lot!

r? `@petrochenkov`
2023-03-27 18:56:19 +02:00
clubby789
9fc7eca935 Always set RUSTC_BOOTSTRAP with x doc 2023-03-27 17:12:18 +01:00
Jamen Marz
73c34cbaf7 Add notes to non-structural const in pattern error message 2023-03-27 11:08:11 -04:00
clubby789
3e16c56ffc
Fix ASCII case comment 2023-03-27 16:06:54 +01:00
bors
dd19135b04 Auto merge of #109662 - matthiaskrgr:rollup-tk2g3jf, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #108625 (More config.toml.example cleanups)
 - #109418 (Rename 'src/bootstrap/native.rs' to llvm.rs)
 - #109580 (Remove some stale FIXMEs in new solver)
 - #109582 (Refactor: Separate `LocalRef` variant for not-evaluated-yet operands)
 - #109650 (Remove Nilstrieb from review rotation)
 - #109656 (Update cargo)
 - #109658 (Backport 1.68.1 and 1.68.2 release notes to `master`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-03-27 13:35:35 +00:00
Matthias Krüger
c3a428fb1a
Rollup merge of #109658 - rust-lang:pa-1.68.2-relnotes, r=pietroalbini
Backport 1.68.1 and 1.68.2 release notes to `master`
2023-03-27 15:32:43 +02:00
Matthias Krüger
297e3a1dae
Rollup merge of #109656 - weihanglo:update-cargo, r=weihanglo
Update cargo

9 commits in 15d090969743630bff549a1b068bcaa8174e5ee3..145219a9f089f8b57c09f40525374fbade1e34ae 2023-03-21 17:54:28 +0000 to 2023-03-27 01:56:36 +0000
- doc(contrib): missing quotation mark (rust-lang/cargo#11894)
- Update changelog for 1.68.2 (rust-lang/cargo#11893)
- Add the old github keys as revoked (rust-lang/cargo#11889)
- Update proptest (rust-lang/cargo#11886)
- Added new GitHub RSA Host Key (rust-lang/cargo#11883)
- doc: Fix registries.name.index for sparse (rust-lang/cargo#11880)
- docs(contrib): Replace architecture with redirects (rust-lang/cargo#11876)
- docs: fix typos in `cargo_compile/mod.rs` (rust-lang/cargo#11874)
- docs(contrub): Remove unused file (rust-lang/cargo#11873)

r? `@ghost`
2023-03-27 15:32:43 +02:00
Matthias Krüger
b885e5fdfc
Rollup merge of #109650 - Nilstrieb:i-will-not-review-your-code, r=albertlarsan68
Remove Nilstrieb from review rotation

I currently don't have enough time to be on rotation. You can still request a review from me and I may still steal PRs sometimes though.
2023-03-27 15:32:42 +02:00
Matthias Krüger
7f6b406fa1
Rollup merge of #109582 - scottmcm:local-ref-pending, r=oli-obk
Refactor: Separate `LocalRef` variant for not-evaluated-yet operands

As I was reading through this, I noticed that almost every place that was using this needed to distinguish between Some vs None in the match arm anyway, so thought that separating the cases at the variant level might be clearer instead.

I like how it ended up; let me know what you think!
2023-03-27 15:32:42 +02:00
Matthias Krüger
9c73bf9038
Rollup merge of #109580 - compiler-errors:new-solver-fixmes, r=lcnr
Remove some stale FIXMEs in new solver

Some FIXMEs are no longer needed
2023-03-27 15:32:41 +02:00
Matthias Krüger
3917644b0e
Rollup merge of #109418 - rohaquinlop:108240-rename-native.rs-to-llvm.rs, r=Mark-Simulacrum
Rename 'src/bootstrap/native.rs' to llvm.rs

Fixed #108240

Renamed 'native.rs' to 'llvm.rs', also moved `TestHelpers` to `test.rs`. Replaced all the `native.rs` occurrences at `src/bootstrap` files to `llvm.rs`
2023-03-27 15:32:41 +02:00
Matthias Krüger
84a7540a83
Rollup merge of #108625 - jyn514:config-toml-cleanups, r=albertlarsan68
More config.toml.example cleanups

- Link to more documentation
- Move `changelog-seen` into the "Global Settings" section
- Update incorrect comments on `llvm.link-shared` and `rust.debug-assertions`
- Use the correct default in the commented-out example more often
- Clarify that `docs` and `compiler-docs` only control the default, they're not a hard-off switch.
- Document `-vvv` and `local-rebuild`
- Minor improvements to doc-comments in config.toml.example

This also sets `download-rustc = false`; that was already the default, but it will be helpful in case the default changes (https://jyn.dev/2023/01/12/Bootstrapping-Rust-in-2023.html).
2023-03-27 15:32:40 +02:00
Oli Scherer
5ae6caa0f0 Use the FnPtr trait to avoid implementing common traits via macros 2023-03-27 12:19:52 +00:00
Oli Scherer
9e27c6c133 Some tracing/instrument cleanups 2023-03-27 12:19:15 +00:00
lcnr
0c13565ca6 Add a builtin FnPtr trait 2023-03-27 12:16:54 +00:00
Joshua Nelson
20ca24e3c5 More config.toml.example cleanups
- Link to more documentation
- Move `changelog-seen` into the "Global Settings" section
- Update incorrect comments on `llvm.link-shared` and
  `rust.debug-assertions`
- Use the correct default in the commented-out example more often
- Clarify that `docs` and `compiler-docs` only control the default,
  they're not a hard-off switch.
- Document `-vvv` and `local-rebuild`
- Minor improvements to doc-comments in config.toml.example

This also sets `download-rustc = false`; that was already the default,
but it will be helpful in case the default changes
(https://jyn.dev/2023/01/12/Bootstrapping-Rust-in-2023.html).
2023-03-27 07:07:49 -05:00
Raoul Strackx
64927b973b Fix LVI test post LLVM 16 update 2023-03-27 13:48:38 +02:00