Commit Graph

3931 Commits

Author SHA1 Message Date
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
bjorn3
0134916c6e Sync from rust 4507fdaaa2 2023-02-19 10:31:16 +01:00
Camille GILLOT
8996171e88 Stop implementing _with_overflow intrinsics in codegen backends. 2023-02-18 22:06:29 +00:00
Camille GILLOT
39068eb1cc Adapt cg_clif. 2023-02-18 21:35:02 +00:00
bjorn3
cb12ad7397
Merge pull request #1359 from bjorn3/fix_llvm14-builtins-abi
Fix compiler-builtins 0.1.87 on Windows
2023-02-18 19:17:43 +01:00
bjorn3
bb933d26dc Fix abi for checked multiplication 2023-02-18 18:45:27 +01:00
bjorn3
4991d08bc6 Remove incorrect check in lib_call 2023-02-18 16:40:21 +01:00
bjorn3
90a7ee6c70 Check output of checked_div in std_example 2023-02-18 16:40:06 +01:00
bjorn3
a7c0cfc113 Fix return address type 2023-02-18 15:56:26 +01:00
bjorn3
dd5ffc2e18 Split out lib_call_unadjusted function 2023-02-18 15:56:07 +01:00
bjorn3
54648091dd Update to compiler-builtins 0.1.87 2023-02-17 18:46:32 +00:00
bjorn3
29ad465127 Fix float to int compiler builtin call abi 2023-02-17 18:40:22 +00:00
bjorn3
c6a0d3716b Move windows i128 indirect return handling to lib_call 2023-02-17 18:20:34 +00:00
bjorn3
ede7cde065 Move windows i128 argument by-ref handling to lib_call 2023-02-17 18:20:34 +00:00
bjorn3
7bd3b771b0 Add fixme 2023-02-17 18:20:34 +00:00
bjorn3
e58bb2acbd Use new abi for 128bit int to float cast intrinsics on Windows 2023-02-17 18:20:34 +00:00
bjorn3
cdf4f4287a Remove easy_call 2023-02-17 18:20:14 +00:00
bjorn3
718574a53e Support updating to specific dates in rustup.sh
Fixes #1294
2023-02-17 18:55:51 +01:00
bjorn3
3c5d5bab96 Rustup to rustc 1.69.0-nightly (9a7cc6c32 2023-02-16) 2023-02-17 18:55:11 +01:00
bjorn3
8e5a9bb77d Sync from rust 9a7cc6c32f 2023-02-17 18:49:57 +01:00
bjorn3
8ed6baa749 Rustup to rustc 1.69.0-nightly (2d14db321 2023-02-15) 2023-02-17 18:42:33 +01:00
bjorn3
9491031f9a Rustup to rustc 1.69.0-nightly (0416b1a6f 2023-02-14) 2023-02-17 18:42:14 +01:00
bjorn3
afcdf57c00 Sync from rust 0416b1a6f 2023-02-17 18:06:15 +01:00
Nicholas Nethercote
8fe8e53300 Replace mk_foo calls with infer_foo where possible.
There are several `mk_foo`/`intern_foo` pairs, where the former takes an
iterator and the latter takes a slice. (This naming convention is bad,
but that's a fix for another PR.)

This commit changes several `mk_foo` occurrences into `intern_foo`,
avoiding the need for some `.iter()`/`.into_iter()` calls. Affected
cases:
- mk_type_list
- mk_tup
- mk_substs
- mk_const_list
2023-02-17 22:24:31 +11:00
Maybe Waffle
f58bd0e290 if $c:expr { Some($r:expr) } else { None } =>> $c.then(|| $r) 2023-02-16 15:26:00 +00:00
bors
9b99a58301 Auto merge of #108012 - compiler-errors:issue-107999, r=oli-obk
Don't ICE in `might_permit_raw_init` if reference is polymorphic

Emitting optimized MIR for a polymorphic function may require computing layout of a type that isn't (yet) known. This happens in the instcombine pass, for example. Let's fail gracefully in that condition.

cc `@saethlin`
fixes #107999
2023-02-15 20:56:07 +00:00