about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-06-06Revert "Rollup merge of #124099 - voidc:disallow-ambiguous-expr-attrs, ↵Rémy Rakic-141/+49
r=davidtwco" This reverts commit 57dad1d75e562ff73051c1c43b07eaf65c7dbd74, reversing changes made to 36316df9fe6c3e246153fe6e78967643cf08c148.
2024-06-06Auto merge of #126061 - nikic:llvm-18.1.7, r=wesleywiserbors-0/+0
Update to LLVM 18.1.7 This release only contains a single commit in code that we build: https://github.com/rust-lang/llvm-project/commit/7e6ece9b4f2d37caf8ff7b87603f15ed9ad2d6ec It addresses a regression in LLVM 18.1.6 that may result in compiler crashes when targeting ppc.
2024-06-06Auto merge of #125411 - onur-ozkan:sanity-check-libstdc++, r=Mark-Simulacrumbors-0/+118
check host's libstdc++ version when using ci llvm If the host's libstdc++ version is too old using ci-llvm may result in an ABI mismatch between the local libstdc++ and libLLVM.so. This PR adds a sanity check to immediately fail at the beginning of the bootstrap before starting the actual build. I am not sure if '8' is the best threshold, but it should be a good start and we can increase it anytime if needed. Fixes #123037
2024-06-06Auto merge of #125406 - tbu-:pr_rm_path_with_extension, r=Nadrierilbors-9/+4
Directly add extension instead of using `Path::with_extension` `Path::with_extension` has a nice footgun when the original path doesn't contain an extension: Anything after the last dot gets removed.
2024-06-06Auto merge of #124482 - spastorino:unsafe-extern-blocks, r=oli-obkbors-152/+714
Unsafe extern blocks This implements RFC 3484. Tracking issue #123743 and RFC https://github.com/rust-lang/rfcs/pull/3484 This is better reviewed commit by commit.
2024-06-06Update to LLVM 18.1.7Nikita Popov-0/+0
2024-06-06Auto merge of #126056 - matthiaskrgr:rollup-ytwg62v, r=matthiaskrgrbors-425/+642
Rollup of 6 pull requests Successful merges: - #124731 (Add translation support by mdbook-i18n-helpers to bootstrap) - #125168 (Match ergonomics 2024: align implementation with RFC) - #125925 (Don't trigger `unsafe_op_in_unsafe_fn` for deprecated safe fns) - #125987 (When `derive`ing, account for HRTB on `BareFn` fields) - #126045 (check_expr_struct_fields: taint context with errors if struct definit…) - #126048 (Fix typos in cargo-specifics.md) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-06use `bootstrap-self-test` feature on libstd checkonur-ozkan-3/+8
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06add FIXME on libcxx checkonur-ozkan-5/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06skip `src/tools/libcxx-version` from tidyonur-ozkan-2/+1
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06register libcxx-version in triagebotonur-ozkan-0/+2
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06check host's libstdc++ version when using ci llvmonur-ozkan-1/+89
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06create libcxx-version tool for getting currently used libcxx versiononur-ozkan-0/+28
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06Auto merge of #125958 - BoxyUwU:remove_const_ty, r=lcnrbors-1229/+1160
Remove the `ty` field from type system `Const`s Fixes #125556 Fixes #122908 Part of the work on `adt_const_params`/`generic_const_param_types`/`min_generic_const_exprs`/generally making the compiler nicer. cc rust-lang/project-const-generics#44 Please review commit-by-commit otherwise I wasted a lot of time not just squashing this into a giant mess (and also it'll be SO much nicer because theres a lot of fluff changes mixed in with other more careful changes if looking via File Changes --- Why do this? - The `ty` field keeps causing ICEs and weird behaviour due to it either being treated as "part of the const" or it being forgotten about leading to ICEs. - As we move forward with `adt_const_params` and a potential `min_generic_const_exprs` it's going to become more complex to actually lower the correct `Ty<'tcx>` - It muddles the idea behind how we check `Const` arguments have the correct type. By having the `ty` field it may seem like we ought to be relating it when we relate two types, or that its generally important information about the `Const`. - Brings the compiler more in line with `a-mir-formality` as that also tracks the type of type system `Const`s via `ConstArgHasType` bounds in the env instead of on the `Const` itself. - A lot of stuff is a lot nicer when you dont have to pass around the type of a const lol. Everywhere we construct `Const` is now significantly nicer :sweat_smile: See #125671's description for some more information about the `ty` field --- General summary of changes in this PR: - Add `Ty` to `ConstKind::Value` as otherwise there is no way to implement `ConstArgHasType` to ensure that const arguments are correctly typed for the parameter when we stop creating anon consts for all const args. It's also just incredibly difficult/annoying to thread the correct `Ty` around to a bunch of ctfe functions otherwise. - Fully implement `ConstArgHasType` in both the old and new solver. Since it now has no reliance on the `ty` field it serves its originally intended purpose of being able to act as a double check that trait vs impls have correctly typed const parameters. It also will now be able to be responsible for checking types of const arguments to parameters under `min_generic_const_exprs`. - Add `Ty` to `mir::Const::Ty`. I dont have a great understanding of why mir constants are setup like this to be honest. Regardless they need to be able to determine the type of the const and the easiest way to make this happen was to simply store the `Ty` along side the `ty::Const`. Maybe we can do better here in the future but I'd have to spend way more time looking at everywhere we use `mir::Const`. - rustdoc has its own `Const` which also has a `ty` field. It was relatively easy to remove this. --- r? `@lcnr` `@compiler-errors`
2024-06-06Rollup merge of #126048 - ehuss:cargo-specfics-fixes, r=ehussMatthias Krüger-7/+7
Fix typos in cargo-specifics.md This fixes some wording in cargo-specifics.md. This is based on #125494 with some additional edits.
2024-06-06Rollup merge of #126045 - olafes:master, r=compiler-errorsMatthias Krüger-13/+68
check_expr_struct_fields: taint context with errors if struct definit… Taint errors while checking `struct { field: 1 }` below if struct definition has duplicated fields so that we don't pass it to const eval. fixes #125842, fixes #124464, fixes #124552 ```rust struct Struct { field: Option<u8>, field: u8, } static STATIC: Struct = Struct { field: 1, }; pub fn main() {} ``` (This was #125947 but i messed something up, sorry) r? ``@compiler-errors``
2024-06-06Rollup merge of #125987 - estebank:issue-122622, r=NadrierilMatthias Krüger-1/+24
When `derive`ing, account for HRTB on `BareFn` fields When given ```rust trait SomeTrait { type SomeType<'a>; } #[derive(Clone)] struct Foo<T: SomeTrait> { x: for<'a> fn(T::SomeType<'a>) } ``` expand to ```rust impl<T: ::core::clone::Clone + SomeTrait> ::core::clone::Clone for Foo<T> where for<'a> T::SomeType<'a>: ::core::clone::Clone { #[inline] fn clone(&self) -> Foo<T> { Foo { x: ::core::clone::Clone::clone(&self.x) } } } ``` instead of the previous invalid ``` impl<T: ::core::clone::Clone + SomeTrait> ::core::clone::Clone for Foo<T> where T::SomeType<'a>: ::core::clone::Clone { #[inline] fn clone(&self) -> Foo<T> { Foo { x: ::core::clone::Clone::clone(&self.x) } } } ``` Fix #122622. <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-06-06Rollup merge of #125925 - tbu-:pr_unsafe_env_unsafe_op_in_unsafe_fn, r=NadrierilMatthias Krüger-45/+124
Don't trigger `unsafe_op_in_unsafe_fn` for deprecated safe fns Fixes #125875. Tracking: - #124866
2024-06-06Rollup merge of #125168 - ↵Matthias Krüger-343/+233
Jules-Bertholet:match-ergonomics-2024-align-with-rfc, r=Nadrieril Match ergonomics 2024: align implementation with RFC - Remove eat-two-layers (`ref_pat_everywhere`) - Consolidate `mut_preserve_binding_mode_2024` into `ref_pat_eat_one_layer_2024` - `&mut` no longer peels off `&` - Apply "no `ref mut` behind `&`" rule on all editions with `ref_pat_eat_one_layer_2024` - Require `mut_ref` feature gate for all mutable by-reference bindings r? ``@Nadrieril`` cc https://github.com/rust-lang/rust/issues/123076 ``@rustbot`` label A-edition-2024 A-patterns
2024-06-06Rollup merge of #124731 - dalance:add_translation_support, r=ehussMatthias Krüger-16/+186
Add translation support by mdbook-i18n-helpers to bootstrap This PR add translation support by [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) to bootstrap. This is draft PR because there is the dependency to my forked mdbook-i18n-helpers. If this PR is acceptable, I'll send a PR to the original mdbook-i18n-helpers and remove draft after changing the dependency to the original. Closes #124641
2024-06-06Auto merge of #122505 - oli-obk:visit_nested_body2, r=tmiaskobors-8/+55
Don't walk the bodies of free constants for reachability. follow-up to #122371 cc #119214 This avoids codegening items (e.g. functions) that are only used during const eval, but do not reach their final constant value (e.g. via function pointers). r? `@tmiasko`
2024-06-05Don't trigger `unsafe_op_in_unsafe_fn` for deprecated safe fnsTobias Bucher-45/+124
Fixes #125875.
2024-06-05remove const arg windows debug info testsBoxy-3/+0
2024-06-05Fix function-names.rs testMichael Goulet-2/+2
2024-06-05Bless tests and handle tests/crashesBoxy-285/+386
2024-06-05ty::Expr reviewsBoxy-7/+11
2024-06-05Misc fixes (pattern type lowering, cfi, pretty printing)Boxy-40/+36
2024-06-05Misc fixes to cranelift/clippy/miriBoxy-7/+9
2024-06-05Remove `Type` from rustdoc `Const`Boxy-62/+64
2024-06-05Add `Ty` to `mir::Const::Ty`Boxy-51/+81
2024-06-05Fully implement `ConstArgHasType`Boxy-103/+158
2024-06-05Add `Ty` to `ConstKind::Value`Boxy-189/+183
2024-06-05Basic removal of `Ty` from places (boring)Boxy-581/+331
2024-06-05Auto merge of #126038 - matthiaskrgr:rollup-h4rm3x2, r=matthiaskrgrbors-190/+455
Rollup of 9 pull requests Successful merges: - #124840 (resolve: mark it undetermined if single import is not has any bindings) - #125622 (Winnow private method candidates instead of assuming any candidate of the right name will apply) - #125648 (Remove unused(?) `~/rustsrc` folder from docker script) - #125672 (Add more ABI test cases to miri (RFC 3391)) - #125800 (Fix `mut` static task queue in SGX target) - #125871 (Orphanck[old solver]: Consider opaque types to never cover type parameters) - #125893 (Handle all GVN binops in a single place.) - #126008 (Port `tests/run-make-fulldeps/issue-19371` to ui-fulldeps) - #126032 (Update description of the `IsTerminal` example) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-05Fix some wording in cargo-specifics.mdEric Huss-5/+5
2024-06-05Fix typos in cargo-specifics.mdDaniel Hofstetter-3/+3
2024-06-05check_expr_struct_fields: taint context with errors if struct definition is ↵Olaf Siwiński-13/+68
malformed
2024-06-05Auto merge of #126037 - matthiaskrgr:rollup-7pz1nhr, r=matthiaskrgrbors-382/+755
Rollup of 10 pull requests Successful merges: - #124746 (`rustc --explain E0582` additional example) - #125407 (Detect when user is trying to create a lending `Iterator` and give a custom explanation) - #125505 (Add intra-doc-links to rustc_middle crate-level docs.) - #125792 (Don't drop `Unsize` candidate in intercrate mode) - #125819 (Various `HirTyLowerer` cleanups) - #125861 (rustc_codegen_ssa: fix `get_rpath_relative_to_output` panic when lib only contains file name) - #125911 (delete bootstrap build before switching to bumped rustc) - #125921 (coverage: Carve out hole spans in a separate early pass) - #125940 (std::unix::fs::get_path: using fcntl codepath for netbsd instead.) - #126022 (set `has_unconstrained_ty_var` when generalizing aliases in bivariant contexts) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-05Rollup merge of #126032 - ChrisDenton:update-docs, r=joboetMatthias Krüger-3/+2
Update description of the `IsTerminal` example The example code prompts for input if stdin is a terminal.
2024-06-05Rollup merge of #126008 - Zalathar:fulldeps-19371, r=jieyouxuMatthias Krüger-23/+34
Port `tests/run-make-fulldeps/issue-19371` to ui-fulldeps This test can run as an ordinary `tests/ui-fulldeps` test, with the help of some additional header variable substitutions to supply a sysroot and linker. --- Unlike #125973, this test appears to be testing something vaguely useful and breakable, which is why I didn't just delete it.
2024-06-05Rollup merge of #125893 - cjgillot:gvn-newops, r=oli-obkMatthias Krüger-30/+40
Handle all GVN binops in a single place. <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> --> Addresses https://github.com/rust-lang/rust/pull/125359/files#r1608185319 r? ``@oli-obk``
2024-06-05Rollup merge of #125871 - fmease:fix-orphanck-opaques, r=lcnrMatthias Krüger-36/+114
Orphanck[old solver]: Consider opaque types to never cover type parameters This fixes an oversight of mine in #117164. The change itself has already been FCP'ed. This only affects the old solver, the next solver already correctly rejects the added test since #117164. r? ``@lcnr``
2024-06-05Rollup merge of #125800 - fortanix:raoul/rte-99-fix_mut_static_task_queue, ↵Matthias Krüger-14/+9
r=jethrogb Fix `mut` static task queue in SGX target [PR 125046](https://github.com/rust-lang/rust/pull/125046) prevents mutable references to statics with `#[linkage]`. Such a construct was used with the tests for the `x86_64-fortanix-unknown-sgx` target. This PR fixes this and cleans up code a bit in 5 steps. Each step passes CI: - The `mut` static is removed, and `Task` explicitly implements `Send` - Renaming of the `task_queue::lock` function - Pass function for `Thread` as `Send` to `Thread::imp` and update when `Packet<'scope, T>` implements `Sync` - Storing `Task::p` as a type that implements `Send` - Letting the compiler auto implement `Send` for `Task` cc: ``@jethrogb``
2024-06-05Rollup merge of #126022 - lcnr:generalize-alias-bivariant, r=compiler-errorsMatthias Krüger-2/+30
set `has_unconstrained_ty_var` when generalizing aliases in bivariant contexts this previously prevented the `regression-31157` benchmark from building r? `@compiler-errors`
2024-06-05Rollup merge of #125672 - Lokathor:update-miri-result-ffi, r=RalfJungMatthias Krüger-11/+36
Add more ABI test cases to miri (RFC 3391) Part of https://github.com/rust-lang/rust/issues/110503 cc `@RalfJung`
2024-06-05Rollup merge of #125940 - devnexen:unix_fs_netbsd_get_path, r=cuviperMatthias Krüger-9/+13
std::unix::fs::get_path: using fcntl codepath for netbsd instead. on netbsd, procfs is not as central as on linux/solaris thus can be perfectly not mounted. Thus using fcntl with F_GETPATH, the kernel deals with MAXPATHLEN internally too.
2024-06-05Rollup merge of #125648 - lqd:rustsrc, r=pietroalbiniMatthias Krüger-1/+6
Remove unused(?) `~/rustsrc` folder from docker script Every time I run a docker image, the script creates an empty `~/rustsrc` folder. It doesn't seem to be referenced anywhere else, so I'd like to remove it. Incidentally, this also documents DIST_TRY_BUILD as I fail to find it from a simple search any time I look for it to eg enable tests on try builds.
2024-06-05Rollup merge of #125921 - Zalathar:buckets, r=oli-obkMatthias Krüger-147/+243
coverage: Carve out hole spans in a separate early pass When extracting spans from MIR for use in coverage instrumentation, we sometimes need to identify *hole spans* (currently just closures), and carve up the other spans so that they don't overlap with holes. This PR simplifies the main coverage-span-refiner by extracting the hole-carving process into a separate early pass. That pass produces a series of independent buckets, and we run the span-refiner on each bucket separately. There is almost no difference in the resulting mappings, other than in some edge cases involving macros.
2024-06-05Rollup merge of #125622 - oli-obk:define_opaque_types15, r=compiler-errorsMatthias Krüger-31/+72
Winnow private method candidates instead of assuming any candidate of the right name will apply partially reverts https://github.com/rust-lang/rust/pull/60721 My original motivation was just to avoid the `delay_span_bug` (by attempting to thread the `ErrorGuaranteed` through to here). But then I realized that the error message is wrong. It refers to the `Foo<A>::foo` instead of `Foo<B>::foo`. This is almost invisible, because both functions are the same, but on different lines, so `-Zui-testing` makes it so the test is the same no matter which of these two functions is referenced. But there's a much more obvious bug: If `Foo<B>` does not have a `foo` method at all, but `Foo<A>` has a private `foo` method, then we'll refer to that one. This has now been fixed, and we report a normal `method not found` error. The way this is done is by creating a list of all possible private functions (just like we create a list of the public functions that can actually be called), and then winnowing it by analyzing where bounds and `Self` types to see if any of the found methods can actually apply (again, just like with the list of public functions). I wonder if there is room for doing the same thing with unstable functions instead of running all of method resolution twice. r? ``@compiler-errors`` for method resolution stuff
2024-06-05Rollup merge of #125911 - onur-ozkan:wipe-broken-cache, r=albertlarsan68Matthias Krüger-1/+17
delete bootstrap build before switching to bumped rustc Technically, wiping bootstrap builds can increase the build time. But in practice, trying to manually resolve post-bump issues and even accidentally removing the entire build directory will result in a much greater loss of time. After all, the bootstrap build process is not a particularly lengthy operation. Workaround for #125578