Commit Graph

3606 Commits

Author SHA1 Message Date
Matthias Krüger
2ad8e1fb51 Rollup merge of #108856 - Zeegomo:remove-drop-and-rep, r=tmiasko
Remove DropAndReplace terminator

#107844 made DropAndReplace unused, let's remove it completely from the codebase.
2023-03-08 21:26:51 +01:00
bjorn3
22237ed225 Update Cranelift to 0.93.1
This fixes a potential miscompilation
2023-03-08 20:56:50 +01:00
Giacomo Pasini
bd84d88cd1 Remove DropAndReplace terminator
PR 107844 made DropAndReplace unused, let's remove it completely
from the codebase.
2023-03-07 14:25:22 +01:00
bors
792933c8d7 Auto merge of #95317 - Jules-Bertholet:round_ties_to_even, r=pnkfelix,m-ou-se,scottmcm
Add `round_ties_even` to `f32` and `f64`

Tracking issue: #96710

Redux of #82273. See also #55107

Adds a new method, `round_ties_even`, to `f32` and `f64`, that rounds the float to the nearest integer , rounding halfway cases to the number with an even least significant bit. Uses the `roundeven` LLVM intrinsic to do this.

Of the five IEEE 754 rounding modes, this is the only one that doesn't already have a round-to-integer function exposed by Rust (others are `round`, `floor`, `ceil`, and `trunc`).  Ties-to-even is also the rounding mode used for int-to-float and float-to-float `as` casts, as well as float arithmentic operations. So not having an explicit rounding method for it seems like an oversight.

Bikeshed: this PR currently uses `round_ties_even` for the name of the method. But maybe `round_ties_to_even` is better, or `round_even`, or `round_to_even`?
2023-03-07 09:43:12 +00:00
bjorn3
1ed6b05145 Remove copy_nonoverlapping intrinsic definition
It has been getting lowered to a dedicated MIR statement for a while
2023-03-05 19:50:21 +00:00
bjorn3
906b00e111 Fix rustc test suite 2023-03-04 12:59:27 +00:00
bjorn3
4be2be2245 Rustfmt 2023-03-04 12:48:34 +01:00
bjorn3
7bf863653b Rustup to rustc 1.69.0-nightly (44cfafe2f 2023-03-03) 2023-03-04 12:46:45 +01:00
bjorn3
cceea847dd Sync from rust 44cfafe2fa 2023-03-04 12:36:27 +01:00
bjorn3
162365e3d6 Fix loading of dylibs not in the search path in jit mode
Reported in #1249
2023-02-28 14:36:44 +00:00
Camille GILLOT
760275d81e Implement checked Shl/Shr at MIR building. 2023-02-27 19:25:16 +00:00
Nilstrieb
1b57cb6762 Unify all validity check intrinsics
Also merges the inhabitedness check into the query to further unify the
code paths.
2023-02-27 13:30:44 +00:00
Matthias Krüger
32317b5a5b Rollup merge of #108364 - Nilstrieb:validity-checks-refactor, r=compiler-errors
Unify validity checks into a single query

Previously, there were two queries to check whether a type allows the 0x01 or zeroed bitpattern.

I am planning on adding a further initness to check in #100423, truly uninit for MaybeUninit, which would make this three queries. This seems overkill for such a small feature, so this PR unifies them into one.

I am not entirely happy with the naming and key type and open for improvements.

