Commit Graph

221519 Commits

Author SHA1 Message Date
Maybe Waffle
014c6f208e Use ptr::Alignment for extra coolness points 2023-04-14 12:31:49 +00:00
Maybe Waffle
36f5918bf1 Test CopyTaggedPtr's HashStable impl 2023-04-14 11:59:53 +00:00
Maybe Waffle
251f662e4d Share Tag2 impl between CopyTaggedPtr and TaggedPtr tests 2023-04-14 11:24:22 +00:00
Maybe Waffle
8d49e948a8 Doc fixes from review 2023-04-14 11:24:22 +00:00
Maybe Waffle
c155d5149f Implement Send/Sync for CopyTaggedPtr 2023-04-13 16:51:04 +00:00
Maybe Waffle
dc19dc29c9 doc fixes 2023-04-12 19:00:27 +00:00
Maybe Waffle
838c5491a4 Document tagged pointers better 2023-04-12 16:22:20 +00:00
Maybe Waffle
6f9b15c40c Add tests for tagged pointers 2023-04-12 16:20:34 +00:00
Maybe Waffle
5e4577ec65 Add TaggedPtr::set_tag 2023-04-12 12:35:43 +00:00
Maybe Waffle
6f64ae3fbc Move code around 2023-04-12 11:50:45 +00:00
Maybe Waffle
3df9a7bde3 Shorten COMPARE_PACKED => CP where it is not important
why can't I _ it :'(
2023-04-12 11:44:52 +00:00
Maybe Waffle
8f408202c3 Remove pointer_{ref,mut} from tagged pointers
Just use `deref{,_mut}`!
2023-04-12 11:41:41 +00:00
Maybe Waffle
c7c0b85f67 Make tagged pointers debug impls print the pointer
Does not really matter, but may be nicer in case
the pointer has some specific debug impl.
2023-04-12 11:30:45 +00:00
Maybe Waffle
c6acd5c92f Remove Pointer::with_ref in favour implementing it on tagged pointers directly 2023-04-12 11:26:34 +00:00
Maybe Waffle
9051331dd7 Lift Pointer's requirement for the pointer to be thin
fat pointers rule!
2023-04-12 11:00:35 +00:00
Maybe Waffle
26232f1ff5 Remove useless parameter from ghost 2023-04-12 10:34:29 +00:00
Maybe Waffle
ad92677008 Fix doc test 2023-04-11 21:45:19 +00:00
Maybe Waffle
12fd610e01 Refactor tagged ptr packing into a function 2023-04-11 21:40:39 +00:00
Maybe Waffle
3c6f4c1260 Bless tagged pointers (comply to strict provenance) 2023-04-11 21:31:23 +00:00
Maybe Waffle
f028636b1a Sprinkle some whitespace & uses 2023-04-11 19:33:33 +00:00
Maybe Waffle
c738dcc284 Add bits_for helper for tagged pointers & fixup docs 2023-04-11 19:18:59 +00:00
bors
d4be8efc62 Auto merge of #110137 - Dylan-DPC:rollup-fdruvwp, r=Dylan-DPC
Rollup of 6 pull requests

Successful merges:

 - #109724 (prioritize param env candidates if they don't guide type inference)
 - #110021 (Fix a couple ICEs in the new `CastKind::Transmute` code)
 - #110044 (Avoid some manual slice length calculation)
 - #110115 (compiletest: Use remap-path-prefix only in CI)
 - #110121 (Fix `x check --stage 1` when download-rustc is enabled)
 - #110124 (Some clippy fixes in the compiler)

Failed merges:

 - #109752 (Stall auto trait assembly in new solver for int/float vars)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-10 09:07:02 +00:00
Dylan DPC
97921abc06
Rollup merge of #110124 - Nilstrieb:📎-told-me-so, r=compiler-errors
Some clippy fixes in the compiler

Best reviewed commit-by-commit 📎.
2023-04-10 14:13:16 +05:30
Dylan DPC
6f2fd3e6a2
Rollup merge of #110121 - jyn514:check-stage1, r=ozkanonur
Fix `x check --stage 1` when download-rustc is enabled

Helps with https://github.com/rust-lang/rust/issues/81930
2023-04-10 14:13:15 +05:30
Dylan DPC
e327487bd8
Rollup merge of #110115 - jyn514:remap-path-prefix-ci, r=compiler-errors
compiletest: Use remap-path-prefix only in CI

This makes jump-to-definition work in most IDEs, as well as being easier to understand for contributors.

Fixes https://github.com/rust-lang/rust/issues/109725. cc `@TimNN`
2023-04-10 14:13:15 +05:30
Dylan DPC
b6633ffaf7
Rollup merge of #110044 - scottmcm:more-size-of-val, r=ChrisDenton
Avoid some manual slice length calculation

No need for us to write the multiplication when `size_of_val` does exactly what we need.

(https://github.com/rust-lang/rust-clippy/pull/10601)
2023-04-10 14:13:14 +05:30
Dylan DPC
b8725520af
Rollup merge of #110021 - scottmcm:fix-110005, r=compiler-errors
Fix a couple ICEs in the new `CastKind::Transmute` code

Check the sizes of the immediates, rather than the overall types, when deciding whether we can convert types without going through memory.

Fixes #110005
Fixes #109992
Fixes #110032
cc `@matthiaskrgr`
2023-04-10 14:13:14 +05:30
Dylan DPC
c30d7e97a8
Rollup merge of #109724 - lcnr:prioritize-env, r=compiler-errors
prioritize param env candidates if they don't guide type inference

intended to supersede #109579. We disable the prioritization during coherence to maintain completeness.

Long term we can hopefully replace this hack with adding OR to external constraints at which point the only relevant part when merging responses is whether they guide type inference in the same way.

Reuses `try_merge_responses` for assembly and the cleanest way to impl that was to actually split that so that `try_merge_responses` returns `None` if we fail to merge them and then add `flounder` which is used afterwards which is allowed to lower the certainty of our responses.

If, in the future, we add the ability to merge candidates `YES: ?0 = Vec<u32>` and `YES: ?0 = Vec<i32>` to `AMBIG: ?0 = Vec<?1>`, this should happen in `flounder`.

r? `@compiler-errors` `@BoxyUwU`
2023-04-10 14:13:13 +05:30
lcnr
3fab7f7c13 review + some small stuff 2023-04-10 09:21:21 +02:00
lcnr
2186847f28 move structural_traits into assembly 2023-04-10 09:18:47 +02:00
lcnr
2b0f5721c1 prioritize param-env candidates 2023-04-10 09:16:33 +02:00
bors
7f7e8fbc99 Auto merge of #110008 - klensy:deps-up-apr-06, r=Mark-Simulacrum
bump few deps

Update few deps to fix security vulns, future incompatibilities, duplicates.

`jemalloc-sys` v0.5.0+5.3.0 -> v0.5.3+5.3.0-patched: fixes future-incompatibilities by dropping fs_extra (https://github.com/rust-lang-ci/rust/actions/runs/4626595610/jobs/8183514150#step:26:19499, https://github.com/tikv/jemallocator/blob/tikv-jemalloc-sys-0.5.3/CHANGELOG.md)

`openssl-src` v111.22.0+1.1.1q -> v111.25.0+1.1.1t: fixes few vulns:
https://www.openssl.org/news/vulnerabilities-1.1.1.html
https://www.cve.org/CVERecord?id=CVE-2022-4304
https://www.cve.org/CVERecord?id=CVE-2022-4450
https://www.cve.org/CVERecord?id=CVE-2023-0215
https://www.cve.org/CVERecord?id=CVE-2023-0286
There exist newer openssl version 1.1.1u with low severity vulns, but no crate update yet

`openssl` crate with deps 0.10.38 ->0.10.49 fixes vulns (https://github.com/sfackler/rust-openssl/blob/openssl-v0.10.49/openssl/CHANGELOG.md)
https://rustsec.org/advisories/RUSTSEC-2023-0022
https://rustsec.org/advisories/RUSTSEC-2023-0023
https://rustsec.org/advisories/RUSTSEC-2023-0024

update `env_logger` for `rustbook` and `cargo_metadata` for `tidy` to newer versions (still used by `rustfmt`, `miri`)
2023-04-10 06:53:15 +00:00
bors
749b487be4 Auto merge of #109880 - ehuss:fix-macos-installer-rust-docs, r=Mark-Simulacrum
Fix macOS and Windows installers when rust-docs is not available.

This fixes the macOS `.pkg` and Windows `.msi` installers to work when rust-docs is not available. If the rust-docs component is not built, then the installer would fail. This adds the rust-docs component to the filtering mechanism so that the rust-docs line of the distribution definition aren't included.

I tested installing and uninstalling both with and without the rust-docs component available.

This happens on the aarch64-apple-darwin distribution provided by rust-lang since we currently disable the rust-docs component due to long build times. An alternate solution would be to just enable the rust-docs component on aarch64-apple-darwin since there are faster build systems.

Fixes #109877
2023-04-10 04:36:38 +00:00
bors
3c2e2dd5c5 Auto merge of #110127 - matthiaskrgr:rollup-6ui12x5, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #108843 (Instantiate instead of erasing binder when probing param methods)
 - #109985 (Add little `is_test_crate` function)
 - #110028 (Migrate `rustc_hir_analysis` to session diagnostic [Part 3])
 - #110095 (Migrate remainder of rustc_ty_utils to `SessionDiagnostic`)
 - #110108 (Add renaming of ignore-git to changelog)
 - #110114 (compiletest: Give a better error message if `node` isn't installed)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
2023-04-10 01:57:51 +00:00
Matthias Krüger
dd5942d77c
Rollup merge of #110114 - jyn514:wasm-errors, r=compiler-errors
compiletest: Give a better error message if `node` isn't installed
2023-04-09 23:40:06 +02:00
Matthias Krüger
7822064550
Rollup merge of #110108 - duckymirror:rename-ignore-git-changelog, r=ozkanonur
Add renaming of ignore-git to changelog

`bootstrap`'s `ignore-git` option has been renamed to `omit-git-hash` in #110059. This PR adds this change to the `CHANGELOG.md`. See also https://github.com/rust-lang/rust/issues/110020#issuecomment-1499599252.
2023-04-09 23:40:05 +02:00
Matthias Krüger
f4827459f8
Rollup merge of #110095 - matthewjasper:ty-utils-diagnostics, r=compiler-errors
Migrate remainder of rustc_ty_utils to `SessionDiagnostic`

This moves the remaining errors in `rust_ty_utils` to `SessionsDiagnostic`.

r? ``@davidtwco``
2023-04-09 23:40:05 +02:00
Matthias Krüger
164d70dc7a
Rollup merge of #110028 - obeis:hir-analysis-migrate-diagnostics-3, r=compiler-errors
Migrate `rustc_hir_analysis` to session diagnostic [Part 3]

Part 3: Finishing `collect.rs` file

r? ``@compiler-errors``
2023-04-09 23:40:04 +02:00
Matthias Krüger
3dfda2c72f
Rollup merge of #109985 - blyxyas:is_test_crate, r=compiler-errors
Add little `is_test_crate` function

Ok, this is quite a story.
I'm mainly a Clippy contributor, so I was fixing [this Clippy issue](https://github.com/rust-lang/rust-clippy/pull/10584) about a lint having to ignore test modules but that wasn't ignoring test files (integration test, `test/` dirs and such).

As test **files** don't tend to have an inner `#[cfg(test)]` module inside them, I tried everything, looking for filenames, looking for item's parents in the HIR Map, doing black magic...

I even asked [on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/.E2.9C.94.20Checking.20if.20file.20is.20integration.20test), and jyn answered something about `--cfg test`. Aha! That's something that I might be looking for, so I started looking at `rustc_driver_impl` flag parsing and configuration and all that.

Then, I stumbled on [this function right here](2e486be8d2/compiler/rustc_driver_impl/src/lib.rs (L174-L181)), and noticed the argument `config: Config`. That's a hint.

So [Config](https://doc.rust-lang.org/beta/nightly-rustc/rustc_interface/interface/struct.Config.html) has the field `opts: Options`, and [`Options`](https://doc.rust-lang.org/beta/nightly-rustc/rustc_session/options/struct.Options.html) has the field `test`.

This journey has been ~7 or 8 hours in 3 days, it's a very hard thing to find, so this PR adds a mini-function to check if the current crate is a testing one. So that no one has to travel through the same as me, and can just search for `is_test_crate` in the documentation.
2023-04-09 23:40:04 +02:00
Matthias Krüger
4e165c1c99
Rollup merge of #108843 - compiler-errors:non_lifetime_binders-method-probe, r=jackh726
Instantiate instead of erasing binder when probing param methods

Fixes #108836

There is a really old comment saying that a `WhereClauseCandidate` probe candidate "should not contain any inference variables", but I'm not really confident that that comment applies anymore. In contrast, other candidates that we assemble during method probe contain inference variables in their substitutions (e.g. `InherentImplCandidate`)...

Since this change is made only to support a nightly feature, I'm happy to gate the new behavior behind this feature flag or discuss it further.

r? types
2023-04-09 23:40:03 +02:00
Nilstrieb
9fc1555f74 Remove turbofish 2023-04-09 23:32:04 +02:00
Nilstrieb
73417b1e15
Inline format_args
Co-authored-by: Michael Goulet <michael@errs.io>
2023-04-09 23:29:39 +02:00
Nilstrieb
cab94d29ff fixup! Improve `Allocation::hash 2023-04-09 23:23:33 +02:00
Nilstrieb
5853c28a7f Simply Abi::fmt 2023-04-09 23:22:14 +02:00
Nilstrieb
e5defd0102 Convert manual loop into while let 2023-04-09 23:22:14 +02:00
Nilstrieb
4b4948c2e3 Remove identity casts 2023-04-09 23:22:14 +02:00
Nilstrieb
81c320ea77 Fix some clippy::complexity 2023-04-09 23:22:14 +02:00
Nilstrieb
6fceb0f645 Improve `Allocation::hash
Exhaustively destructure and ignore `()`
2023-04-09 23:22:14 +02:00
Nilstrieb
5a90de8f5e Delete useless loop 2023-04-09 23:22:14 +02:00
Nilstrieb
1c75724752 Properly compare previously shadowed values
The shadowing lead to an incorrect comparison. Rename it and compare it
properly. compiler-errors told me that I should just include the fix
here without a test.
2023-04-09 23:22:14 +02:00