| Age | Commit message (Collapse) | Author | Lines |
|
Fix typos
This PR fixes typos errors in comments and docs.
Thank you very much.
|
|
Print how to rebless Python formatting in tidy
Suggested [here](https://github.com/rust-lang/rust/pull/134964#discussion_r1900124882).
r? ``@Noratrieb``
|
|
|
|
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
|
|
|
|
|
|
Migrate `libs-through-symlink` to rmake.rs
Part of https://github.com/rust-lang/rust/issues/121876.
This PR migrates `tests/run-make/libs-through-symlink/` to use rmake.rs.
- Regression test for #13890.
- Original fix PR is #13903.
- Document test intent, backlink to #13890 and fix PR #13903.
- Fix the test logic: the `Makefile` version seems to not actually be exercising the "library search traverses symlink" logic, because the actual symlinked-to-library is present under the `$(TMPDIR)` directory tree when `bar.rs` is compiled, because the `$(RUSTC)` invocation has an implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e. it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it used `ln -nsf outdir/$(NAME) $(TMPDIR)`. The rmake.rs version now explicitly separates the two directory trees and sets the CWD of the `bar.rs` rustc invocation so that the actual library is *not* present under its CWD tree.
I.e. it is now
```
$test_output/ # rustc foo.rs -o actual_lib_dir/libfoo.rlib
actual_lib_dir/
libfoo.rlib
symlink_lib_dir/ # CWD set; rustc -L . bar.rs
libfoo.rlib --> $test_output/actual_lib_dir/libfoo.rlib
```
Partially supersedes #129011.
This PR is co-authored with `@Oneirical.`
r? compiler
|
|
- The Makefile version *never* ran because of Makefile syntax confusion.
- The test would've always failed because precompiled std is not built
with `-Z cf-protection=branch`, but linkers require all input object
files to indicate IBT support in order to enable IBT for the
executable, which is not the case for std.
- Thus, the test input file is instead changed to a `no_std` + `no_core`
program.
Co-authored-by: Jerry Wang <jerrylwang123@gmail.com>
Co-authored-by: Oneirical <manchot@videotron.ca>
|
|
- Document test intent, backlink to #13890 and fix PR #13903.
- Fix the test logic: the `Makefile` version seems to not actually be
exercising the "library search traverses symlink" logic, because the
actual symlinked-to-library is present under the directory tree when
`bar.rs` is compiled, because the `$(RUSTC)` invocation has an
implicit `-L $(TMPDIR)`. The symlink itself was actually broken, i.e.
it should've been `ln -nsf $(TMPDIR)/outdir/$(NAME) $(TMPDIR)` but it
used `ln -nsf outdir/$(NAME) $(TMPDIR)`.
Co-authored-by: Oneirical <manchot@videotron.ca>
|
|
|
|
The Makefile version seems to contain a bug. Over the years, the
directory structure of the `rust-src` component changed as the source
tree directory structure changed. `libstd` is no longer a thing directly
under `root/lib/rustlib/src/rust/src/`, it is moved to
`root/lib/rustlib/src/rust/library/std`.
Co-authored-by: Oneirical <manchot@videotron.ca>
|
|
Add licenses + Run `cargo update`
Replaces #131311
try-job: dist-x86_64-linux
License changes:
- `unicode_ident` 1.0.14 introduces `(MIT OR Apache-2.0) AND Unicode-3.0`, but `unicode_ident` 1.0.12 (`(MIT OR Apache-2.0) AND Unicode-DFS-2016`) is still in tree
- `instant` and its license exception are no longer used
```
compiler & tools dependencies:
Updating allocator-api2 v0.2.18 -> v0.2.20
Updating anyhow v1.0.92 -> v1.0.93
Removing bitflags v1.3.2
Updating blake3 v1.5.4 -> v1.5.5
Updating bstr v1.10.0 -> v1.11.0
Updating bytes v1.8.0 -> v1.9.0
Updating cargo-platform v0.1.8 -> v0.1.9
Updating cc v1.2.0 -> v1.2.2
Updating clap v4.5.20 -> v4.5.21
Updating clap_builder v4.5.20 -> v4.5.21
Updating clap_complete v4.5.36 -> v4.5.38
Updating clap_lex v0.7.2 -> v0.7.3
Updating color-print v0.3.6 -> v0.3.7
Updating color-print-proc-macro v0.3.6 -> v0.3.7
Updating cpufeatures v0.2.14 -> v0.2.16
Updating curl-sys v0.4.77+curl-8.10.1 -> v0.4.78+curl-8.11.0
Updating errno v0.3.9 -> v0.3.10
Updating fastrand v2.1.1 -> v2.2.0
Updating flate2 v1.0.34 -> v1.0.35
Updating handlebars v5.1.2 -> v6.2.0
Adding icu_collections v1.5.0
Adding icu_normalizer v1.5.0
Adding icu_normalizer_data v1.5.0
Adding icu_properties v1.5.1
Adding icu_properties_data v1.5.0
Updating idna v0.5.0 -> v1.0.3
Adding idna_adapter v1.2.0
Updating indexmap v2.6.0 -> v2.7.0
Updating indicatif v0.17.8 -> v0.17.9
Removing instant v0.1.13
Updating itoa v1.0.11 -> v1.0.14
Updating js-sys v0.3.72 -> v0.3.74
Updating libc v0.2.164 -> v0.2.167
Updating libloading v0.8.5 -> v0.8.6
Updating litemap v0.7.3 -> v0.7.4
Updating mdbook v0.4.40 -> v0.4.43
Adding num-modular v0.6.1
Adding num-order v1.2.0
Updating pathdiff v0.2.2 -> v0.2.3
Updating portable-atomic v1.9.0 -> v1.10.0
Updating proc-macro2 v1.0.89 -> v1.0.92
Updating regex-automata v0.4.8 -> v0.4.9
Updating rustc-hash v2.0.0 -> v2.1.0
Updating rustc_apfloat v0.2.1+llvm-462a31f5a5ab -> v0.2.2+llvm-462a31f5a5ab
Updating rustix v0.38.38 -> v0.38.41
Updating schannel v0.1.26 -> v0.1.27
Updating serde v1.0.214 -> v1.0.215
Updating serde_derive v1.0.214 -> v1.0.215
Updating serde_json v1.0.132 -> v1.0.133
Updating socket2 v0.5.7 -> v0.5.8
Updating spdx v0.10.6 -> v0.10.7
Updating syn v2.0.87 -> v2.0.90
Updating tempfile v3.13.0 -> v3.14.0
Updating terminal_size v0.4.0 -> v0.4.1
Updating thiserror v1.0.66 -> v1.0.69 (available: v2.0.3)
Updating thiserror-impl v1.0.66 -> v1.0.69
Updating tokio v1.41.0 -> v1.41.1
Updating tracing-attributes v0.1.27 -> v0.1.28
Updating tracing-error v0.2.0 -> v0.2.1
Removing unicode-bidi v0.3.17
Updating unicode-ident v1.0.13 -> v1.0.14
Updating url v2.5.2 -> v2.5.4
Adding utf16_iter v1.0.5
Adding utf8_iter v1.0.4
Updating wasm-bindgen v0.2.95 -> v0.2.97
Updating wasm-bindgen-backend v0.2.95 -> v0.2.97
Updating wasm-bindgen-macro v0.2.95 -> v0.2.97
Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97
Updating wasm-bindgen-shared v0.2.95 -> v0.2.97
Updating wasm-encoder v0.220.0 -> v0.221.0
Adding wasmparser v0.221.0
Updating wast v219.0.1 -> v221.0.0
Updating wat v1.219.1 -> v1.221.0
Adding web-time v1.1.0
Adding write16 v1.0.0
Updating yoke v0.7.4 -> v0.7.5
Updating yoke-derive v0.7.4 -> v0.7.5
Updating zerofrom v0.1.4 -> v0.1.5
Updating zerofrom-derive v0.1.4 -> v0.1.5
library dependencies:
Updating allocator-api2 v0.2.18 -> v0.2.20
Updating cc v1.2.0 -> v1.2.2
Updating libc v0.2.162 -> v0.2.164
Updating unwinding v0.2.3 -> v0.2.4
rustbook dependencies:
Updating anstream v0.6.17 -> v0.6.18
Updating anyhow v1.0.92 -> v1.0.93
Updating bstr v1.10.0 -> v1.11.0
Updating cc v1.2.0 -> v1.2.2
Updating clap v4.5.20 -> v4.5.21
Updating clap_builder v4.5.20 -> v4.5.21
Updating clap_complete v4.5.36 -> v4.5.38
Updating clap_lex v0.7.2 -> v0.7.3
Updating cpufeatures v0.2.14 -> v0.2.16
Adding displaydoc v0.2.5
Updating errno v0.3.9 -> v0.3.10
Updating fastrand v2.1.1 -> v2.2.0
Updating flate2 v1.0.34 -> v1.0.35
Updating hashbrown v0.15.0 -> v0.15.2
Adding icu_collections v1.5.0
Adding icu_locid v1.5.0
Adding icu_locid_transform v1.5.0
Adding icu_locid_transform_data v1.5.0
Adding icu_normalizer v1.5.0
Adding icu_normalizer_data v1.5.0
Adding icu_properties v1.5.1
Adding icu_properties_data v1.5.0
Adding icu_provider v1.5.0
Adding icu_provider_macros v1.5.0
Updating idna v0.5.0 -> v1.0.3
Adding idna_adapter v1.2.0
Updating indexmap v2.6.0 -> v2.7.0
Updating itoa v1.0.11 -> v1.0.14
Updating js-sys v0.3.72 -> v0.3.74
Updating libc v0.2.161 -> v0.2.167
Adding litemap v0.7.4
Updating mdbook v0.4.42 -> v0.4.43
Updating pathdiff v0.2.2 -> v0.2.3
Updating proc-macro2 v1.0.89 -> v1.0.92
Updating regex-automata v0.4.8 -> v0.4.9
Updating rustix v0.38.38 -> v0.38.41
Updating serde v1.0.214 -> v1.0.215
Updating serde_derive v1.0.214 -> v1.0.215
Updating serde_json v1.0.132 -> v1.0.133
Adding stable_deref_trait v1.2.0
Updating syn v2.0.87 -> v2.0.90
Adding synstructure v0.13.1
Updating tempfile v3.13.0 -> v3.14.0
Updating terminal_size v0.4.0 -> v0.4.1
Updating thiserror v1.0.66 -> v1.0.69
Updating thiserror-impl v1.0.66 -> v1.0.69
Adding tinystr v0.7.6
Removing tinyvec v1.8.0
Removing tinyvec_macros v0.1.1
Removing unicode-bidi v0.3.17
Updating unicode-ident v1.0.13 -> v1.0.14
Removing unicode-normalization v0.1.24
Updating url v2.5.2 -> v2.5.4
Adding utf16_iter v1.0.5
Adding utf8_iter v1.0.4
Updating wasm-bindgen v0.2.95 -> v0.2.97
Updating wasm-bindgen-backend v0.2.95 -> v0.2.97
Updating wasm-bindgen-macro v0.2.95 -> v0.2.97
Updating wasm-bindgen-macro-support v0.2.95 -> v0.2.97
Updating wasm-bindgen-shared v0.2.95 -> v0.2.97
Adding write16 v1.0.0
Adding writeable v0.5.5
Adding yoke v0.7.5
Adding yoke-derive v0.7.5
Adding zerofrom v0.1.5
Adding zerofrom-derive v0.1.5
Adding zerovec v0.10.4
Adding zerovec-derive v0.10.3
```
|
|
Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs`
Tests for the closely-related `-l` flag and `#[link(..)]` attribute are spread across a few different directories, and in some cases have ended up in a test directory intended for other linker-related functionality.
This PR moves most of them into a single `tests/ui/link-native-libs` directory.
---
Part of #133895.
try-job: i686-mingw
r? jieyouxu
|
|
|
|
|
|
Cranelift being disabled
|
|
Replace black with ruff in `tidy`
`ruff` can both lint and format Python code (in fact, it should be a mostly drop-in replacement for `black` in terms of formatting), so it's not needed to use `black` anymore. This PR removes `black` and replaces it with `ruff`, to get rid of one Python dependency, and also to make Python formatting faster (although that's a small thing).
If we decide to merge this, we'll need to "reformat the world" - `ruff` is not perfectly compatible with `black`, and it also looks like `black` was actually ignoring some files before. I tried it locally (`./x test tidy --extra-checks=py:fmt --bless`) and it also reformatted some code in subtrees (e.g. `clippy` or `rustc_codegen_gcc`) - I'm not sure how to handle that.
|
|
Revert #133817
This reverts commit 0585134e709de4a14e509158662fa569c155c195, reversing changes made to 5530869e0ff21d69e0eef1a4c4fd1f25bcbe7fbf.
#133817 unfortunately only converted the `println!` instances to `eprintln!`, meaning that some test output (via compiletest/bootstrap) was messed up because stdout/stderr output interleaved improperly when some `println!` instances were converted to `eprintln!` instances, while some `print!` instances remain unchanged. This made reading test output annoying for contributors cc #133879.
Closes #133879 by reverting.
#133817 can be relanded in the future when `print!` instances are also matched with `println!` instances.
cc `@clubby789`
This is a clean revert so I'm going to self-approve this PR.
|
|
Add context to "const in pattern" errors
*Each commit addresses specific diagnostics.*
- Add primary span labels
- Point at `const` item, and `const` generic param definition
- Reword messages and notes
- Point at generic param through which an associated `const` is being referenced
- Silence const in pattern with evaluation errors when they come from `const` items that already emit a diagnostic
- On non-structural type in const used as pattern, point at the type that should derive `PartialEq`
|
|
This reverts commit 0585134e709de4a14e509158662fa569c155c195, reversing
changes made to 5530869e0ff21d69e0eef1a4c4fd1f25bcbe7fbf.
The PR unfortunately only converted the `ln!` instances, meaning that
test output was messed up because stdout/stderr output interleaved when
some `println!` instances were converted to `eprintln!` instances, while
some `println!` instances remain unchanged.
|
|
|
|
Conform to error style guide.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Revert "tidy: validate LLVM component names in tests"
This reverts #125472.
This has already caused a [bit](https://github.com/rust-lang/rust/pull/125702) of [trouble](https://github.com/rust-lang/rust/pull/125710), and I was mistaken about the original motivation--incorrect component names [_will_](https://github.com/rust-lang/rust/pull/125702#issuecomment-2137030731) be detected by a full CI run.
I no longer think it pulls its weight.
r? `@workingjubilee`
|
|
contain files that do not have a "known-bug" directive
Fixes #133009
|
|
Add licenses + run `cargo update`
Replaces #131311
```
compiler & tools dependencies:
Locking 86 packages to latest compatible versions
Updating anstream v0.6.15 -> v0.6.17
Updating anstyle v1.0.8 -> v1.0.10
Updating anstyle-lossy v1.1.2 -> v1.1.3
Updating anstyle-parse v0.2.5 -> v0.2.6
Updating anstyle-query v1.1.1 -> v1.1.2
Updating anstyle-svg v0.1.5 -> v0.1.7
Updating anstyle-wincon v3.0.4 -> v3.0.6
Updating anyhow v1.0.89 -> v1.0.92
Updating arrayref v0.3.7 -> v0.3.9
Updating blake3 v1.5.2 -> v1.5.4
Updating bytes v1.7.2 -> v1.8.0
Updating cc v1.1.23 -> v1.1.34
Updating clap v4.5.18 -> v4.5.20
Updating clap_builder v4.5.18 -> v4.5.20
Updating clap_complete v4.5.29 -> v4.5.36
Updating colorchoice v1.0.2 -> v1.0.3
Updating constant_time_eq v0.3.0 -> v0.3.1
Updating curl v0.4.46 -> v0.4.47
Updating curl-sys v0.4.76+curl-8.10.1 -> v0.4.77+curl-8.10.1
Updating derive_builder v0.20.1 -> v0.20.2
Updating derive_builder_core v0.20.1 -> v0.20.2
Updating derive_builder_macro v0.20.1 -> v0.20.2
Adding foldhash v0.1.3
Updating futures v0.3.30 -> v0.3.31
Updating futures-channel v0.3.30 -> v0.3.31
Updating futures-core v0.3.30 -> v0.3.31
Updating futures-executor v0.3.30 -> v0.3.31
Updating futures-io v0.3.30 -> v0.3.31
Updating futures-macro v0.3.30 -> v0.3.31
Updating futures-sink v0.3.30 -> v0.3.31
Updating futures-task v0.3.30 -> v0.3.31
Updating futures-util v0.3.30 -> v0.3.31
Updating gimli v0.31.0 -> v0.31.1
Adding hashbrown v0.15.0
Updating indexmap v2.5.0 -> v2.6.0
Updating js-sys v0.3.70 -> v0.3.72
Updating libc v0.2.159 -> v0.2.161
Updating libm v0.2.8 -> v0.2.11
Updating object v0.36.4 -> v0.36.5
Updating once_cell v1.19.0 -> v1.20.2
Removing once_map v0.4.19
Updating openssl-sys v0.9.103 -> v0.9.104
Updating pathdiff v0.2.1 -> v0.2.2
Updating pest v2.7.13 -> v2.7.14
Updating pest_derive v2.7.13 -> v2.7.14
Updating pest_generator v2.7.13 -> v2.7.14
Updating pest_meta v2.7.13 -> v2.7.14
Updating pin-project-lite v0.2.14 -> v0.2.15
Updating proc-macro2 v1.0.86 -> v1.0.89
Updating redox_syscall v0.5.6 -> v0.5.7
Updating regex v1.10.6 -> v1.11.1
Updating regex-automata v0.4.7 -> v0.4.8
Updating regex-syntax v0.8.4 -> v0.8.5
Updating rinja v0.3.4 -> v0.3.5
Updating rinja_derive v0.3.4 -> v0.3.5
Updating rinja_parser v0.3.4 -> v0.3.5
Updating rustix v0.38.37 -> v0.38.38
Updating rustversion v1.0.17 -> v1.0.18
Updating schannel v0.1.24 -> v0.1.26
Updating serde v1.0.210 -> v1.0.214
Updating serde_derive v1.0.210 -> v1.0.214
Updating serde_json v1.0.128 -> v1.0.132
Updating syn v2.0.79 -> v2.0.87
Updating tar v0.4.42 -> v0.4.43
Updating terminal_size v0.3.0 -> v0.4.0
Updating thiserror v1.0.64 -> v1.0.66
Updating thiserror-impl v1.0.64 -> v1.0.66
Updating tokio v1.40.0 -> v1.41.0
Updating ucd-trie v0.1.6 -> v0.1.7
Updating unicase v2.7.0 -> v2.8.0
Updating unicode-bidi v0.3.15 -> v0.3.17
Updating unicode-properties v0.1.2 -> v0.1.3
Updating uuid v1.10.0 -> v1.11.0
Updating wasi-preview1-component-adapter-provider v24.0.0 -> v24.0.1 (latest: v25.0.1)
Updating wasm-bindgen v0.2.93 -> v0.2.95
Updating wasm-bindgen-backend v0.2.93 -> v0.2.95
Updating wasm-bindgen-macro v0.2.93 -> v0.2.95
Updating wasm-bindgen-macro-support v0.2.93 -> v0.2.95
Updating wasm-bindgen-shared v0.2.93 -> v0.2.95
Updating wasm-encoder v0.219.0 -> v0.219.1
Updating wasm-metadata v0.219.0 -> v0.219.1
Removing wasmparser v0.219.0
Adding wasmparser v0.218.0 (latest: v0.219.1)
Adding wasmparser v0.219.1
Updating wast v219.0.0 -> v219.0.1
Updating wat v1.219.0 -> v1.219.1
Updating wit-component v0.219.0 -> v0.219.1
Updating wit-parser v0.219.0 -> v0.219.1
library dependencies:
Locking 5 packages to latest compatible versions
Updating compiler_builtins v0.1.136 -> v0.1.138
Updating dlmalloc v0.2.6 -> v0.2.7
Updating object v0.36.4 -> v0.36.5
Updating windows-sys v0.52.0 -> v0.59.0
rustbook dependencies:
Updating anstream v0.6.15 -> v0.6.17
Updating anstyle v1.0.8 -> v1.0.10
Updating anstyle-parse v0.2.5 -> v0.2.6
Updating anstyle-query v1.1.1 -> v1.1.2
Updating anstyle-wincon v3.0.4 -> v3.0.6
Updating anyhow v1.0.89 -> v1.0.92
Updating cc v1.1.22 -> v1.1.34
Updating clap v4.5.18 -> v4.5.20
Updating clap_builder v4.5.18 -> v4.5.20
Updating clap_complete v4.5.29 -> v4.5.36
Updating colorchoice v1.0.2 -> v1.0.3
Updating hashbrown v0.14.5 -> v0.15.0
Updating indexmap v2.5.0 -> v2.6.0
Updating js-sys v0.3.70 -> v0.3.72
Updating libc v0.2.159 -> v0.2.161
Updating once_cell v1.19.0 -> v1.20.2
Updating pathdiff v0.2.1 -> v0.2.2
Updating pest v2.7.13 -> v2.7.14
Updating pest_derive v2.7.13 -> v2.7.14
Updating pest_generator v2.7.13 -> v2.7.14
Updating pest_meta v2.7.13 -> v2.7.14
Updating proc-macro2 v1.0.86 -> v1.0.89
Updating redox_syscall v0.5.6 -> v0.5.7
Updating regex v1.10.6 -> v1.11.1
Updating regex-automata v0.4.7 -> v0.4.8
Updating regex-syntax v0.8.4 -> v0.8.5
Updating rustix v0.38.37 -> v0.38.38
Updating serde v1.0.210 -> v1.0.214
Updating serde_derive v1.0.210 -> v1.0.214
Updating serde_json v1.0.128 -> v1.0.132
Updating syn v2.0.79 -> v2.0.87
Updating terminal_size v0.3.0 -> v0.4.0
Updating thiserror v1.0.64 -> v1.0.66
Updating thiserror-impl v1.0.64 -> v1.0.66
Updating ucd-trie v0.1.6 -> v0.1.7
Updating unicase v2.7.0 -> v2.8.0
Updating unicode-bidi v0.3.15 -> v0.3.17
Updating wasm-bindgen v0.2.93 -> v0.2.95
Updating wasm-bindgen-backend v0.2.93 -> v0.2.95
Updating wasm-bindgen-macro v0.2.93 -> v0.2.95
Updating wasm-bindgen-macro-support v0.2.93 -> v0.2.95
Updating wasm-bindgen-shared v0.2.93 -> v0.2.95
Removing windows-sys v0.48.0
Removing windows-targets v0.48.5
Removing windows_aarch64_gnullvm v0.48.5
Removing windows_aarch64_msvc v0.48.5
Removing windows_i686_gnu v0.48.5
Removing windows_i686_msvc v0.48.5
Removing windows_x86_64_gnu v0.48.5
Removing windows_x86_64_gnullvm v0.48.5
Removing windows_x86_64_msvc v0.48.5
```
|
|
|
|
Signed-off-by: onur-ozkan <work@onurozkan.dev>
|
|
ismailarilik:chore/style/sync-submodule-exclusion-list-between-tidy-and-rustfmt, r=jieyouxu
chore(style): sync submodule exclusion list between tidy and rustfmt
As asked in the FIXME comments
|
|
|
|
|
|
As asked in the FIXME comments
|
|
Remove support for decompressing dylib metadata
We haven't been compressing dylib metadata for a while now. Removing decompression support will regress error messages about an incompatible rustc version being used, but dylibs are pretty rare anyway.
Fixes https://github.com/rust-lang/rust-analyzer/issues/18451
|
|
Update compiler-builtins to 0.1.136
This includes:
* The license change https://github.com/rust-lang/compiler-builtins/pull/717
* The `libm` submodule update, which also has a license change https://github.com/rust-lang/libm/pull/317
* Re-enabling `math` on i686 UEFI https://github.com/rust-lang/compiler-builtins/pull/715
Fixes: https://github.com/rust-lang/rust/issues/128533
|
|
|
|
We haven't been compressing dylib metadata for a while now. Removing
decompression support will regress error messages about an incompatible
rustc version being used, but dylibs are pretty rare anyway.
|
|
The RFC for arbitrary self types v2 declares that we should reject
"generic" self types. This commit does so.
The definition of "generic" was unclear in the RFC, but has been
explored in
https://github.com/rust-lang/rust/issues/129147
and the conclusion is that "generic" means any `self` type which
is a type parameter defined on the method itself, or references
to such a type.
This approach was chosen because other definitions of "generic"
don't work. Specifically,
* we can't filter out generic type _arguments_, because that would
filter out Rc<Self> and all the other types of smart pointer
we want to support;
* we can't filter out all type params, because Self itself is a
type param, and because existing Rust code depends on other
type params declared on the type (as opposed to the method).
This PR decides to make a new error code for this case, instead of
reusing the existing E0307 error. This makes the code a
bit more complex, but it seems we have an opportunity to provide
specific diagnostics for this case so we should do so.
This PR filters out generic self types whether or not the
'arbitrary self types' feature is enabled. However, it's believed
that it can't have any effect on code which uses stable Rust, since
there are no stable traits which can be used to indicate a valid
generic receiver type, and thus it would have been impossible to
write code which could trigger this new error case.
It is however possible that this could break existing code which
uses either of the unstable `arbitrary_self_types` or
`receiver_trait` features. This breakage is intentional; as
we move arbitrary self types towards stabilization we don't want
to continue to support generic such types.
This PR adds lots of extra tests to arbitrary-self-from-method-substs.
Most of these are ways to trigger a "type mismatch" error which
https://github.com/rust-lang/rust/blob/9b82580c7347f800c2550e6719e4218a60a80b28/compiler/rustc_hir_typeck/src/method/confirm.rs#L519
hopes can be minimized by filtering out generics in this way.
We remove a FIXME from confirm.rs suggesting that we make this change.
It's still possible to cause type mismatch errors, and a subsequent
PR may be able to improve diagnostics in this area, but it's harder
to cause these errors without contrived uses of the turbofish.
This is a part of the arbitrary self types v2 project,
https://github.com/rust-lang/rfcs/pull/3519
https://github.com/rust-lang/rust/issues/44874
r? @wesleywiser
|
|
This includes:
* The license change
https://github.com/rust-lang/compiler-builtins/pull/717
* The `libm` submodule update, which also has a license change
https://github.com/rust-lang/libm/pull/317
* Re-enabling `math` on i686 UEFI
https://github.com/rust-lang/compiler-builtins/pull/715
|
|
Co-authored-by: Oneirical <manchot@videotron.ca>
|
|
|
|
Update rustc-hash to version 2 but again
it's like #129533 but not closed by bors and rebased
r? WaffleLapkin meow
|
|
This brings in the new algorithm.
|