Commit Graph

251270 Commits

Author SHA1 Message Date
Matthias Krüger
a18da0088e
Rollup merge of #123187 - yedayak:relnotes-1.77.1, r=Mark-Simulacrum
Forward port 1.77.1 release notes
2024-03-29 15:17:11 +01:00
Matthias Krüger
b48411bcd4
Rollup merge of #123186 - onur-ozkan:llvm-library-bug, r=Kobzol
copy any file from stage0/lib to stage0-sysroot/lib

With the LLVM 18 upgrade, the name of the LLVM library has been changed to something like `libLLVM.so.18.1-rust-1.78.0-beta`, which `is_dylib` function cannot determine as it only looks whether files are ending with ".so" or not.
This change resolves this problem by no longer doing that ".so" check, as we need all files from the stage0/lib as they are all dependency of rustc anyway.

Fixes #122913
2024-03-29 15:17:10 +01:00
Matthias Krüger
73a4208638
Rollup merge of #123176 - celinval:smir-field-ty, r=oli-obk
Normalize the result of `Fields::ty_with_args`

We were only instantiating before, which would leak an AliasTy. I added a test case that reproduce the issue seen here:

https://github.com/model-checking/kani/issues/3113

r? ``@oli-obk``
2024-03-29 15:17:10 +01:00
bors
685927aae6 Auto merge of #122450 - Urgau:simplify-trim-paths-feature, r=michaelwoerister
Simplify trim-paths feature by merging all debuginfo options together

This PR simplifies the trim-paths feature by merging all debuginfo options together, as described in https://github.com/rust-lang/rust/issues/111540#issuecomment-1994010274.

And also do some correctness fixes found during the review.

cc `@weihanglo`
r? `@michaelwoerister`
2024-03-29 14:00:21 +00:00
bors
9d84142ef2 Auto merge of #16974 - dfireBird:generic_params_refactor, r=lnicola
refactor: Implement len and is_empty method in generic_params
2024-03-29 13:15:08 +00:00
dfireBird
69c4ac6304
implement len and is_empty method in generic_params 2024-03-29 18:26:46 +05:30
bors
45796d1c24 Auto merge of #123080 - Jules-Bertholet:mut-ref-mut, r=Nadrieril
Match ergonomics 2024: implement mutable by-reference bindings

