Santiago Pastorino
0e69a8ad20
Add all_trait_decls to SMIR
2023-08-07 10:24:11 -03:00
Santiago Pastorino
496faa857c
Convert trait declaration to SMIR
2023-08-07 10:24:08 -03:00
Santiago Pastorino
4199a3c13a
Convert unsafety using the stable method and reuse mir::Safety
2023-08-07 10:23:20 -03:00
Benedikt Radtke
3f3262e592
stabilize abi_thiscall
2023-08-07 14:11:03 +02:00
Vadim Petrochenkov
b6ac576487
rustc_interface: Dismantle register_plugins query
2023-08-07 19:33:23 +08:00
Deadbeef
1ca4bc966e
Migrate a trait selection error to use diagnostic translation
2023-08-07 05:26:38 +00:00
Matthias Krüger
d804b74c6c
Rollup merge of #114549 - chenyukang:yukang-review-resolve-part, r=petrochenkov
...
Style fix and refactor on resolve diagnostics
- coding style
- refactor api of `span_look_ahead`
2023-08-07 05:29:13 +02:00
Matthias Krüger
cbe2522652
Rollup merge of #114382 - scottmcm:compare-bytes-intrinsic, r=cjgillot
...
Add a new `compare_bytes` intrinsic instead of calling `memcmp` directly
As discussed in #113435 , this lets the backends be the place that can have the "don't call the function if n == 0" logic, if it's needed for the target. (I didn't actually *add* those checks, though, since as I understood it we didn't actually need them on known targets?)
Doing this also let me make it `const` (unstable), which I don't think `extern "C" fn memcmp` can be.
cc `@RalfJung` `@Amanieu`
2023-08-07 05:29:12 +02:00
bors
72c6b8d36f
Auto merge of #114565 - matthiaskrgr:rollup-p7cjs3m, r=matthiaskrgr
...
Rollup of 6 pull requests
Successful merges:
- #114535 (bump schannel, miow to drop windows-sys 0.42)
- #114542 (interpret: use ConstPropNonsense for more const-prop induced issues)
- #114543 (add tests for some fixed ConstProp ICEs)
- #114550 (Generate better function argument names in global_allocator expansion)
- #114556 (Issue numbers are enforced on active features; remove FIXME)
- #114558 (Remove FIXME about NLL diagnostic that is already improved)
Failed merges:
- #114485 (Add trait decls to SMIR)
r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-06 23:44:08 +00:00
scottmcm
75277a6606
Apply suggestions from code review
...
Co-authored-by: Ralf Jung <post@ralfj.de >
2023-08-06 15:47:40 -07:00
Scott McMurray
502af03445
Add a new compare_bytes intrinsic instead of calling memcmp directly
2023-08-06 15:47:40 -07:00
Matthias Krüger
44479d1b35
Rollup merge of #114556 - Enselic:issue-numbers-enforced, r=compiler-errors
...
Issue numbers are enforced on active features; remove FIXME
Since https://github.com/rust-lang/rust/pull/51090 tidy enforces that active features have an issue number, so remove the FIXME.
This PR is part of #44366 which is E-help-wanted.
2023-08-07 00:06:07 +02:00
Matthias Krüger
1ea9951b43
Rollup merge of #114550 - dtolnay:globalalloc, r=compiler-errors
...
Generate better function argument names in global_allocator expansion
Generated code for `#[global_allocator] static ALLOCATOR: Allocator = Allocator;`—
**Before:**
```rust
const _: () = {
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc(arg0: usize, arg1: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(arg0, arg1),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_dealloc(arg0: *mut u8, arg1: usize, arg2: usize) -> () {
::core::alloc::GlobalAlloc::dealloc(
&ALLOCATOR,
arg0,
::core::alloc::Layout::from_size_align_unchecked(arg1, arg2),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_realloc(
arg0: *mut u8,
arg1: usize,
arg2: usize,
arg3: usize,
) -> *mut u8 {
::core::alloc::GlobalAlloc::realloc(
&ALLOCATOR,
arg0,
::core::alloc::Layout::from_size_align_unchecked(arg1, arg2),
arg3,
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc_zeroed(arg0: usize, arg1: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc_zeroed(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(arg0, arg1),
)
}
};
```
**After:**
```rust
const _: () = {
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc(size: usize, align: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(size, align),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize) -> () {
::core::alloc::GlobalAlloc::dealloc(
&ALLOCATOR,
ptr,
::core::alloc::Layout::from_size_align_unchecked(size, align),
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_realloc(
ptr: *mut u8,
size: usize,
align: usize,
new_size: usize,
) -> *mut u8 {
::core::alloc::GlobalAlloc::realloc(
&ALLOCATOR,
ptr,
::core::alloc::Layout::from_size_align_unchecked(size, align),
new_size,
)
}
#[rustc_std_internal_symbol]
unsafe fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8 {
::core::alloc::GlobalAlloc::alloc_zeroed(
&ALLOCATOR,
::core::alloc::Layout::from_size_align_unchecked(size, align),
)
}
};
```
2023-08-07 00:06:07 +02:00
Matthias Krüger
74dce18639
Rollup merge of #114542 - RalfJung:const-prop-nonsense, r=compiler-errors
...
interpret: use ConstPropNonsense for more const-prop induced issues
2023-08-07 00:06:06 +02:00
bors
f3623871cf
Auto merge of #114502 - cjgillot:steal-ctfe, r=oli-obk
...
Steal MIR for CTFE when possible.
Some bodies, like constants, have CTFE MIR but no optimized MIR.
In that case, have `mir_for_ctfe` steal the MIR instead of cloning it.
2023-08-06 22:02:12 +00:00
bors
85fbb57149
Auto merge of #114553 - matthiaskrgr:rollup-5yddunv, r=matthiaskrgr
...
Rollup of 5 pull requests
Successful merges:
- #114466 (Add Allocation to SMIR)
- #114505 (Add documentation to has_deref)
- #114519 (use offset_of! to calculate dirent64 field offsets)
- #114537 (Migrate GUI colors test to original CSS color format)
- #114539 (linkchecker: Remove unneeded FIXME about intra-doc links)
Failed merges:
- #114485 (Add trait decls to SMIR)
r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-06 19:46:31 +00:00
Ralf Jung
997ec63fb1
simplify handling of valtrees for unsized types
2023-08-06 21:25:49 +02:00
Ralf Jung
b6e3bc23ef
remove an unnecessary special case in valtree_into_mplace
2023-08-06 21:25:49 +02:00
bors
5973bfbd38
Auto merge of #114516 - cjgillot:direct-module-parent, r=compiler-errors
...
parent_module_from_def_id does not need to be a query.
r? `@ghost`
2023-08-06 18:04:04 +00:00
Martin Nordholts
2b9876bd6d
Issue numbers are enforced on active features; remove FIXME
2023-08-06 20:01:23 +02:00
est31
4b1bc27010
Improve diagnostics and add tests for function calls
2023-08-06 19:08:14 +02:00
Matthias Krüger
13de583583
Rollup merge of #114505 - ouz-a:cleanup_mir, r=RalfJung
...
Add documentation to has_deref
Documentation of `has_deref` needed some polish to be more clear about where it should be used and what's it's purpose.
cc https://github.com/rust-lang/rust/issues/114401
r? `@RalfJung`
2023-08-06 17:26:29 +02:00
Matthias Krüger
92c04217ba
Rollup merge of #114466 - ouz-a:smir_allocation, r=oli-obk
...
Add Allocation to SMIR
As it's discussed [here ](https://rust-lang.zulipchat.com/#narrow/stream/320896-project-stable-mir/topic/Representing.20Constants.20in.20smir )this is an attempt to cover Constants for smir in a different way compared to https://github.com/rust-lang/rust/pull/114342
cc https://github.com/rust-lang/project-stable-mir/issues/15
r? ``@oli-obk``
2023-08-06 17:26:28 +02:00
bors
e59540968e
Auto merge of #113648 - aliemjay:opaque-binder-ice, r=oli-obk
...
don't replace opaque types under binders with infer vars
Fixes an ICE in the ui test code.
Fixes #109636
Fixes #109281
Fixes #86800
r? `@oli-obk`
2023-08-06 15:26:03 +00:00
yukang
eb0fcc5ad1
refactor on span_look_ahead
2023-08-06 22:44:11 +08:00
David Tolnay
704aa56ba0
Generate better function argument names in global_allocator expansion
2023-08-06 07:36:05 -07:00
ouz-a
6df546281b
cleanup misinformation regarding has_deref
2023-08-06 17:29:09 +03:00
Deadbeef
92f4c59e48
lower impl const to bind to host effect param
2023-08-06 13:34:53 +00:00
Ralf Jung
efd54ccf5a
interpret: use ConstPropNonsense for more const-prop induced issues
2023-08-06 15:20:03 +02:00
Ali MJ Al-Nasrawy
2e83a72964
don't replace opaque types under binders with infer vars
2023-08-06 12:08:32 +00:00
ouz-a
b9a539e0a3
Add alocation to smir
2023-08-06 15:06:04 +03:00
bors
bc720ad36b
Auto merge of #114487 - compiler-errors:opaques-refactoring-idk, r=cjgillot
...
Consolidate opaque ty and async fn lowering code
The codepaths for lowering "regular" opaques and async fn were almost identical, modulo some bookkeeping that seemed pretty easy to consolidate.
r? `@cjgillot`
2023-08-06 11:16:31 +00:00
Camille GILLOT
4e2a9b6b6e
Do not mark shallow_lint_levels_on as eval_always.
2023-08-06 10:31:02 +00:00
David Tolnay
e57a89174c
Delete some useless casts from global_allocator expansion
2023-08-05 23:10:38 -07:00
Matthias Krüger
bf4b1d7805
Rollup merge of #114524 - compiler-errors:more-ice-in-uncertainty, r=jackh726
...
Also ICE when goals go from Ok to Err in new solver
We were just using `?` here, silently downgrading the goal's response from (presumably) maybe to error -- that seems concerning, since this whole check is for detecting goal instability 😅
r? `@lcnr` or `@BoxyUwU`
2023-08-06 03:56:10 +02:00
Matthias Krüger
83d84ffdd5
Rollup merge of #114503 - chenyukang:yukang-fix-114433-unused-qualifications, r=compiler-errors
...
Remove invalid lint when there is a generic argument in prefix path
Fixes #114433
2023-08-06 03:56:09 +02:00
Matthias Krüger
1305a43d0a
Rollup merge of #114486 - Urgau:const-context-nan-suggestion-114471, r=compiler-errors
...
Avoid invalid NaN lint machine-applicable suggestion in const context
This PR removes the machine-applicable suggestion in const context for the `invalid_nan_comparision` lint ~~and replace it with a simple help~~.
Fixes https://github.com/rust-lang/rust/issues/114471
2023-08-06 03:56:09 +02:00
bors
8236f63aba
Auto merge of #114476 - Urgau:missing-dep-file-112898, r=oli-obk
...
Fix missing dependency file with `-Zunpretty`
This PR force the `output_filenames` to be run ~~in every early exits like~~ when using `-Zunpretty`, so to respect the `dep-info` flag.
Fixes https://github.com/rust-lang/rust/issues/112898
r? `@oli-obk`
2023-08-06 00:04:52 +00:00
Michael Goulet
3b3e466e36
Add FIXME as reminder to restore suggestion later
2023-08-05 17:04:30 -07:00
est31
8faac74e54
Remove ptr_from_mut diagnostic item
...
It was added by #113657 for its purposes.
Now it is not used any more, remove it,
as we use the attr now.
2023-08-06 00:20:29 +02:00
Urgau
b71f2becb2
Avoid invalid NaN lint machine-applicable suggestion in const context
2023-08-05 23:54:59 +02:00
Camille GILLOT
7a51b30ebd
parent_module_from_def_id does not need to be a query.
2023-08-05 21:23:50 +00:00
Camille GILLOT
02e10a054e
Steal MIR for CTFE when possible.
2023-08-05 21:16:55 +00:00
Michael Goulet
55bf810821
Also report when goals go from ok to error
2023-08-05 20:09:31 +00:00
Michael Goulet
169236ec8a
a function is just another AnonymousCreateParameter rib
2023-08-05 16:53:13 +00:00
Michael Goulet
57a96893f6
Consolidate opaque ty and async fn lowering code
2023-08-05 16:53:13 +00:00
bors
fbc11e9690
Auto merge of #114514 - matthiaskrgr:rollup-1rv4f3h, r=matthiaskrgr
...
Rollup of 3 pull requests
Successful merges:
- #114029 (Explain more clearly why `fn() -> T` can't be `#[derive(Clone)]`)
- #114248 (Make lint missing-copy-implementations honor negative `Copy` impls)
- #114498 (Print tidy command with bless tidy check failure)
r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-05 13:33:57 +00:00
Matthias Krüger
e722f6f3ac
Rollup merge of #114248 - fmease:neg-copy-rules-out-missing-copy-impl, r=b-naber
...
Make lint missing-copy-implementations honor negative `Copy` impls
Fixes #101980 .
``@rustbot`` label A-lint F-negative_impls
2023-08-05 14:00:17 +02:00
bors
28b6607b5f
Auto merge of #109348 - cjgillot:issue-109146, r=petrochenkov
...
Resolve visibility paths as modules not as types.
Asking for a resolution with `opt_ns = Some(TypeNS)` allows path resolution to look for type-relative paths, leaving unresolved segments behind. However, for visibility paths we really need to look for a module, so we need to pass `opt_ns = None`.
Fixes https://github.com/rust-lang/rust/issues/109146
r? `@petrochenkov`
2023-08-05 11:52:07 +00:00
Krasimir Georgiev
9941db4512
llvm-wrapper: adapt for LLVM API changes
...
No functional changes intended.
Adapts llvm-wrapper for 65e57bbed0 .
Found by our experimental rust + llvm @ HEAD CI:
https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/21304#0189c526-86cd-4db9-bdbc-dd0132dfc22b/197-500
2023-08-05 10:54:30 +00:00