r? oli-obk
2023-02-27 06:11:52 +01:00
bjorn3
9e7c646319 Merge branch 'staging' 2023-02-26 17:57:03 +00:00
bjorn3
b88e129915 Avoid a duplicate "[TEST] rust-random/rand" 2023-02-26 17:37:29 +00:00
bjorn3
c615e9248a Run tests for all crates in the regex workspace 2023-02-26 17:35:53 +00:00
bjorn3
b193419ec7 Allow multiple threads and panicking tests when testing regex
I guess this was a leftover from very early in the development of
cg_clif. Allowing multiple threads significantly improves performance,
while panicking tests can run now thanks to -Zpanic-abort-tests.
2023-02-26 16:50:08 +00:00
bjorn3
19ed2139a3 Remove no longer necessary code removing "[codegen mono items]" from test output 2023-02-26 14:34:36 +00:00
bjorn3
5e6cde150e Remove --cap-lint warn from regex test 2023-02-26 14:34:36 +00:00
bjorn3
7a864c8ef5 Update test repo versions 2023-02-26 14:34:28 +00:00
bjorn3
aea3bd6641 Re-enable DataflowConstProp for standard library builds 2023-02-26 13:01:47 +00:00
bjorn3
91979e01cf Rustup to rustc 1.69.0-nightly (34e6673a0 2023-02-25) 2023-02-26 13:36:16 +01:00
bjorn3
83222f18f4 Sync from rust 34e6673a04 2023-02-26 13:26:37 +01:00
bjorn3
a45a81a6a2 Patch coretests separately from the standard library source 2023-02-26 12:15:25 +00:00
bjorn3
f79601fbb0 Reduce verbosity of rand testing 2023-02-25 18:01:42 +00:00
bjorn3
be19c03e69 Silence almost all warnings when compiling coretests 2023-02-25 17:54:01 +00:00
bjorn3
26d0d255ce Reduce verbosity of libcore testing 2023-02-25 17:48:45 +00:00
bjorn3
fdfa277158 Rustup to rustc 1.69.0-nightly (c5c7d2b37 2023-02-24) 2023-02-25 18:17:06 +01:00
bjorn3
d53964130f Sync from rust c5c7d2b377 2023-02-25 18:10:33 +01:00
Nicholas Nethercote
eb84167837 Rename many interner functions.
(This is a large commit. The changes to
`compiler/rustc_middle/src/ty/context.rs` are the most important ones.)

The current naming scheme is a mess, with a mix of `_intern_`, `intern_`
and `mk_` prefixes, with little consistency. In particular, in many
cases it's easy to use an iterator interner when a (preferable) slice
interner is available.

The guiding principles of the new naming system:
- No `_intern_` prefixes.
- The `intern_` prefix is for internal operations.
- The `mk_` prefix is for external operations.
- For cases where there is a slice interner and an iterator interner,
  the former is `mk_foo` and the latter is `mk_foo_from_iter`.

Also, `slice_interners!` and `direct_interners!` can now be `pub` or
non-`pub`, which helps enforce the internal/external operations
division.

It's not perfect, but I think it's a clear improvement.

The following lists show everything that was renamed.

slice_interners
- const_list
  - mk_const_list -> mk_const_list_from_iter
  - intern_const_list -> mk_const_list
- substs
  - mk_substs -> mk_substs_from_iter
  - intern_substs -> mk_substs
  - check_substs -> check_and_mk_substs (this is a weird one)
- canonical_var_infos
  - intern_canonical_var_infos -> mk_canonical_var_infos
- poly_existential_predicates
  - mk_poly_existential_predicates -> mk_poly_existential_predicates_from_iter
  - intern_poly_existential_predicates -> mk_poly_existential_predicates
  - _intern_poly_existential_predicates -> intern_poly_existential_predicates
- predicates
  - mk_predicates -> mk_predicates_from_iter
  - intern_predicates -> mk_predicates
  - _intern_predicates -> intern_predicates
- projs
  - intern_projs -> mk_projs
- place_elems
  - mk_place_elems -> mk_place_elems_from_iter
  - intern_place_elems -> mk_place_elems
- bound_variable_kinds
  - mk_bound_variable_kinds -> mk_bound_variable_kinds_from_iter
  - intern_bound_variable_kinds -> mk_bound_variable_kinds

direct_interners
- region
  - intern_region (unchanged)
- const
  - mk_const_internal -> intern_const
- const_allocation
  - intern_const_alloc -> mk_const_alloc
- layout
  - intern_layout -> mk_layout
- adt_def
  - intern_adt_def -> mk_adt_def_from_data (unusual case, hard to avoid)
  - alloc_adt_def(!) -> mk_adt_def
- external_constraints
  - intern_external_constraints -> mk_external_constraints

Other
- type_list
  - mk_type_list -> mk_type_list_from_iter
  - intern_type_list -> mk_type_list
- tup
  - mk_tup -> mk_tup_from_iter
  - intern_tup -> mk_tup
