| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Update dependencies
#136077 needs manual tweaking
```
compiler and tools dependencies
Updating anyhow v1.0.95 -> v1.0.97
Updating basic-toml v0.1.9 -> v0.1.10
Updating bitflags v2.8.0 -> v2.9.0
Updating blake3 v1.5.5 -> v1.8.0
Updating bumpalo v3.16.0 -> v3.17.0
Removing byteorder v1.5.0
Updating bytes v1.9.0 -> v1.10.1
Updating cargo_metadata v0.19.1 -> v0.19.2
Updating chrono v0.4.39 -> v0.4.40
Updating chrono-tz v0.10.1 -> v0.10.3
Updating chrono-tz-build v0.4.0 -> v0.4.1
Updating clap v4.5.26 -> v4.5.35
Updating clap_builder v4.5.26 -> v4.5.35
Updating clap_derive v4.5.24 -> v4.5.35
Updating console v0.15.10 -> v0.15.11
Updating cpufeatures v0.2.16 -> v0.2.17
Updating curl-sys v0.4.78+curl-8.11.0 -> v0.4.80+curl-8.12.1
Updating darling v0.20.10 -> v0.20.11
Updating darling_core v0.20.10 -> v0.20.11
Updating darling_macro v0.20.10 -> v0.20.11
Updating deranged v0.3.11 -> v0.4.1
Updating dissimilar v1.0.9 -> v1.0.10
Updating either v1.13.0 -> v1.15.0
Updating elsa v1.11.0 -> v1.11.2
Updating env_logger v0.11.6 -> v0.11.7
Updating equivalent v1.0.1 -> v1.0.2
Updating flate2 v1.0.35 -> v1.1.0
Updating foldhash v0.1.4 -> v0.1.5
Updating getrandom v0.3.1 -> v0.3.2
Updating globset v0.4.15 -> v0.4.16
Downgrading html5ever v0.29.2 -> v0.29.1 (available: v0.30.0)
Updating humantime v2.1.0 -> v2.2.0
Updating icu_list_data v1.5.0 -> v1.5.1
Updating icu_locid_transform_data v1.5.0 -> v1.5.1
Updating icu_normalizer_data v1.5.0 -> v1.5.1
Updating icu_properties_data v1.5.0 -> v1.5.1
Updating indexmap v2.7.0 -> v2.8.0
Updating indicatif v0.17.9 -> v0.17.11
Updating inout v0.1.3 -> v0.1.4
Updating itoa v1.0.14 -> v1.0.15
Adding jiff v0.2.5
Adding jiff-static v0.2.5
Updating jobserver v0.1.32 -> v0.1.33
Updating lexopt v0.3.0 -> v0.3.1
Adding leb128fmt v0.1.0
Updating libc v0.2.169 -> v0.2.171
Updating libz-sys v1.1.21 -> v1.1.22
Updating linux-raw-sys v0.4.15 -> v0.9.3
Updating litemap v0.7.4 -> v0.7.5
Updating log v0.4.25 -> v0.4.27
Downgrading markup5ever v0.15.0 -> v0.14.1
Updating miniz_oxide v0.8.3 -> v0.8.5
Updating once_cell v1.20.2 -> v1.21.3
Updating openssl-probe v0.1.5 -> v0.1.6
Updating openssl-sys v0.9.104 -> v0.9.106
Updating pest v2.7.15 -> v2.8.0
Updating pest_derive v2.7.15 -> v2.8.0
Updating pest_generator v2.7.15 -> v2.8.0
Updating pest_meta v2.7.15 -> v2.8.0
Updating pkg-config v0.3.31 -> v0.3.32
Updating portable-atomic v1.10.0 -> v1.11.0
Adding portable-atomic-util v0.2.4
Updating ppv-lite86 v0.2.20 -> v0.2.21
Updating proc-macro2 v1.0.93 -> v1.0.94
Updating quote v1.0.38 -> v1.0.40
Adding r-efi v5.2.0
Updating rand_core v0.9.0 -> v0.9.3
Updating redox_syscall v0.5.8 -> v0.5.10
Updating rustc-stable-hash v0.1.1 -> v0.1.2
Updating rustc_tools_util v0.4.0 -> v0.4.2
Updating rustix v0.38.43 -> v1.0.5
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.18 -> v1.0.20
Updating semver v1.0.24 -> v1.0.26
Updating serde v1.0.217 -> v1.0.219
Updating serde_derive v1.0.217 -> v1.0.219
Updating serde_json v1.0.135 -> v1.0.140
Updating similar v2.6.0 -> v2.7.0
Updating smallvec v1.13.2 -> v1.14.0
Updating socket2 v0.5.8 -> v0.5.9
Updating stacker v0.1.18 -> v0.1.20
Updating string_cache v0.8.8 -> v0.8.9
Updating syn v2.0.96 -> v2.0.100
Updating tar v0.4.43 -> v0.4.44
Updating tempfile v3.15.0 -> v3.19.1
Updating thin-vec v0.2.13 -> v0.2.14
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating time v0.3.37 -> v0.3.41
Updating time-core v0.1.2 -> v0.1.4
Updating time-macros v0.2.19 -> v0.2.22
Updating tinyvec v1.8.1 -> v1.9.0
Updating tokio v1.43.0 -> v1.44.1
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.14 -> v1.0.18
Updating uuid v1.12.0 -> v1.16.0
Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
Removing wasm-encoder v0.219.1
Removing wasm-encoder v0.223.0
Adding wasm-encoder v0.219.2 (available: v0.227.1)
Adding wasm-encoder v0.223.1
Adding wasm-encoder v0.228.0
Updating wasm-metadata v0.223.0 -> v0.223.1
Removing wasmparser v0.219.1
Removing wasmparser v0.222.0
Removing wasmparser v0.223.0
Adding wasmparser v0.219.2 (available: v0.227.1)
Adding wasmparser v0.222.1
Adding wasmparser v0.223.1
Adding wasmparser v0.228.0
Updating wast v223.0.0 -> v228.0.0
Updating wat v1.223.0 -> v1.228.0
Updating windows-core v0.52.0 -> v0.61.0
Adding windows-implement v0.60.0
Updating windows-interface v0.59.0 -> v0.59.1
Adding windows-link v0.1.1
Updating windows-result v0.3.0 -> v0.3.2
Updating windows-strings v0.3.0 -> v0.3.1
Adding windows-strings v0.4.0
Updating wit-bindgen-rt v0.33.0 -> v0.39.0
Updating wit-component v0.223.0 -> v0.223.1
Updating wit-parser v0.223.0 -> v0.223.1
Updating xattr v1.4.0 -> v1.5.0
Updating zerocopy v0.8.14 -> v0.8.24
Updating zerocopy-derive v0.8.14 -> v0.8.24
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
```
|
|
|
|
Tell rustfmt to use the 2024 edition in ./x.py fmt
Most crates in this repo have been moved to the 2024 edition already. This also allows removing a rustfmt exclusion for a cg_clif test.
|
|
Update mdbook to 0.4.48
This brings in several updates. Two significant ones are to halve the search index size, and the other introduces major changes to footnote rendering.
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0448
|
|
chore: remove redundant backtick
remove redundant backtick
|
|
fix dead link netbsd.md
src/doc/rustc/src/platform-support/netbsd.md
https://github.com/NetBSD/pkgsrc-wip/blob/master/rust/Makefile - https://github.com/NetBSD/pkgsrc-wip/blob/master/Makefile
|
|
Shourya742:2025-03-28-replace-commit-with-actual-value, r=onur-ozkan
replace commit placeholder in vendor status with actual commit
closes: #120499
try-job: dist-x86_64-illumos
|
|
r=notriddle
Remove even more instances of @ts-expect-error from search.js
r? `@notriddle`
|
|
This eliminates all methods on `Map`. Actually removing `Map` will occur
in a follow-up PR.
|
|
|
|
Updating anyhow v1.0.95 -> v1.0.97
Updating basic-toml v0.1.9 -> v0.1.10
Updating bitflags v2.8.0 -> v2.9.0
Updating blake3 v1.5.5 -> v1.8.0
Updating bumpalo v3.16.0 -> v3.17.0
Removing byteorder v1.5.0
Updating bytes v1.9.0 -> v1.10.1
Updating cargo_metadata v0.19.1 -> v0.19.2
Updating chrono v0.4.39 -> v0.4.40
Updating chrono-tz v0.10.1 -> v0.10.3
Updating chrono-tz-build v0.4.0 -> v0.4.1
Updating clap v4.5.26 -> v4.5.35
Updating clap_builder v4.5.26 -> v4.5.35
Updating clap_derive v4.5.24 -> v4.5.32
Updating console v0.15.10 -> v0.15.11
Updating cpufeatures v0.2.16 -> v0.2.17
Updating curl-sys v0.4.78+curl-8.11.0 -> v0.4.80+curl-8.12.1
Updating darling v0.20.10 -> v0.20.11
Updating darling_core v0.20.10 -> v0.20.11
Updating darling_macro v0.20.10 -> v0.20.11
Updating deranged v0.3.11 -> v0.4.0
Updating dissimilar v1.0.9 -> v1.0.10
Updating either v1.13.0 -> v1.15.0
Updating elsa v1.11.0 -> v1.11.2
Updating env_logger v0.11.6 -> v0.11.7
Updating equivalent v1.0.1 -> v1.0.2
Updating flate2 v1.0.35 -> v1.1.0
Updating foldhash v0.1.4 -> v0.1.5
Updating getrandom v0.3.1 -> v0.3.2
Updating globset v0.4.15 -> v0.4.16
Downgrading html5ever v0.29.2 -> v0.29.1 (available: v0.30.0)
Updating humantime v2.1.0 -> v2.2.0
Updating iana-time-zone v0.1.61 -> v0.1.63
Updating icu_list_data v1.5.0 -> v1.5.1
Updating icu_locid_transform_data v1.5.0 -> v1.5.1
Updating icu_normalizer_data v1.5.0 -> v1.5.1
Updating icu_properties_data v1.5.0 -> v1.5.1
Updating indexmap v2.7.0 -> v2.8.0
Updating indicatif v0.17.9 -> v0.17.11
Updating inout v0.1.3 -> v0.1.4
Updating itoa v1.0.14 -> v1.0.15
Adding jiff v0.2.5
Adding jiff-static v0.2.5
Updating jobserver v0.1.32 -> v0.1.33
Adding leb128fmt v0.1.0
Updating lexopt v0.3.0 -> v0.3.1
Updating libc v0.2.169 -> v0.2.171
Updating libz-sys v1.1.21 -> v1.1.22
Updating linux-raw-sys v0.4.15 -> v0.9.3
Updating litemap v0.7.4 -> v0.7.5
Updating log v0.4.25 -> v0.4.27
Downgrading markup5ever v0.15.0 -> v0.14.1
Updating miniz_oxide v0.8.3 -> v0.8.5
Updating once_cell v1.20.2 -> v1.21.3
Updating openssl-probe v0.1.5 -> v0.1.6
Updating openssl-sys v0.9.104 -> v0.9.106
Updating pest v2.7.15 -> v2.8.0
Updating pest_derive v2.7.15 -> v2.8.0
Updating pest_generator v2.7.15 -> v2.8.0
Updating pest_meta v2.7.15 -> v2.8.0
Updating pkg-config v0.3.31 -> v0.3.32
Updating portable-atomic v1.10.0 -> v1.11.0
Adding portable-atomic-util v0.2.4
Updating ppv-lite86 v0.2.20 -> v0.2.21
Updating proc-macro2 v1.0.93 -> v1.0.94
Updating quote v1.0.38 -> v1.0.40
Adding r-efi v5.2.0
Updating rand_core v0.9.0 -> v0.9.3
Updating redox_syscall v0.5.8 -> v0.5.10
Updating rustc-stable-hash v0.1.1 -> v0.1.2
Updating rustc_tools_util v0.4.0 -> v0.4.2
Updating rustix v0.38.43 -> v1.0.5
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.18 -> v1.0.20
Updating semver v1.0.24 -> v1.0.26
Updating serde v1.0.217 -> v1.0.219
Updating serde_derive v1.0.217 -> v1.0.219
Updating serde_json v1.0.135 -> v1.0.140
Updating similar v2.6.0 -> v2.7.0
Updating smallvec v1.13.2 -> v1.14.0
Updating socket2 v0.5.8 -> v0.5.9
Updating stacker v0.1.18 -> v0.1.20
Updating string_cache v0.8.8 -> v0.8.9
Updating syn v2.0.96 -> v2.0.100
Updating tar v0.4.43 -> v0.4.44
Updating tempfile v3.15.0 -> v3.19.1
Updating thin-vec v0.2.13 -> v0.2.14
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating time v0.3.37 -> v0.3.41
Updating time-core v0.1.2 -> v0.1.4
Updating time-macros v0.2.19 -> v0.2.22
Updating tinyvec v1.8.1 -> v1.9.0
Updating tokio v1.43.0 -> v1.44.1
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.14 -> v1.0.18
Updating uuid v1.12.0 -> v1.16.0
Updating wasi v0.13.3+wasi-0.2.2 -> v0.14.2+wasi-0.2.4
Removing wasm-encoder v0.219.1
Removing wasm-encoder v0.223.0
Adding wasm-encoder v0.219.2 (available: v0.228.0)
Adding wasm-encoder v0.223.1
Adding wasm-encoder v0.228.0
Updating wasm-metadata v0.223.0 -> v0.223.1
Removing wasmparser v0.219.1
Removing wasmparser v0.222.0
Removing wasmparser v0.223.0
Adding wasmparser v0.219.2 (available: v0.228.0)
Adding wasmparser v0.222.1
Adding wasmparser v0.223.1
Adding wasmparser v0.228.0
Updating wast v223.0.0 -> v228.0.0
Updating wat v1.223.0 -> v1.228.0
Updating windows-core v0.52.0 -> v0.61.0
Adding windows-implement v0.60.0
Updating windows-interface v0.59.0 -> v0.59.1
Adding windows-link v0.1.1
Updating windows-result v0.3.0 -> v0.3.2
Removing windows-strings v0.3.0
Adding windows-strings v0.3.1
Adding windows-strings v0.4.0
Updating wit-bindgen-rt v0.33.0 -> v0.39.0
Updating wit-component v0.223.0 -> v0.223.1
Updating wit-parser v0.223.0 -> v0.223.1
Updating xattr v1.4.0 -> v1.5.0
Removing zerocopy v0.7.35
Removing zerocopy v0.8.14
Adding zerocopy v0.8.24
Removing zerocopy-derive v0.7.35
Removing zerocopy-derive v0.8.14
Adding zerocopy-derive v0.8.24
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
library dependencies
Updating dlmalloc v0.2.7 -> v0.2.8
Updating miniz_oxide v0.8.3 -> v0.8.5
Updating proc-macro2 v1.0.93 -> v1.0.94
Updating quote v1.0.38 -> v1.0.40
Updating rand_core v0.9.0 -> v0.9.3
Updating syn v2.0.98 -> v2.0.100
Updating unicode-ident v1.0.16 -> v1.0.18
Updating zerocopy v0.8.17 -> v0.8.24
Updating zerocopy-derive v0.8.17 -> v0.8.24
rustbook dependencies
Updating anyhow v1.0.95 -> v1.0.97
Updating bitflags v2.8.0 -> v2.9.0
Removing byteorder v1.5.0
Updating cc v1.2.10 -> v1.2.17
Updating chrono v0.4.39 -> v0.4.40
Updating clap v4.5.27 -> v4.5.32
Updating clap_builder v4.5.27 -> v4.5.32
Updating clap_complete v4.5.43 -> v4.5.47
Updating clap_derive v4.5.24 -> v4.5.32
Updating env_logger v0.11.6 -> v0.11.7
Updating equivalent v1.0.1 -> v1.0.2
Updating flate2 v1.0.35 -> v1.1.0
Updating getrandom v0.2.15 -> v0.3.2
Updating handlebars v6.3.0 -> v6.3.2
Removing humantime v2.1.0
Updating indexmap v2.7.1 -> v2.8.0
Updating itoa v1.0.14 -> v1.0.15
Adding jiff v0.2.5
Adding jiff-static v0.2.5
Updating libc v0.2.169 -> v0.2.171
Updating linux-raw-sys v0.4.15 -> v0.9.3
Updating litemap v0.7.4 -> v0.7.5
Updating log v0.4.25 -> v0.4.26
Updating mdbook-i18n-helpers v0.3.5 -> v0.3.6
Updating miniz_oxide v0.8.3 -> v0.8.5
Updating once_cell v1.20.2 -> v1.21.1
Removing phf_generator v0.10.0
Removing phf_shared v0.10.0
Updating pkg-config v0.3.31 -> v0.3.32
Adding portable-atomic v1.11.0
Adding portable-atomic-util v0.2.4
Removing ppv-lite86 v0.2.20
Updating proc-macro2 v1.0.93 -> v1.0.94
Removing pulldown-cmark v0.11.3
Updating pulldown-cmark-to-cmark v15.0.1 -> v20.0.1
Updating quote v1.0.38 -> v1.0.40
Adding r-efi v5.2.0
Removing rand_chacha v0.3.1
Updating redox_syscall v0.5.8 -> v0.5.10
Updating rustix v0.38.44 -> v1.0.3
Updating rustversion v1.0.19 -> v1.0.20
Updating ryu v1.0.19 -> v1.0.20
Updating semver v1.0.25 -> v1.0.26
Updating serde v1.0.217 -> v1.0.219
Updating serde_derive v1.0.217 -> v1.0.219
Updating serde_json v1.0.138 -> v1.0.140
Removing siphasher v0.3.11
Updating smallvec v1.13.2 -> v1.14.0
Updating string_cache v0.8.7 -> v0.8.8
Updating string_cache_codegen v0.5.2 -> v0.5.4
Updating syn v2.0.96 -> v2.0.100
Updating tempfile v3.15.0 -> v3.19.1
Updating terminal_size v0.4.1 -> v0.4.2
Updating textwrap v0.16.1 -> v0.16.2
Updating thiserror v2.0.11 -> v2.0.12
Updating thiserror-impl v2.0.11 -> v2.0.12
Updating toml v0.8.19 -> v0.8.20
Updating toml_edit v0.22.22 -> v0.22.24
Updating typenum v1.17.0 -> v1.18.0
Updating unicode-ident v1.0.16 -> v1.0.18
Updating wasi v0.11.0+wasi-snapshot-preview1 -> v0.14.2+wasi-0.2.4
Adding windows-link v0.1.1
Updating winnow v0.6.25 -> v0.7.4
Adding wit-bindgen-rt v0.39.0
Removing zerocopy v0.7.35
Removing zerocopy-derive v0.7.35
Updating zerofrom v0.1.5 -> v0.1.6
Updating zerofrom-derive v0.1.5 -> v0.1.6
|
|
in MBE
Specifically, #18744 was the PR that was supposed to fix the old bug, but it fixed it incorrectly (and didn't add a test!) The underlying reason was that we marked metavariables in expansions as joint if they were joint in the macro call, which is incorrect.
This wrong fix causes other bug, #19497, which this PR fixes by removing the old (incorrect) fix.
|
|
|
|
|
|
|
|
remove `feature(inline_const_pat)`
Summarizing https://rust-lang.zulipchat.com/#narrow/channel/144729-t-types/topic/remove.20feature.28inline_const_pat.29.20and.20shared.20borrowck.
With https://github.com/rust-lang/types-team/issues/129 we will start to borrowck items together with their typeck parent. This is necessary to correctly support opaque types, blocking the new solver and TAIT/ATPIT stabilization with the old one. This means that we cannot really support `inline_const_pat` as they are implemented right now:
- we want to typeck inline consts together with their parent body to allow inference to flow both ways and to allow the const to refer to local regions of its parent.This means we also need to borrowck the inline const together with its parent as that's necessary to properly support opaque types
- we want the inline const pattern to participate in exhaustiveness checking
- to participate in exhaustiveness checking we need to evaluate it, which requires borrowck, which now relies on borrowck of the typeck root, which ends up checking exhaustiveness again. **This is a query cycle**.
There are 4 possible ways to handle this:
- stop typechecking inline const patterns together with their parent
- causes inline const patterns to be different than inline const exprs
- prevents bidirectional inference, we need to either fail to compile `if let const { 1 } = 1u32` or `if let const { 1u32 } = 1`
- region inference for inline consts will be harder, it feels non-trivial to support inline consts referencing local regions from the parent fn
- inline consts no longer participate in exhaustiveness checking. Treat them like `pat if pat == const { .. }` instead. We then only evaluate them after borrowck
- difference between `const { 1 }` and `const FOO: usize = 1; match x { FOO => () }`. This is confusing
- do they carry their weight if they are now just equivalent to using an if-guard
- delay exhaustiveness checking until after borrowck
- should be possible in theory, but is a quite involved change and may have some unexpected challenges
- remove this feature for now
I believe we should either delay exhaustiveness checking or remove the feature entirely. As moving exhaustiveness checking to after borrow checking is quite complex I think the right course of action is to fully remove the feature for now and to add it again once/if we've got that implementation figured out.
`const { .. }`-expressions remain stable. These seem to have been the main motivation for https://github.com/rust-lang/rfcs/issues/2920.
r? types
cc `@rust-lang/types` `@rust-lang/lang` #76001
|
|
This brings in several updates. Two significant ones are to halve the
search index size, and the other introduces major changes to footnote
rendering.
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0448
|
|
Update netbsd.md
Update netbsd.md
|
|
|
|
Signed-off-by: highcloudwind <highcloud@aliyun.com>
|
|
|
|
chore: Remove unnecessary `Arc` clones
|
|
chore: Replace some `invoke`s with `invoke_actual` in hir-ty
|
|
|
|
|
|
Introduce `-Zembed-metadata` to allow omitting full metadata from rlibs and dylibs
This is a continuation of https://github.com/rust-lang/rust/pull/120855 (I was mentored by `@bjorn3` to move it forward). Most of the original code was written by bjorn3, I tried to clean it up a bit and add some documentation and tests.
This PR introduces a new unstable compiler flag called `-Zembed-metadata=[no|yes]`, with the default being `yes` (see https://github.com/rust-lang/rust/issues/57076 for context). When set to `no`, rustc will only store a small metadata stub inside rlibs/dylibs instead of the full metadata, to keep their size smaller. It should be used in combination with `--emit=metadata`, so that the users of such a compiled library can still read the metadata from the corresponding `.rmeta` file. [This comment](https://github.com/rust-lang/rust/pull/120855#issuecomment-1937018169) shows an example of binary/artifact size wins that can be achieved using this approach.
Contrary to https://github.com/rust-lang/rust/pull/120855, this PR only introduces the new flag, along with a couple of run-make tests and documentation, but does not yet use it in bootstrap to actually compile rustc. I plan to do that as a follow-up step (along with integration in Cargo, which should ideally just always pass this flag to reduce the size of target directories).
Fixes https://github.com/rust-lang/rust/issues/23366
Closes https://github.com/rust-lang/rust/issues/29511
Fixes https://github.com/rust-lang/rust/issues/57076
Another attempt of https://github.com/rust-lang/rust/pull/93945 and https://github.com/rust-lang/rust/pull/120855.
r? `@petrochenkov`
|
|
|
|
Move `ast::Item::ident` into `ast::ItemKind`
The follow-up to #138384, which did the same thing for `hir::ItemKind`.
r? `@fmease`
|
|
|
|
It doesn't actually work with merge groups ...
|
|
|
|
Avoid relying on `block_def_map()` needlessly
|
|
We can compute the wanted information from the block's interned data.
|
|
`ast::Item` has an `ident` field.
- It's always non-empty for these item kinds: `ExternCrate`, `Static`,
`Const`, `Fn`, `Mod`, `TyAlias`, `Enum`, `Struct`, `Union`,
`Trait`, `TraitAlias`, `MacroDef`, `Delegation`.
- It's always empty for these item kinds: `Use`, `ForeignMod`,
`GlobalAsm`, `Impl`, `MacCall`, `DelegationMac`.
There is a similar story for `AssocItemKind` and `ForeignItemKind`.
Some sites that handle items check for an empty ident, some don't. This
is a very C-like way of doing things, but this is Rust, we have sum
types, we can do this properly and never forget to check for the
exceptional case and never YOLO possibly empty identifiers (or possibly
dummy spans) around and hope that things will work out.
The commit is large but it's mostly obvious plumbing work. Some notable
things.
- `ast::Item` got 8 bytes bigger. This could be avoided by boxing the
fields within some of the `ast::ItemKind` variants (specifically:
`Struct`, `Union`, `Enum`). I might do that in a follow-up; this
commit is big enough already.
- For the visitors: `FnKind` no longer needs an `ident` field because
the `Fn` within how has one.
- In the parser, the `ItemInfo` typedef is no longer needed. It was used
in various places to return an `Ident` alongside an `ItemKind`, but
now the `Ident` (if present) is within the `ItemKind`.
- In a few places I renamed identifier variables called `name` (or
`foo_name`) as `ident` (or `foo_ident`), to better match the type, and
because `name` is normally used for `Symbol`s. It's confusing to see
something like `foo_name.name`.
|
|
`FmtVisitor::visit_mac` has an `Option<Ident>` arg which is always
either `None` or `Some(kw::Empty)`, because `ItemKind::MacCall` always
has an empty ident. This value is passed through various functions until
it reaches `rewrite_macro_name`, which treats `None` and
`Some(kw::Empty)` the same.
In other words, the argument is useless. This commit removes it. There
is no change in behaviour. The commit also changes a few `symbol::Ident`
occurrences to `Ident` in `macros.rs`; `Symbol` is imported in that file
so `Ident` might as well be, too.
(This is a good example of why it's a bad idea for `Itemt` to have an
`ident` field when various item kinds don't have an identifier. It's
easy to get confused when "empty identifier" is used to mean "no
identifier". This will be fixed in a subsequent commit.)
|
|
Instead of putting the item inside it, just pass the ident and
visibility (the only things needed) alongside it where necessary.
This helps with the next commit, which will move the ident's location.
Specifically, it gets rid of the `match visitor_kind` in
`rewrite_type_alias`.
|
|
|
|
tidy: properly check for orphaned unstable_book pages
This also recommends using underscores - something that took me a little bit too long to figure out.
Note: this PR deletes the page `src/doc/unstable-book/src/library-features/c-variadic.md`. The page `src/doc/unstable-book/src/lang-features/c-variadic.md` remains.
|
|
By changing two of the fields to use `Option<Ident>` instead of `Ident`.
As a result, `None` now means "no identifier", which is much clearer
than using an empty identifier.
|
|
chore: Clean CI a bit
|
|
|
|
|
|
do not run EnvVars::cleanup if there was an interpreter error
|
|
|
|
|
|
|
|
Uplift `clippy::invalid_null_ptr_usage` lint as `invalid_null_arguments`
This PR aims at uplifting the `clippy::invalid_null_ptr_usage` lint into rustc, this is similar to the [`clippy::invalid_utf8_in_unchecked` uplift](https://github.com/rust-lang/rust/pull/111543) a few months ago, in the sense that those two lints lint on invalid parameter(s), here a null pointer where it is unexpected and UB to pass one.
*For context: GitHub Search reveals that just for `slice::from_raw_parts{_mut}` [~20 invalid usages](hhttps://github.com/search?q=lang%3Arust+%2Fslice%3A%3Afrom_raw_parts%28_mut%29%3F%5C%28ptr%3A%3Anull%2F+NOT+path%3A%2F%5Eclippy_lints%5C%2Fsrc%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Ftools%5C%2Fclippy%5C%2Fclippy_lints%5C%2Fsrc%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Ftools%5C%2Fclippy%5C%2Fclippy_lints%5C%2Fsrc%5C%2F%2F&type=code) with `ptr::null` and an additional [4 invalid usages](https://github.com/search?q=lang%3Arust+%2Fslice%3A%3Afrom_raw_parts%5C%280%28%5C%29%7C+as%29%2F+NOT+path%3A%2F%5Eclippy_lints%5C%2Fsrc%5C%2F%2F+NOT+path%3A%2F%5Erust%5C%2Fsrc%5C%2Ftools%5C%2Fclippy%5C%2Fclippy_lints%5C%2Fsrc%5C%2F%2F+NOT+path%3A%2F%5Esrc%5C%2Ftools%5C%2Fclippy%5C%2Fclippy_lints%5C%2Fsrc%5C%2F%2F+NOT+path%3A%2F%5Eutils%5C%2Ftinystr%5C%2Fsrc%5C%2F%2F+NOT+path%3A%2F%5Eutils%5C%2Fzerovec%5C%2Fsrc%5C%2F%2F+NOT+path%3A%2F%5Eprovider%5C%2Fcore%5C%2Fsrc%5C%2F%2F&type=code) with `0 as *const ...`-ish casts.*
-----
## `invalid_null_arguments`
(deny-by-default)
The `invalid_null_arguments` lint checks for invalid usage of null pointers.
### Example
```rust
// Undefined behavior
unsafe { std::slice::from_raw_parts(ptr::null(), 1); }
```
Produces:
```
error: calling this function with a null pointer is Undefined Behavior, even if the result of the function is unused
--> $DIR/invalid_null_args.rs:21:23
|
LL | let _: &[usize] = std::slice::from_raw_parts(ptr::null_mut(), 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------^^^^
| |
| null pointer originates from here
|
= help: for more information, visit <https://doc.rust-lang.org/std/ptr/index.html> and <https://doc.rust-lang.org/reference/behavior-considered-undefined.html>
```
### Explanation
Calling methods whose safety invariants requires non-null pointer with a null pointer is undefined behavior.
-----
The lint use a list of functions to know which functions and arguments to checks, this could be improved in the future with a rustc attribute, or maybe even with a `#[diagnostic]` attribute.
This PR also includes some small refactoring to avoid some ambiguities in naming, those can be done in another PR is desired.
`@rustbot` label: +I-lang-nominated
r? compiler
|
|
Remove attribute `#[rustc_error]`
It was an ancient way to write `check-pass` tests, but now it's no longer necessary (except for the `delayed_bug_from_inside_query` flavor, which is retained).
|
|
bootstrap: Avoid cloning `change-id` list
Inspired by [recent discussion](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Collecting.20some.20Real.20Configs.20for.20testing/near/507845657) on the bootstrap `change-id` field, I took a look at the code and found this little optimization. It does not change behavior.
|