Commit Graph

250649 Commits

Author SHA1 Message Date
bors
e19cc5e922 Auto merge of #3396 - RalfJung:simd-float, r=RalfJung
add support for missing SIMD float intrinsics

These are being exposed by `core::simd`  with https://github.com/rust-lang/rust/pull/122905.
2024-03-23 10:36:00 +00:00
Ralf Jung
c87ec61a42 add support for missing SIMD float intrinsics 2024-03-23 11:32:36 +01:00
Ralf Jung
928bd3b4e0 tag_for_variant follow-ups 2024-03-23 10:45:42 +01:00
Herobs
9e7c00b0e9
Fix some typos in the pin.rs 2024-03-23 16:51:40 +08:00
Ralf Jung
fc257fae3c add panic location to 'panicked while processing panic' 2024-03-23 09:44:04 +01:00
Scott McMurray
75d2e5b123 Avoid non-windows non-linux in assembly x64 test 2024-03-23 00:02:53 -07:00
Gurinder Singh
4afce46231 Change an ICE regression test to use the original reproducer
This gives us more confidence that the ICE was indeed fixed.
2024-03-23 11:22:17 +05:30
bors
f0d864fe04 Auto merge of #3395 - rust-lang:rustup-2024-03-23, r=saethlin
Automatic Rustup
2024-03-23 05:13:01 +00:00
The Miri Cronjob Bot
5039f8b1e9 fmt 2024-03-23 05:03:40 +00:00
The Miri Cronjob Bot
89b9b6793c Merge from rustc 2024-03-23 05:02:28 +00:00
The Miri Cronjob Bot
0115f73fd1 Preparing for merge from rustc 2024-03-23 04:54:00 +00:00
bors
c3b05c6e5b Auto merge of #122911 - Nilstrieb:live-love-patch, r=clubby789
Fix nix patching for LLVM 18

LLVM 18 now ships `libLLVM*.so.*`, so `.so` is not the sole extension anymore, which breaks the dylib detection. Oops! Adjust it to only search for `.so` somewhere.

fixes #122906
2024-03-23 02:41:00 +00:00
Kevin Reid
44d185b0d0 -Zprint-type-sizes: print the types of awaitees and unnamed coroutine locals.
This should assist comprehending the size of coroutines.
In particular, whenever a future is suspended while awaiting another
future, the latter is given the special name `__awaitee`, and now the
type of the awaited future will be printed, allowing identifying
caller/callee — er, I mean, poller/pollee — relationships.

It would be possible to include the type name in more cases, but I
thought that that might be overly verbose (`print-type-sizes` is already
a lot of text) and ordinary named fields or variables are easier for
readers to discover the types of.
2024-03-22 18:07:15 -07:00
Michael Goulet
08235b1603 Validate that we're only matching on unit struct for path pattern 2024-03-22 20:53:42 -04:00
bors
c308726599 Auto merge of #119552 - krtab:dead_code_priv_mod_pub_field, r=cjgillot,saethlin
Replace visibility test with reachability test in dead code detection

Fixes https://github.com/rust-lang/rust/issues/119545

