Commit graph

256871 commits

Author SHA1 Message Date
Michael Goulet 82ef3ad980 Uplift TypeError 2024-06-06 07:49:47 -04:00
Michael Goulet c74efbca71 Make middle not rely on next_trait_solver 2024-06-06 07:49:47 -04:00
bors 67caf52fbc Auto merge of #125406 - tbu-:pr_rm_path_with_extension, r=Nadrieril
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-06 10:24:24 +00:00
Rémy Rakic 9ddf5726f0 add non-regression run-make test for issues 125474, 125484, and 125646 2024-06-06 10:06:28 +00:00
Rémy Rakic 0a4176a831 Revert "Rollup merge of #124976 - petrochenkov:usedcrates, r=oli-obk"
This reverts commit eda4a35f36, reversing
changes made to eb6b35b5bc.
2024-06-06 10:06:28 +00:00
Oli Scherer c7ced1ba53 Make the panic info more useful 2024-06-06 09:47:10 +00:00
Guillaume Gomez 7ad5ebc75c Migrate run-make/manual-crate-name to rmake.rs 2024-06-06 10:19:15 +02:00
bors 2d28b6384e Auto merge of #124482 - spastorino:unsafe-extern-blocks, r=oli-obk
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-06 08:14:58 +00:00
Nikita Popov 46b31e6630 Update to LLVM 18.1.7 2024-06-06 08:37:27 +02:00
Jubilee Young 878107436a Raise DEFAULT_MIN_STACK_SIZE to at least 64KiB
Prevent copy-paste errors from producing new starved-for-resources
threaded platforms by raising `DEFAULT_MIN_STACK_SIZE` from 4096 bytes
to at least 64KiB.

Two platforms "affected" by this have no actual threads:
- UEFI
- "unsupported"

Platforms that this actually affects:
- wasm32-wasi with "atomics" enabled
- wasm32-wasi-p1-threads

Two exceptions:
- SGX: a "secure code execution" platform, stays at 4096B
- TEEOS: also a "secure code execution" platform, stays at 8192B

I believe either of these may have sufficiently "interesting" semantics
around threads, or significant external library support. Either would
mean making any choices here for them is suspect.
2024-06-05 23:22:37 -07:00
bors 2b6a34273d Auto merge of #126056 - matthiaskrgr:rollup-ytwg62v, r=matthiaskrgr
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-06 05:56:06 +00:00
Sunshine c3309ef446 Make html rendered by rustdoc allow searching non-English identifier / alias. Fix alias search result showing undefined description. 2024-06-06 12:06:53 +08:00
onur-ozkan dd9902118c use bootstrap-self-test feature on libstd check
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06 07:06:51 +03:00
onur-ozkan 6bfdb040d9 add FIXME on libcxx check
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06 07:01:40 +03:00
onur-ozkan a2407e8448 skip src/tools/libcxx-version from tidy
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06 07:01:37 +03:00
onur-ozkan 1a07e58c09 register libcxx-version in triagebot
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06 07:01:34 +03:00
onur-ozkan 73ff1d4b25 check host's libstdc++ version when using ci llvm
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06 07:01:31 +03:00
onur-ozkan 3a70a810d5 create libcxx-version tool for getting currently used libcxx version
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-06-06 07:01:28 +03:00
bors 003a902792 Auto merge of #125958 - BoxyUwU:remove_const_ty, r=lcnr
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 😅

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-06 03:41:23 +00:00
Matthias Krüger 51a70022ef
Rollup merge of #126048 - ehuss:cargo-specfics-fixes, r=ehuss
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-06 04:17:27 +02:00
Matthias Krüger 3121a5ca3b
Rollup merge of #126045 - olafes:master, r=compiler-errors
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-06 04:17:27 +02:00
Matthias Krüger 55b76f4720
Rollup merge of #125987 - estebank:issue-122622, r=Nadrieril
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-06 04:17:26 +02:00
Matthias Krüger 8f04878dee
Rollup merge of #125925 - tbu-:pr_unsafe_env_unsafe_op_in_unsafe_fn, r=Nadrieril
Don't trigger `unsafe_op_in_unsafe_fn` for deprecated safe fns

Fixes #125875.

Tracking:

- #124866
2024-06-06 04:17:26 +02:00
Matthias Krüger 2611b292c4
Rollup merge of #125168 - 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-06 04:17:26 +02:00
Matthias Krüger 3b6eefe8bf
Rollup merge of #124731 - dalance:add_translation_support, r=ehuss
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-06 04:17:25 +02:00
bors d0ccb5413e Auto merge of #122505 - oli-obk:visit_nested_body2, r=tmiasko
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-06 01:33:14 +00:00
Nicholas Nethercote 3f892f87e6 Clarify an x fmt error. 2024-06-06 08:54:48 +10:00
Nicholas Nethercote 4c731c2f6b Inline and remove check_builtin_attribute.
It's small and has a single call site.

Also change the second `parse_meta` call to use a simple `match`, like
the first `parse_meta` call, instead of a confusing `map_err`+`ok`
combination.
2024-06-06 08:26:54 +10:00
Nicholas Nethercote 13f2bc9a65 Specialize assert_pred.
It has only two uses, and both use `matches_codepattern`. So just change
it to `assert_matches_codepattern`.
2024-06-06 08:26:54 +10:00
Nicholas Nethercote 95b4c07ef8 Reduce pub exposure. 2024-06-06 08:26:54 +10:00
Tobias Bucher bb901a114f Don't trigger unsafe_op_in_unsafe_fn for deprecated safe fns
Fixes #125875.
2024-06-05 23:44:59 +02:00
Boxy 3a6b606ad9 remove const arg windows debug info tests 2024-06-05 22:39:42 +01:00
Michael Goulet 2e082677a6 Fix function-names.rs test 2024-06-05 22:25:42 +01:00
Boxy f74119a2e4 Bless tests and handle tests/crashes 2024-06-05 22:25:42 +01:00
Boxy 7fa98d0c01 ty::Expr reviews 2024-06-05 22:25:42 +01:00
Boxy 56092a345b Misc fixes (pattern type lowering, cfi, pretty printing) 2024-06-05 22:25:42 +01:00
Boxy a454da3b1c Misc fixes to cranelift/clippy/miri 2024-06-05 22:25:42 +01:00
Boxy 432c11feb6 Remove Type from rustdoc Const 2024-06-05 22:25:42 +01:00
Boxy 60a5bebbe5 Add Ty to mir::Const::Ty 2024-06-05 22:25:41 +01:00
Boxy 8d6705cdb8 Fully implement ConstArgHasType 2024-06-05 22:25:41 +01:00
Boxy a9702a6668 Add Ty to ConstKind::Value 2024-06-05 22:25:41 +01:00
Boxy 58feec9b85 Basic removal of Ty from places (boring) 2024-06-05 22:25:38 +01:00
bors 72fdf913c5 Auto merge of #126038 - matthiaskrgr:rollup-h4rm3x2, r=matthiaskrgr
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-05 20:53:32 +00:00
Eric Huss 964e88555b Fix some wording in cargo-specifics.md 2024-06-05 13:35:38 -07:00
Daniel Hofstetter 88e81bca9f Fix typos in cargo-specifics.md 2024-06-05 13:35:34 -07:00
Josh Stone c0e2543147 Simplify the rayon calls in the installer
Rayon's `try_for_each` makes the `CombinedEncoder` a lot simpler.
2024-06-05 13:20:17 -07:00
Olaf Siwiński 743c41757c
check_expr_struct_fields: taint context with errors if struct definition is malformed 2024-06-05 21:54:22 +02:00
bors 7ebd2bdbf6 Auto merge of #126037 - matthiaskrgr:rollup-7pz1nhr, r=matthiaskrgr
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-05 18:40:07 +00:00
Ana Hobden ae4ae1685c
Repair several riscv64gc-unknown-linux-gnu codegen tests
Fix tests/codegen/riscv-abi/call-llvm-intrinsics.rs

Fix tests/codegen/riscv-abi/riscv64-lp64d-abi.rs

Fix tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs

On riscv64gc ignore tests/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs

Make tests/codegen/riscv-abi/riscv64-lp64d-abi.rs no_core

Make tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs no_core

Set -O for tests/codegen/riscv-abi/riscv64-lp64d-abi.rs

Set -O for tests/codegen/riscv-abi/riscv64-lp64f-lp64d-abi.rs
2024-06-05 09:39:14 -07:00
Matthias Krüger fa58891f99
Rollup merge of #126032 - ChrisDenton:update-docs, r=joboet
Update description of the `IsTerminal` example

The example code prompts for input if stdin is a terminal.
2024-06-05 18:21:15 +02:00