Implements the mutable by-reference bindings portion of match ergonomics 2024 (#123076), with the `mut ref`/`mut ref mut` syntax, under feature gate `mut_ref`.

r? `@Nadrieril`

`@rustbot` label A-patterns A-edition-2024
2024-03-29 11:08:11 +00:00
bors
58dcd1fdb9 Auto merge of #123071 - rcvalle:rust-cfi-fix-method-fn-ptr-cast, r=compiler-errors
CFI: Fix methods as function pointer cast

Fix casting between methods and function pointers by assigning a secondary type id to methods with their concrete self so they can be used as function pointers.

This was split off from #116404.

cc `@compiler-errors` `@workingjubilee`
2024-03-29 09:04:05 +00:00
Jakub Beránek
a4087b7915
Log BOLT args in bootstrap rustc shim 2024-03-29 09:36:56 +01:00
Yedaya Katsman
5eb78c515c Forward port 1.77.1 release notes 2024-03-29 10:44:19 +03:00
onur-ozkan
5fe364afdd copy any file from stage0/lib to stage0-sysroot/lib
With the LLVM 18 upgrade, the name of the LLVM library has been changed to something like
`libLLVM.so.18.1-rust-1.78.0-beta`, which `is_dylib` function cannot determine as it only
looks whether files are ending with ".so" or not.
This change resolves this problem by no longer doing that ".so" check, as we need all files
from the stage0/lib as they are all dependency of rustc anyway.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-03-29 10:07:44 +03:00
bors
1c19595575 Auto merge of #122616 - Jules-Bertholet:casemappingiter-layout, r=Nilstrieb
Optimize `core::char::CaseMappingIter`

Godbolt says this saves a few instructions…

`@rustbot` label T-libs A-layout C-optimization
2024-03-29 07:02:56 +00:00
bors
eae940fcef Auto merge of #3427 - rust-lang:rustup-2024-03-29, r=saethlin
Automatic Rustup
2024-03-29 06:16:56 +00:00
The Miri Cronjob Bot
ed29546a27 Merge from rustc 2024-03-29 05:02:09 +00:00
The Miri Cronjob Bot
29a59beaa6 Preparing for merge from rustc 2024-03-29 04:54:51 +00:00
Stepan Koltsov
b110cb3dc6 Require Debug for Pointee::Metadata
Useful for debugging
2024-03-29 03:53:29 +00:00
bors
760e567af5 Auto merge of #122975 - DianQK:simplify_ub_check, r=saethlin
Eliminate `UbChecks` for non-standard libraries

 The purpose of this PR is to allow other passes to treat `UbChecks` as constants in MIR for optimization after #122629.

r? RalfJung
2024-03-29 02:25:43 +00:00
bors
a8b7acf22f Auto merge of #16971 - HKalbasi:test-explorer, r=HKalbasi
Resolve tests per file instead of per crate in test explorer

Fix part of #16827
2024-03-29 02:06:22 +00:00
hkalbasi
beec6914c8 Resolve tests per file instead of per crate in test explorer 2024-03-29 05:34:43 +03:30
bors
db2f9759f4 Auto merge of #122671 - Mark-Simulacrum:const-panic-msg, r=Nilstrieb
Codegen const panic messages as function calls

This skips emitting extra arguments at every callsite (of which there
can be many). For a librustc_driver build with overflow checks enabled,
this cuts 0.7MB from the resulting shared library (see [perf]).

A sample improvement from nightly:

```
        leaq    str.0(%rip), %rdi
        leaq    .Lalloc_d6aeb8e2aa19de39a7f0e861c998af13(%rip), %rdx
        movl    $25, %esi
        callq   *_ZN4core9panicking5panic17h17cabb89c5bcc999E@GOTPCREL(%rip)
```

to this PR:

```
        leaq    .Lalloc_d6aeb8e2aa19de39a7f0e861c998af13(%rip), %rdi
        callq   *_RNvNtNtCsduqIKoij8JB_4core9panicking11panic_const23panic_const_div_by_zero@GOTPCREL(%rip)
```

[perf]: https://perf.rust-lang.org/compare.html?start=a7e4de13c1785819f4d61da41f6704ed69d5f203&end=64fbb4f0b2d621ff46d559d1e9f5ad89a8d7789b&stat=instructions:u
2024-03-29 00:24:01 +00:00
Cai Bear
aba592d09c Rename reserve_for_push to grow_one and fix comment. 2024-03-28 16:38:01 -07:00
Cai Bear
78dc89b0d5 Fix previous. 2024-03-28 16:21:54 -07:00
Cai Bear
18d390883e Remove len argument from RawVec::reserve_for_push because it's always equal to capacity. Also make Vec::insert use reserve_for_push. 2024-03-28 16:21:54 -07:00
bors
d74804636f Auto merge of #123178 - Nilstrieb:🥷-build, r=Mark-Simulacrum
Update ninja on Windows

Errors started showing up, and I read somewhere that this might be because of old ninja versions. This ninja version is indeed *ancient*.

```
multiple outputs aren't (yet?) supported by depslog; bring this up on the mailing list if it affects you
```

This requires someone uploading https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip as `2024-03-28-v1.11.1-ninja-win.zip`.

should end https://github.com/rust-lang/rust/pull/122671#issuecomment-2026178791
2024-03-28 22:16:03 +00:00
Nilstrieb
b546764cbe Update ninja on Windows
Errors started showing up, and I read somewhere that this might be
because of old ninja versions. This ninja version is indeed *ancient*.

```
multiple outputs aren't (yet?) supported by depslog; bring this up on the mailing list if it affects you
```
2024-03-28 22:54:20 +01:00
Ralf Jung
fd7909aa59 x.py test miri: respect --no-doc / --doc 2024-03-28 22:46:25 +01:00
Celina G. Val
a325bce3cd Normalize the result of Fields::ty_with_args
We were only instantiating before, which would leak an AliasTy.
I added a test case that reproduce the issue seen here:

https://github.com/model-checking/kani/issues/3113
2024-03-28 13:22:10 -07:00
Trevor Gross
d7d5fc9734 Add basic trait impls for f16 and f128
Split off part of <https://github.com/rust-lang/rust/pull/122470> so the
compiler doesn't ICE because it expects primitives to have some minimal
traits.

Fixes <https://github.com/rust-lang/rust/issues/123074>
2024-03-28 15:02:51 -04:00
bors
ba527200cc Auto merge of #123171 - matthiaskrgr:rollup-7id2r8o, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #123063 (Function ABI is irrelevant for reachability)
 - #123096 (Don't check match scrutinee of postfix match for unused parens)
 - #123146 (Use compiletest directives instead of manually checking TARGET / tools)
 - #123160 (remove `def_id_to_node_id` in ast lowering)
 - #123162 (Correctly get complete intra-doc link data)
 - #123164 (Bump Unicode printables to version 15.1, align to unicode_data)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-03-28 18:27:54 +00:00
Urgau
fefb8f1f9c Replace Session should_remap_filepaths with filename_display_preference 2024-03-28 18:47:26 +01:00
Urgau
4f4fa42b0e Introduce FileNameMapping::to_real_filename and use it everywhere 2024-03-28 18:47:26 +01:00
Urgau
ee2898d3f1 Make local_crate_source_file return a RealFileName
so it can be remapped (or not) by callers
2024-03-28 18:47:26 +01:00
Urgau
106146fd95 Replace RemapFileNameExt::for_codegen with explicit calls 2024-03-28 18:47:26 +01:00
Urgau
777c6b46cc Simplify trim-paths feature by merging all debuginfo options together 2024-03-28 18:47:26 +01:00
bors
ab10eea62e Auto merge of #16967 - dfireBird:fix-16963, r=lnicola
fix: ADT hover considering only type or const len not lifetimes

I feel like test doesn't do much. Please suggest if I should improve it?

Fixes #16963
2024-03-28 16:45:45 +00:00
Matthias Krüger
83b4d3d638
Rollup merge of #123164 - Marcondiro:unicode15-1, r=Manishearth
Bump Unicode printables to version 15.1, align to unicode_data

r? `@Manishearth`
Thanks!
2024-03-28 17:40:51 +01:00
Matthias Krüger
cba164c518
Rollup merge of #123162 - GuillaumeGomez:fix-123158, r=notriddle
Correctly get complete intra-doc link data

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

The problem was that we didn't take into account cases where there would be content other than backticks into the intra doc link definition.

r? `@notriddle`
2024-03-28 17:40:51 +01:00
Matthias Krüger
1ec73f0c4c
Rollup merge of #123160 - bvanjoi:cleanup, r=compiler-errors
remove `def_id_to_node_id` in ast lowering
2024-03-28 17:40:50 +01:00
Matthias Krüger
d1630e535f
Rollup merge of #123146 - jieyouxu:use-compiletest-directives, r=clubby789
Use compiletest directives instead of manually checking TARGET / tools

Changes:

- Accept `ignore-wasm32-wasip1` and `needs-wasmtime` directives.
- Add support for needing `wasmtime` as a runner.
- Update wasm/compiler_builtin tests to use compiletest directives over manual checks.
2024-03-28 17:40:50 +01:00
Matthias Krüger
69cfe80834
Rollup merge of #123096 - compiler-errors:postfix-match-parens, r=fmease
Don't check match scrutinee of postfix match for unused parens

We only check the scrutinees of block-like constructs and a few others (return/index/assign/method calls). Just don't do it for postfix match at all.

Fixes #123064

r? fmease
2024-03-28 17:40:49 +01:00
Matthias Krüger
732ded92a0
Rollup merge of #123063 - tmiasko:reachability-abi, r=michaelwoerister
Function ABI is irrelevant for reachability
2024-03-28 17:40:49 +01:00
Michael Goulet
6439c7fe23 Require foldability part of interner item bounds, remove redundant where clauses 2024-03-28 12:30:52 -04:00
Michael Goulet
08c7ff2264 Restrict const ty's regions to static when putting them in canonical var list 2024-03-28 12:30:52 -04:00
dfireBird
34a8cd6a7a
fix ADT hover considering only type or const len not lifetimes 2024-03-28 21:53:22 +05:30
bors
929bceeaf8 Auto merge of #123167 - DianQK:test-simd-wide-sum, r=scottmcm
Restore the test checks for `wider_reduce_into_iter`

The current minimum support is for LLVM 17. Context: https://github.com/rust-lang/rust/pull/116018#discussion_r1348353459.

r? scottmcm
2024-03-28 16:23:04 +00:00
klensy
8245718503 and more
warning: this argument is a mutable reference, but not used mutably
    --> compiler\rustc_mir_transform\src\coroutine.rs:1229:11
     |
1229 |     body: &mut Body<'tcx>,
     |           ^^^^^^^^^^^^^^^ help: consider changing to: `&Body<'tcx>`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
   --> compiler\rustc_mir_transform\src\nrvo.rs:123:11
    |
123 |     body: &mut mir::Body<'_>,
    |           ^^^^^^^^^^^^^^^^^^ help: consider changing to: `&mir::Body<'_>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
  --> compiler\rustc_mir_transform\src\nrvo.rs:87:34
   |
87 | fn local_eligible_for_nrvo(body: &mut mir::Body<'_>) -> Option<Local> {
   |                                  ^^^^^^^^^^^^^^^^^^ help: consider changing to: `&mir::Body<'_>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
2024-03-28 17:19:15 +03:00
bors
c5e7f45b62 Auto merge of #115220 - Zoxc:revive-gcx-ptr, r=oli-obk
Add a `CurrentGcx` type to let the deadlock handler access `TyCtxt`

This brings back `GCX_PTR` (previously removed in https://github.com/rust-lang/rust/pull/74969) allowing the deadlock handler access to `GlobalCtxt`. This fixes https://github.com/rust-lang/rust/issues/111522.

r? `@cjgillot`
2024-03-28 14:00:08 +00:00
klensy
9a6b3dfc06 and few more
maybe bug here?

warning: this argument is a mutable reference, but not used mutably
    --> compiler\rustc_borrowck\src\diagnostics\conflict_errors.rs:3857:35
     |
3857 |     pub(crate) fn emit(&self, cx: &mut MirBorrowckCtxt<'_, 'tcx>, diag: &mut Diag<'_>) -> String {
     |                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&MirBorrowckCtxt<'_, 'tcx>`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
   --> compiler\rustc_borrowck\src\type_check\liveness\trace.rs:601:17
    |
601 |         typeck: &mut TypeChecker<'_, 'tcx>,
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&TypeChecker<'_, 'tcx>`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
2024-03-28 16:57:32 +03:00
DianQK
ec359f7d9f
Restore the test checks for wider_reduce_into_iter
The current minimum support is for LLVM 17.
2024-03-28 21:28:45 +08:00
klensy
5488e492af and few more
warning: this argument is a mutable reference, but not used mutably
  --> compiler\rustc_codegen_ssa\src\back\rpath.rs:80:41
   |
80 | fn get_rpath_relative_to_output(config: &mut RPathConfig<'_>, lib: &Path) -> OsString {
   |                                         ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
  --> compiler\rustc_codegen_ssa\src\back\rpath.rs:76:42
   |
76 | fn get_rpaths_relative_to_output(config: &mut RPathConfig<'_>) -> Vec<OsString> {
   |                                          ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
  --> compiler\rustc_codegen_ssa\src\back\rpath.rs:55:23
   |
55 | fn get_rpaths(config: &mut RPathConfig<'_>) -> Vec<OsString> {
   |                       ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

warning: this argument is a mutable reference, but not used mutably
  --> compiler\rustc_codegen_ssa\src\back\rpath.rs:15:32
   |
15 | pub fn get_rpath_flags(config: &mut RPathConfig<'_>) -> Vec<OsString> {
   |                                ^^^^^^^^^^^^^^^^^^^^ help: consider changing to: `&RPathConfig<'_>`
   |
   = warning: changing this function will impact semver compatibility
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut
2024-03-28 16:26:37 +03:00