Also included is a fix for an error now flagged by the lint
2024-03-23 00:37:05 +00:00
Ben Kimock
07994c9310 Enable more mir-opt tests in debug builds 2024-03-22 20:14:39 -04:00
Daniel Paoliello
9e0ec251d5 Merge commit 'cff979eec1ac0473fc4960ee6cde462c6aeda824' into sync-portable-simd-2024-03-22 2024-03-22 16:58:39 -07:00
Daniel Paoliello
cff979eec1
Validate generating docs (rust-lang/portable-simd#407)
- Generate docs with warnings disabled.
- Instruct doctest to add `#![deny(warnings)]` to all tests.
2024-03-22 16:08:24 -07:00
Matthew Maurer
dec36c3d6e CFI: Support self_cell-like recursion
Current `transform_ty` attempts to avoid cycles when normalizing
`#[repr(transparent)]` types to their interior, but runs afoul of this
pattern used in `self_cell`:

```
struct X<T> {
  x: u8,
  p: PhantomData<T>,
}

 #[repr(transparent)]
struct Y(X<Y>);
```

When attempting to normalize Y, it will still cycle indefinitely. By
using a types-visited list, this will instead get expanded exactly
one layer deep to X<Y>, and then stop, not attempting to normalize `Y`
any further.
2024-03-22 23:02:05 +00:00
Arthur Carcano
7342cc46f8 Delete dead fields of deserialized cargo output
The dead_code lint was previously eroneously missing this dead code.
Since this lint bug has been fixed, the unused field need to be removed
or marked as `#[allow(dead_code)]`.

Given that this struct is deserialized without #[serde(deny_unknown_fields)]
it is ok to simply delete the never read fields.
2024-03-22 23:59:19 +01:00
Caleb Zulawski
53de3f0806
Use v1 prelude to match core (rust-lang/portable-simd#406) 2024-03-22 15:41:08 -07:00
bors
0ad5e0d2de Auto merge of #122900 - matthiaskrgr:rollup-nls90mb, r=matthiaskrgr
Rollup of 8 pull requests

Successful merges:

 - #114009 (compiler: allow transmute of ZST arrays with generics)
 - #122195 (Note that the caller chooses a type for type param)
 - #122651 (Suggest `_` for missing generic arguments in turbofish)
 - #122784 (Add `tag_for_variant` query)
 - #122839 (Split out `PredicatePolarity` from `ImplPolarity`)
 - #122873 (Merge my contributor emails into one using mailmap)
 - #122885 (Adjust better spastorino membership to triagebot's adhoc_groups)
 - #122888 (add a couple more tests)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-22 22:35:11 +00:00
MultisampledNight
e853b50a72
docs(sync): normalize dot in fn summaries 2024-03-22 23:04:20 +01:00
León Orell Valerian Liehr
807bd98971
Delay a bug if no RPITITs were found 2024-03-22 22:56:28 +01:00
Nilstrieb
60b97a2f3d Fix nix patching for LLVM 18
LLVM 18 now ships `libLLVM*.so.*`, so `.so` is not the sole extension
anymore, which breaks the dylib detection. Oops! Adjust it to only
search for `.so` somewhere.
2024-03-22 22:38:48 +01:00
Michael Goulet
78ebb939c1 Fix validation on substituted callee bodies in MIR inliner 2024-03-22 17:17:03 -04:00
Michael Goulet
da8a39a9de Failing test 2024-03-22 17:15:22 -04:00
Michael Goulet
1fcf2eaa9f Uniquify ReError on input mode in canonicalizer 2024-03-22 16:35:50 -04:00
bors
85e449a323 Auto merge of #122852 - compiler-errors:raw-ptr, r=lcnr
Remove `TypeAndMut` from `ty::RawPtr` variant, make it take `Ty` and `Mutability`

Pretty much mechanically converting `ty::RawPtr(ty::TypeAndMut { ty, mutbl })` to `ty::RawPtr(ty, mutbl)` and its fallout.

r? lcnr

cc rust-lang/types-team#124
2024-03-22 20:34:14 +00:00
Guillaume Gomez
e0d3439226 Rename hir::Node::Local into hir::Node::LetStmt 2024-03-22 20:48:36 +01:00
Guillaume Gomez
d318bf1009 Rename hir::Node::expect_local into hir::Node::expect_let_stmt 2024-03-22 20:36:21 +01:00
Guillaume Gomez
b376f49e30 Rename hir::Local into hir::LetStmt 2024-03-22 20:36:21 +01:00
Matthias Krüger
487933889b
Rollup merge of #122888 - matthiaskrgr:evenmoretests, r=compiler-errors
add a couple more tests
2024-03-22 20:31:31 +01:00
Matthias Krüger
1fe9713805
Rollup merge of #122885 - spastorino:spastorino-adhoc_groups, r=compiler-errors
Adjust better spastorino membership to triagebot's adhoc_groups
2024-03-22 20:31:31 +01:00
Matthias Krüger
5624af3640
Rollup merge of #122873 - badboy:mailmap-mail-merge, r=Mark-Simulacrum
Merge my contributor emails into one using mailmap
2024-03-22 20:31:30 +01:00
Matthias Krüger
80306927cf
Rollup merge of #122839 - compiler-errors:predicate-polarity, r=lcnr
Split out `PredicatePolarity` from `ImplPolarity`

Because having to deal with a third `Reservation` level in all the trait solver code is kind of weird.

r? `@lcnr` or `@oli-obk`
2024-03-22 20:31:30 +01:00
Matthias Krüger
96be3e7cc8
Rollup merge of #122784 - jswrenn:tag_for_variant, r=compiler-errors
Add `tag_for_variant` query

This query allows for sharing code between `rustc_const_eval` and `rustc_transmutability`. It's a precursor to a PR I'm working on to entirely replace the bespoke layout computations in `rustc_transmutability`.

r? `@compiler-errors`
2024-03-22 20:31:29 +01:00
Matthias Krüger
4e594572b4
Rollup merge of #122651 - kornelski:flat-turbofish, r=spastorino,compiler-errors
Suggest `_` for missing generic arguments in turbofish

The compiler may suggest unusable generic type names for missing generic arguments in an expression context:

```rust
fn main() {
    (0..1).collect::<Vec>()
}
```

> help: add missing generic argument
>
>      (0..1).collect::<Vec<T>>()

but `T` is not a valid name in this context, and this suggestion won't compile.

I've changed it to use `_` inside method calls (turbofish), so it will suggest `(0..1).collect::<Vec<_>>()` which _may_ compile.

It's possible that the suggested `_` will be ambiguous, but there is very extensive E0283 that will help resolve that, which is more helpful than a basic "cannot find type `T` in this scope" users would get otherwise.

Out of caution to limit scope of the change I've limited it to just turbofish, but I suspect `_` could be the better choice in more cases. Perhaps in all expressions?
2024-03-22 20:31:29 +01:00
Matthias Krüger
aa184c558f
Rollup merge of #122195 - jieyouxu:impl-return-note, r=fmease
Note that the caller chooses a type for type param

```
error[E0308]: mismatched types
  --> $DIR/return-impl-trait.rs:23:5
   |
LL | fn other_bounds<T>() -> T
   |                 -       -
   |                 |       |
   |                 |       expected `T` because of return type
   |                 |       help: consider using an impl return type: `impl Trait`
   |                 expected this type parameter
...
LL |     ()
   |     ^^ expected type parameter `T`, found `()`
   |
   = note: expected type parameter `T`
                   found unit type `()`
   = note: the caller chooses the type of T which can be different from ()
```

Tried to see if "expected this type parameter" can be replaced, but that goes all the way to `rustc_infer` so seems not worth the effort and can affect other diagnostics.

Revives #112088 and #104755.
2024-03-22 20:31:28 +01:00
Matthias Krüger
104c4bc808
Rollup merge of #114009 - dvdhrm:pr/transmzst, r=pnkfelix
compiler: allow transmute of ZST arrays with generics

Extend the `SizeSkeleton` evaluator to shortcut zero-sized arrays, thus considering `[T; 0]` to have a compile-time fixed-size of 0.

The existing evaluator already deals with generic arrays under the feature-guard `transmute_const_generics`. However, it merely allows comparing fixed-size types with fixed-size types, and generic types with generic types. For generic types, it merely compares whether their arguments match (ordering them first). Even if their exact sizes are not known at compile time, it can ensure that they will eventually be the same.

This patch extends this by shortcutting the size-evaluation of zero sized arrays and thus allowing size comparisons of `()` with `[T; 0]`, where one contains generics and the other does not.

This code is guarded by `transmute_const_generics` (#109929), even though it is unclear whether it should be. However, this assumes that a separate stabilization PR is required to move this out of the feature guard.

Initially reported in #98104.
2024-03-22 20:31:28 +01:00
Daniel Paoliello
9685161b04 Update stdarch submodule 2024-03-22 12:16:16 -07:00
Scott McMurray
d0ce391b14 swap_simple no longer needs to be a separate function 2024-03-22 11:55:17 -07:00
Bernardo Meurer Costa
25d06013db fix(bootstrap/dist): use versioned dirs when vendoring
Currently, if you attempt to run ui tests in a vendored build, you will
see this failure

```
---- [ui] tests/ui/issues/issue-21763.rs stdout ----
diff of stderr:

8          = note: required because it appears within the type `(Rc<()>, Rc<()>)`
9          = note: required for `hashbrown::raw::RawTable<(Rc<()>, Rc<()>)>` to implement `Send`
10      note: required because it appears within the type `hashbrown::map::HashMap<Rc<()>, Rc<()>, RandomState>`
-         --> $HASHBROWN_SRC_LOCATION
+         --> /rust/deps/hashbrown/src/map.rs:190:12
12      note: required because it appears within the type `HashMap<Rc<()>, Rc<()>>`
13        --> $SRC_DIR/std/src/collections/hash/map.rs:LL:COL
14      note: required by a bound in `foo`
```

This happend because the code that attempts to remap
`HASHBROWN_SRC_LOCATION` expects it to be under `hashbrown-$version`,
which is the case in a normal cargo registry, but not when vendor, where
by default crates may not have the version in their directory name.

This change passes `--versioned-dirs` to `cargo vendor` to enforce that
every crate includes the version in the subdir name, which fixes the ui
test and brings `--enable-vendor` builds closer to normal ones.
2024-03-22 17:30:43 +00:00
Michael Goulet
3361488681 Always encode implied_predicates query for traits
With associated type bounds enabled, the implied_predicates and super_predicates
queries may differ for traits, since associated type bounds are also
implied but are not counted as super predicates.
2024-03-22 13:20:54 -04:00
Michael Goulet
c855bf62d7 Add a test 2024-03-22 13:20:54 -04:00
Jack Wrenn
2de9010f66 Add tag_for_variant query
This query allows for sharing code between `rustc_const_eval` and
`rustc_transmutability`.

Also moves `DummyMachine` to `rustc_const_eval`.
2024-03-22 17:01:49 +00:00
bors
b3df0d7e5e Auto merge of #122580 - saethlin:compiler-builtins-can-panic, r=pnkfelix
"Handle" calls to upstream monomorphizations in compiler_builtins

This is pretty cooked, but I think it works.

compiler-builtins has a long-standing problem that at link time, its rlib cannot contain any calls to `core`. And yet, in codegen we _love_ inserting calls to symbols in `core`, generally from various panic entrypoints.

I intend this PR to attack that problem as completely as possible. When we generate a function call, we now check if we are generating a function call from `compiler_builtins` and whether the callee is a function which was not lowered in the current crate, meaning we will have to link to it.

If those conditions are met, actually generating the call is asking for a linker error. So we don't. If the callee diverges, we lower to an abort with the same behavior as `core::intrinsics::abort`. If the callee does not diverge, we produce an error. This means that compiler-builtins can contain panics, but they'll SIGILL instead of panicking. I made non-diverging calls a compile error because I'm guessing that they'd mostly get into compiler-builtins by someone making a mistake while working on the crate, and compile errors are better than linker errors. We could turn such calls into aborts as well if that's preferred.
2024-03-22 16:55:11 +00:00
Matthias Krüger
2171243b2b add test for #105210 assertion failure self.lines.iter().all(|r| !r.iter().any(|sc| sc.chr == \'\\t\')) with edition 2021
Fixes #105210
2024-03-22 17:25:57 +01:00
Matthias Krüger
5b5dec338d add test for #97725
Fixes #97725
2024-03-22 17:12:43 +01:00
Santiago Pastorino
ada6c1680d
Adjust better spastorino membership to triagebot's adhoc_groups 2024-03-22 12:28:34 -03:00