2023-02-24 07:32:24 +11:00
Nilstrieb
4036a5722a Unify validity checks into a single query
Previously, there were two queries to check whether a type allows the
0x01 or zeroed bitpattern.

I am planning on adding a further initness to check, truly uninit for
MaybeUninit, which would make this three queries. This seems overkill
for such a small feature, so this PR unifies them into one.
2023-02-23 18:42:36 +00:00
bors
f31fc31dd4 Auto merge of #108340 - eggyal:remove_traversal_trait_aliases, r=oli-obk
Remove type-traversal trait aliases

#107924 moved the type traversal (folding and visiting) traits into the type library, but created trait aliases in `rustc_middle` to minimise both the API churn for trait consumers and the arising boilerplate.  As mentioned in that PR, an alternative approach of defining subtraits with blanket implementations of the respective supertraits was also considered at that time but was ruled out as not adding much value.

Unfortunately, it has since emerged that rust-analyzer has difficulty with these trait aliases at present, resulting in a degraded contributor experience (see the recent [r-a has become useless](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/r-a.20has.20become.20useless) topic on the #t-compiler/help Zulip stream).

This PR removes the trait aliases, and accordingly the underlying type library traits are now used directly; they are parameterised by `TyCtxt<'tcx>` rather than just the `'tcx` lifetime, and imports have been updated to reflect the fact that the trait aliases' explicitly named traits are no longer automatically brought into scope.  These changes also roll-back the (no-longer required) workarounds to #107747 that were made in b409329c62.

Since this PR is just a find+replace together with the changes necessary for compilation & tidy to pass, it's currently just one mega-commit.  Let me know if you'd like it broken up.

r? `@oli-obk`
2023-02-22 18:26:51 +00:00
Alan Egerton
d9751e46c7 Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
David Wood
93fdcfa554 various: translation resources from cg backend
Extend `CodegenBackend` trait with a function returning the translation
resources from the codegen backend, which can be added to the complete
list of resources provided to the emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
2023-02-22 09:15:54 +00:00
bjorn3
a563e11918 Update Cranelift to 0.93.0
Closes #1352
2023-02-20 17:18:13 +00:00
bjorn3
10c3c7207b Rustup to rustc 1.69.0-nightly (7aa413d59 2023-02-19) 2023-02-20 12:33:39 +01:00
bjorn3
92657711f7 Sync from rust 7aa413d592 2023-02-20 12:24:00 +01:00
bjorn3
5220e60ac6 Rename build job to test 2023-02-19 18:23:49 +00:00
bjorn3
c6f48ebb1d Fix warning 2023-02-19 18:22:15 +00:00
bjorn3
90298f1301 Only allow a single abi-cafe run at a time per branch 2023-02-19 18:08:54 +00:00
bjorn3
f935dc82bc Move abi-cafe runs to a separate workflow 2023-02-19 18:02:18 +00:00
bjorn3
37c269e16a Fix typo 2023-02-19 17:56:34 +00:00
bjorn3
1af867cdf7 Add test for #1318 2023-02-19 17:55:35 +00:00
bjorn3
916a6c17df Update portable-simd 2023-02-19 17:46:51 +00:00
bjorn3
ef6df7e814 Handle wrappers around dyn* in receiver types
Fixes #1324
2023-02-19 17:41:08 +00:00
bjorn3
9e6dfba383 Allow codegen to unsize dyn* to dyn
cg_clif counterpart to rust-lang/rust#106532
2023-02-19 17:22:03 +00:00
bjorn3
b08762493c Fix warnings 2023-02-19 17:11:28 +00:00
bjorn3
c794dc7255 Enable inline stack probes on riscv64
Fixes #1358
2023-02-19 17:08:52 +00:00
bjorn3
98ddd69aae Add wrappers to dist/bin/ too in addition to dist/
Rust's build system since recently expects rustc to be in a bin/
directory if it is specified using the rustc option in config.toml.
2023-02-19 15:28:01 +00:00
bjorn3
746008e791 Rustup to rustc 1.69.0-nightly (4507fdaaa 2023-02-18) 2023-02-19 10:41:09 +01:00