about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-11-06Only check predicates for late-bound non-lifetime vars in object candidate ↵Michael Goulet-1/+23
assembly
2023-11-06Auto merge of #117292 - estebank:issue-80446, r=davidtwcobors-0/+71
Detect misparsed binop caused by missing semi When encountering ```rust foo() *bar = baz; ``` We currently emit potentially two errors, one for the return type of `foo` not being multiplicative by the type of `bar`, and another for `foo() * bar` not being assignable. We now check for this case and suggest adding a semicolon in the right place and emit only a single error. Fix #80446.
2023-11-06Silence redundant error on typo resulting on binopEsteban Küber-33/+27
2023-11-06Auto merge of #117603 - HKalbasi:make-feature-additive, r=Nilstriebbors-9/+7
Make the randomize feature of rustc_abi additive The goal here is to make rust-analyzer able to build with the `rustc_private` versions of the rustc crates it depends on. See #116847
2023-11-06Auto merge of #116988 - RalfJung:null, r=WaffleLapkinbors-0/+10
document that the null pointer has the 0 address Fixes https://github.com/rust-lang/rust/issues/116895 Will need t-lang FCP, but I think this is fairly uncontroversial -- there's probably already tons of code out there that relies on this.
2023-11-06Auto merge of #117630 - matthiaskrgr:rollup-v0d5p3f, r=matthiaskrgrbors-26/+25
Rollup of 3 pull requests Successful merges: - #117592 (Use the correct span when emitting the `env!` result) - #117613 (Remove from vacation and compiler review group) - #117615 (Couple of small changes) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-06Rollup merge of #117615 - bjorn3:misc_changes, r=davidtwcoMatthias Krüger-22/+22
Couple of small changes These are unrelated to each other, but they are each small enough that opening separate PR's doesn't make sense to me either. * Remove a place where the parse driver query is stolen. * Update an outdated doc comment * Use correct crate name in `-Zprint-vtable-sizes` when using `#![crate_name = "..."]`.
2023-11-06Rollup merge of #117613 - jackh726:vacation, r=compiler-errorsMatthias Krüger-3/+2
Remove from vacation and compiler review group Staying on the types review rotation, but staying off the general review queue is good for me right now. Also move ``@compiler-errors`` since he's a full member now.
2023-11-06Rollup merge of #117592 - thomcc:env-span-wrong, r=davidtwcoMatthias Krüger-1/+1
Use the correct span when emitting the `env!` result The span used for the `env!` resut changed in 1.73, due to https://github.com/rust-lang/rust/commit/75df62d4a2c45175b8cb1eb4bdc10fa423c11c4c (from https://github.com/rust-lang/rust/pull/114014). This prevents [a lint in `plrustc`](https://github.com/tcdi/plrust/blob/main/plrustc/plrustc/src/lints/builtin_macros.rs#L54-L60)[^1] from working well, because the resulting span is not inside the region where the lint is `#[deny()]`ed. [^1]: Perhaps worth noting that the `env_macro` diagnostic item comes from [the std fork used with PL/Rust](https://github.com/tcdi/postgrestd/blob/rust-1.73.0/library/core/src/macros/mod.rs#L944). Unfortunately, I have no idea how to write a test for this since I don't think we can have a custom lint in a test. A suggestion was made to use a custom proc macro for it, but that seems pretty involved (frankly, I might not have time to do it). r? ``@davidtwco`` (since they're the author of the PR with the regression) P.S. We generally try to avoid bothering upstream about PL/Rust-specific stuff (we don't want to nag), but this seems like an actual bug, since the other similar macros, such as `option_env` use the other span (and are lintable as a result).
2023-11-06Auto merge of #117578 - compiler-errors:derive-encode-in-rustc_type_ir, ↵bors-486/+31
r=davidtwco Derive `TyEncodable`/`TyDecodable` in `rustc_type_ir` when `derive(TyEncodable)` or `derive(TyDecodable)` sees an `I` type parameter on a struct that has no `'tcx`, then parameterize the `TyEncoder`/`TyDecoder`'s interner over that variable rather than `TyCtxt<'tcx>`. Also, emit where clauses for fields rather than generics.
2023-11-06Auto merge of #117435 - SparrowLii:nightly_parallel, r=oli-obk,davidtwcobors-13/+41
enable parallel rustc front end in nightly builds Refers to the [MCP](https://github.com/rust-lang/compiler-team/issues/681), this pr does: 1. Enable the parallel front end in nightly builds, and keep the default number of threads as 1. Then users can use the parallel rustc front end via -Z threads=n option. 2. Set it up to serial front end for beta/stable builds via bootstrap. 3. Switch over the alt builders from parallel rustc to serial, so we have artifacts without parallel to test against the artifacts with parallel. r? `@oli-obk` cc `@cjgillot` `@nnethercote` `@bjorn3` `@Kobzol`
2023-11-06Auto merge of #117607 - klensy:clang-17.0.4, r=Mark-Simulacrumbors-1/+1
bump clang version for dist-x86_64-linux from 17.0.2 to 17.0.4 This fixes few miscompiles, so nice to have. Release notes: https://discourse.llvm.org/t/llvm-17-0-3-released/74172 https://discourse.llvm.org/t/llvm-17-0-4-released/74548 >The next release will be 17.0.5, in two weeks 14th of November. Or maybe delay until 17.0.5?
2023-11-06Auto merge of #117585 - dnbln:feat/move-kw-span, r=cjgillotbors-20/+49
Add the `Span` of the `move` keyword to the HIR. This is required to implement a lint like the one described here: https://github.com/rust-lang/rust-clippy/issues/11721
2023-11-06use portable AtomicU64 for powerPC and MIPSSparrowLii-4/+28
2023-11-06Auto merge of #117576 - the8472:fix-io-copy-vec, r=Mark-Simulacrumbors-22/+54
Fix excessive initialization and reads beyond EOF in `io::copy(_, Vec<u8>)` specialization fixes #117545 and https://github.com/bczhc/bzip3-rs/pull/8
2023-11-05Auto merge of #96979 - SabrinaJewson:waker-update, r=workingjubileebors-1/+14
Override `Waker::clone_from` to avoid cloning `Waker`s unnecessarily This would be very useful for futures — I think it’s pretty much always what they want to do instead of `*waker = cx.waker().clone()`. Tracking issue: https://github.com/rust-lang/rust/issues/98287 r? rust-lang/libs-api `@rustbot` label +T-libs-api -T-libs
2023-11-05Auto merge of #117191 - Skgland:easy-beta-channels, r=Mark-Simulacrumbors-0/+23
generate beta manifests as pre-requisit to rust-lang/rustup#1329 <https://github.com/rust-lang/rustup/issues/1329#issuecomment-1134946736> mentioned (a while ago) this would be the next step
2023-11-05Make the randomize feature of rustc_abi additivehkalbasi-9/+7
2023-11-05Auto merge of #117179 - Voultapher:fix-useless-comp-in-partition-equal, ↵bors-3/+10
r=Mark-Simulacrum Avoid unnecessary comparison in partition_equal The branchy Hoare partition `partition_equal` as part of `slice::sort_unstable` has a bug that makes it perform a comparison of the last element twice. Measuring inputs with a Zipfian distribution with characterizing exponent s == 1.0, yields a ~0.05% reduction in the total number of comparisons performed.
2023-11-05Update doc comment for CodegenBackend::linkbjorn3-5/+1
2023-11-05Use the actual computed crate name for -Zprint-vtable-sizesbjorn3-14/+14
2023-11-05Don't steal the parse query when using --prettybjorn3-3/+7
This is the only place aside from the global_ctxt query where it is stolen.
2023-11-05Auto merge of #117574 - onur-ozkan:fix-compiler-crate-linking, r=Mark-Simulacrumbors-57/+73
improve compiler&tool documenting and re-enable cranelift on CI First commit addresses the linking issue with compiler crates. Second one ensures that compiler crates are linked correctly (with later commits we added this check for tools as well), allowing us to detect these hard-to-catch bugs on CI. Following three commits cherry-picked from #117328 to re-enable the Cranelift backend on CI. More info: https://github.com/rust-lang/rust/issues/117430 cc `@bjorn3` `@RalfJung`
2023-11-05Remove from vacation and compiler review groupJack Huey-3/+2
2023-11-05bootstrap: improve linking of tool docsonur-ozkan-41/+40
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-11-05Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillotbors-5/+70
Feature gate enums in offset_of As requested at https://github.com/rust-lang/rust/issues/106655#issuecomment-1790815262, put enums in offset_of behind their own feature gate. `@rustbot` label F-offset_of
2023-11-05Auto merge of #117608 - matthiaskrgr:rollup-g9fagmv, r=matthiaskrgrbors-23/+13
Rollup of 4 pull requests Successful merges: - #116017 (Don't pass `-stdlib=libc++` when building C files on macOS) - #117524 (bootstrap/setup: create hooks directory if non-existing) - #117588 (Remove unused LoadResult::DecodeIncrCache variant) - #117596 (Add diagnostic items for a few of core's builtin macros) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-05Rollup merge of #117596 - thomcc:core_macro_diag_items, r=NilstriebMatthias Krüger-0/+3
Add diagnostic items for a few of core's builtin macros Specifically, `env`, `option_env`, and `include`. There are a number of reasons why people might want to look at these in lints (For example, to ensure that things behave consistently, detect things that might make builds less reproducible, etc). Concretely, in PL/Rust (well, `plrustc`) we have lints that forbid these (which I'd like to [add to clippy as restriction lints](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Landing.20a.20flotilla.20of.20lints.3F) eventually), and `dylint` also has [lints that look for `env!`/`option_env!`](https://github.com/trailofbits/dylint/blob/109a07e9f27a9651ef33b6677ccaddd21466e97a/examples/general/env_cargo_path/src/lib.rs) (although perhaps not `include`), which would benefit from this. My experience is that it's pretty annoying to (robustly) check uses of builtin macros without these IME, although that's perhaps just my own fault (e.g. I could be doing it wrong). At `@Nilstrieb's` suggestion, I've added a comment that explains why these are here, even though they are not used in the compiler. This is mostly to discourage removal, although it's not a big deal if it happens (I'm certainly not suggesting the presence of these be in any way stable). --- In theory this is a library PR (in that it's in library/core), but I'm going to roll compiler because the existence of this or not is much more likely something they care about rather than libs. Hopefully nobody objects to this. r? compiler
2023-11-05Rollup merge of #117588 - bjorn3:remove_unused_error_variant, r=cjgillotMatthias Krüger-18/+1
Remove unused LoadResult::DecodeIncrCache variant
2023-11-05Rollup merge of #117524 - unleashed:bootstrap-create-hooks-dir, ↵Matthias Krüger-1/+6
r=Mark-Simulacrum bootstrap/setup: create hooks directory if non-existing When running `./x setup` on a local repository I chose to install a `pre-push` git hook, but this happened: ```shell Would you like to install the git hook?: [y/N] y error: could not create hook .git/hooks/pre-push: do you already have the git hook installed? No such file or directory (os error 2) thread 'main' panicked at src/core/build_steps/setup.rs:462:9: install_git_hook_maybe(&config) failed with No such file or directory (os error 2) ``` This was caused because the `.git/hooks` directory did not exist in my local repository. Creating it manually and re-running the command works fine. This PR tests for the above directory and if it does not exist then it _tries_ to create it before hard linking the pre-push hook - we use `fs::create_dir()` and disregard the result (ie. it could fail if the directory was created in the meantime) and proceed to call `fs::hard_link()` all the same.
2023-11-05Rollup merge of #116017 - Zalathar:darwin-stdlib, r=albertlarsan68Matthias Krüger-4/+3
Don't pass `-stdlib=libc++` when building C files on macOS When using *Command Line Tools for Xcode* version 15.0, clang will warn about `argument unused during compilation: '-stdlib=libc++'` if this flag is present when compiling C files only (i.e. no C++ files). To avoid this warning, we can add the flag only to CXXFLAGS and not to CFLAGS. --- [Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/326414-t-infra.2Fbootstrap/topic/clang.20warning.3A.20argument.20unused.20during.20compilation.20.28libc.2B.2B.29)
2023-11-05bump clang version for dist-x86_64-linux from 17.0.2 to 17.0.4klensy-1/+1
This fixes few miscompiles, so nice to have.
2023-11-05Auto merge of #117504 - pcc:android-link-libunwind, r=Mark-Simulacrumbors-34/+1
Remove obsolete support for linking unwinder on Android Linking libgcc is no longer supported (see #103673), so remove the related link attributes and the check in unwind's build.rs. The check was the last remaining significant piece of logic in build.rs, so remove build.rs as well.
2023-11-05Auto merge of #117469 - cjgillot:filecheck-mir, r=Mark-Simulacrumbors-119/+307
Add FileCheck annotations to a few MIR opt tests const_debuginfo did not specify which passes were running. const_prop_miscompile is renamed and moved to const_prop directory. while_storage was broken.
2023-11-05Auto merge of #116218 - tgross35:const-maybe-uninit-zeroed, r=dtolnaybors-17/+42
Stabilize `const_maybe_uninit_zeroed` and `const_mem_zeroed` Make `MaybeUninit::zeroed` and `mem::zeroed` const stable. Newly stable API: ```rust // core::mem pub const unsafe fn zeroed<T>() ->; impl<T> MaybeUninit<T> { pub const fn zeroed() -> MaybeUninit<T>; } ``` This relies on features based around `const_mut_refs`. Per `@RalfJung,` this should be OK since we do not leak any `&mut` to the user. For this to be possible, intrinsics `assert_zero_valid` and `assert_mem_uninitialized_valid` were made const stable. Tracking issue: #91850 Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const_mut_refs.60.20dependents r? libs-api `@rustbot` label -T-libs +T-libs-api +A-const-eval cc `@RalfJung` `@oli-obk` `@rust-lang/wg-const-eval`
2023-11-05Auto merge of #117589 - compiler-errors:global-vars-bug, r=jackh726bors-32/+47
Make sure that predicates with unmentioned bound vars are still considered global in the old solver In the old solver, we consider predicates with late-bound vars to not be "global": https://github.com/rust-lang/rust/blob/9c8a2694fadf3900c4d7880f6357cee60e9aa39b/compiler/rustc_trait_selection/src/traits/select/mod.rs#L1840-L1844 The implementation of `has_late_bound_vars` was modified in #115834 so that we'd properly anonymize binders that had late-bound vars but didn't reference them. This fixed an ICE. However, this also led to a behavioral change in https://github.com/rust-lang/rust/issues/117056#issuecomment-1775014545 for a couple of crates, which now consider `for<'a> GL33: Shader` (note the binder var that is *not* used in the predicate) to not be "global". This forces associated types to not be normalizable due to the old trait solver being dumb. This PR distinguishes types which *reference* late-bound vars and binders which *have* late-bound vars. The latter is represented with the new type flag `TypeFlags::HAS_BINDER_VARS`, which is used when we only care about knowing whether binders have vars in their bound var list (even if they're not used, like for binder anonymization). This should fix (after beta backport) the `luminance-gl` and `luminance-webgl` crates in #117056. r? types **(priority is kinda high on a review here given beta becomes stable on November 16.)**
2023-11-05Auto merge of #117581 - nicholasbishop:bishop-update-cb, r=Mark-Simulacrumbors-3/+3
Bump compiler_builtins to 0.1.103
2023-11-05Auto merge of #117503 - kornelski:hint-try-reserved, r=workingjubileebors-5/+29
Hint optimizer about try-reserved capacity This is #116568, but limited only to the less-common `try_reserve` functions to reduce bloat in debug binaries from debug info, while still addressing the main use-case #116570
2023-11-04Add diagnostic items for a few of core's builtin macrosThom Chiovoloni-0/+3
2023-11-04Auto merge of #117590 - matthiaskrgr:rollup-9cqh1q8, r=matthiaskrgrbors-71/+197
Rollup of 6 pull requests Successful merges: - #110340 (Deref docs: expand and remove "smart pointer" qualifier) - #116894 (Guarantee that `char` has the same size and alignment as `u32`) - #117534 (clarify that the str invariant is a safety, not validity, invariant) - #117562 (triagebot no-merges: exclude different case) - #117570 (fallback for `construct_generic_bound_failure`) - #117583 (Remove `'tcx` lifetime on `PlaceholderConst`) r? `@ghost` `@rustbot` modify labels: rollup
2023-11-04Use the correct span when emitting the `env!` resultThom Chiovoloni-1/+1
2023-11-04fix clippy author and failing testDinu Blanovschi-4/+9
2023-11-04Rollup merge of #117583 - compiler-errors:placeholderconst-lifetime, r=cjgillotMatthias Krüger-9/+9
Remove `'tcx` lifetime on `PlaceholderConst` The `'tcx` lifetime is not needed for anything, so this is a continuation of #117139.
2023-11-04Rollup merge of #117570 - bvanjoi:fix-117547, r=cjgillotMatthias Krüger-8/+37
fallback for `construct_generic_bound_failure` Fixes #117547 This case regressed at #115882. In this context, `generic_param_scope` is produced by `RPITVisitor` and not included by `hir_owner`. Therefore, I've added a fallback to address this.
2023-11-04Rollup merge of #117562 - pitaj:triagebot_no-merges, r=Mark-SimulacrumMatthias Krüger-1/+1
triagebot no-merges: exclude different case "Subtree update" as well To address [this on zulip](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/can't.20suppress.20merge.20commit.20warning) cc `@bjorn3` r? `@mark-simulacrum`
2023-11-04Rollup merge of #117534 - RalfJung:str, r=Mark-SimulacrumMatthias Krüger-11/+17
clarify that the str invariant is a safety, not validity, invariant Updates these docs to match https://github.com/rust-lang/reference/pull/792
2023-11-04Rollup merge of #116894 - joshlf:patch-12, r=RalfJungMatthias Krüger-1/+8
Guarantee that `char` has the same size and alignment as `u32`
2023-11-04Rollup merge of #110340 - jmaargh:jmaargh/deref-docs, r=Mark-SimulacrumMatthias Krüger-41/+125
Deref docs: expand and remove "smart pointer" qualifier **Ready for review** ~~This is an unpolished draft to be sanity-checked~~ Fixes #91004 ~~Comments on substance and content of this are welcome. This is deliberately unpolished until ready to review so please try to stay focused on the big-picture.~~ ~~Once this has been sanity checked, I will similarly update `DerefMut` and polish for review.~~
2023-11-04Make sure that predicates with unmentioned bound vars are still considered ↵Michael Goulet-32/+47
global in the old solver
2023-11-04Remove unused LoadResult::DecodeIncrCache variantbjorn3-18/+1