Commit Graph

231748 Commits

Author SHA1 Message Date
Ralf Jung
09c71a5547 add test for issue #96944 2023-08-06 15:01:48 +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
Martin Nordholts
cf08888630 linkchecker: Remove unneeded FIXME about intra-doc links
It was added by 77971 but the adder proposed in that PR that the added
code is a good fallback to have in case rustdoc gets buggy, and I agree.
So remove the FIXME.
2023-08-06 13:28:43 +02: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
Guillaume Gomez
08ca8246f8 Migrate GUI colors test to original CSS color format 2023-08-06 12:46:35 +02:00
klensy
55935df22d bump schannel, miow to drop windows-sys 0.42 2023-08-06 13:24:59 +03:00
bors
a339ed184f Auto merge of #114528 - dtolnay:globalalloccast, r=cjgillot
Delete some useless casts from global_allocator expansion

These casts are from when #\[global_allocator\] needed to translate back and forth between `*mut u8` and `*mut Opaque`. This should have been cleaned up as part of f6ab74b8e7.

Difference to code generated by `#[global_allocator] static ALLOCATOR: Allocator = Allocator;`:

```diff
 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),
-        ) as *mut u8
+        )
     }
     #[rustc_std_internal_symbol]
     unsafe fn __rust_dealloc(arg0: *mut u8, arg1: usize, arg2: usize) -> () {
         ::core::alloc::GlobalAlloc::dealloc(
             &ALLOCATOR,
-            arg0 as *mut u8,
+            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 as *mut u8,
+            arg0,
             ::core::alloc::Layout::from_size_align_unchecked(arg1, arg2),
             arg3,
-        ) as *mut u8
+        )
     }
     #[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),
-        ) as *mut u8
+        )
     }
 };
```
2023-08-06 09:29:48 +00:00
Meysam Azad
0b16456efa
fix(bootstrap): rename exclude flag to skip 🐛 2023-08-06 14:29:36 +07:00
David Tolnay
e57a89174c
Delete some useless casts from global_allocator expansion 2023-08-05 23:10:38 -07:00
bors
11467b1c2a Auto merge of #114526 - matthiaskrgr:rollup-zz041wi, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #114486 (Avoid invalid NaN lint machine-applicable suggestion in const context)
 - #114503 (Remove invalid lint when there is a generic argument in prefix path)
 - #114509 (Migrate GUI colors test to original CSS color format)
 - #114524 (Also ICE when goals go from Ok to Err in new solver)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-06 03:39:37 +00: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
e0f04efccb
Rollup merge of #114509 - GuillaumeGomez:migrate-gui-test-color-28, r=notriddle
Migrate GUI colors test to original CSS color format

Follow-up of https://github.com/rust-lang/rust/pull/111459.

r? `@notriddle`
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
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
bors
70fa270637 Auto merge of #15401 - Veykril:disabled-proc-macro, r=Veykril
internal: Turn unresolved proc macro expansions into missing expressions

Reduces the amount of type related errors one gets when proc macro expansion is disabled.
2023-08-05 18:01:46 +00:00
Lukas Wirth
042be329a7 Turn unresolved proc macro expansions into missing expressions 2023-08-05 20:00:37 +02:00
bors
eb088b8b9d Auto merge of #111200 - a1phyr:spec_sized_iterators, r=the8472
Optimize `Iterator` implementation for `&mut impl Iterator + Sized`

This adds a specialization trait to forward `fold`, `try_fold`,... to the inner iterator where possible
2023-08-05 17:38:26 +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
5e1394eb37 Auto merge of #15397 - lnicola:fallible-generate-delegate-trait, r=lnicola
fix: Remove unwraps from "Generate delegate trait"

Fixes #15388

This is untested and purely mechanical, maybe some of those `unwrap`s actually made sense, but it probably doesn't hurt to avoid them.
2023-08-05 16:24:49 +00:00
Laurențiu Nicola
622b18e579 Remove unwraps from Generate delegate trait 2023-08-05 19:23:56 +03:00
bors
9565b68b74 Auto merge of #114143 - Enselic:rename-issue-100605, r=eholk
Rename tests/ui/issues/issue-100605.rs to ../type/option-ref-advice.rs

The test is a regression test for a [bug ](https://github.com/rust-lang/rust/issues/100605) where the compiler gave bad advice for an `Option<&String>`. Rename the file appropriately.

Part of #73494
2023-08-05 15:53:07 +00:00
The 8472
20c25d6c31 use offset_of! to calculate dirent64 field offsets 2023-08-05 15:53:09 +02:00
Martin Nordholts
6ba393c28f Rename tests/ui/issues/issue-100605.rs to ../type/option-ref-advice.rs
The test is a regression test for a bug where the compiler gave bad
advice for an `Option<&String>`. Rename the file appropriately.
2023-08-05 15:36:19 +02: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
bors
eed86c0d98 Auto merge of #15392 - Wilfred:stopped_color, r=lnicola
Use the warning color when rust-analyzer is stopped

If the rust-analyzer server isn't running, we can't do much. Treat this state as a warning color, so it's more obvious.
2023-08-05 12:20:39 +00:00
Matthias Krüger
9ad3be3787
Rollup merge of #114498 - chenyukang:yukang-fix-tidy-tip, r=ozkanonur
Print tidy command with bless tidy check failure

It's more friendly for beginners to fix fluent alphabetical errors.
2023-08-05 14:00:18 +02: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
Matthias Krüger
bedadffe60
Rollup merge of #114029 - Enselic:clone-doc, r=scottmcm
Explain more clearly why `fn() -> T` can't be `#[derive(Clone)]`

Closes #73480

The derived impls were generated with `rustc -Z unpretty=expanded main.rs` and the raw output is:

```rust
struct Generate<T>(fn() -> T);
#[automatically_derived]
impl<T: ::core::marker::Copy> ::core::marker::Copy for Generate<T> { }
#[automatically_derived]
impl<T: ::core::clone::Clone> ::core::clone::Clone for Generate<T> {
    #[inline]
    fn clone(&self) -> Generate<T> {
        Generate(::core::clone::Clone::clone(&self.0))
    }
}
```
2023-08-05 14:00:16 +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
Guillaume Gomez
9625fc5839 Migrate GUI colors test to original CSS color format 2023-08-05 12:47:05 +02:00
bors
1cabb8ed23 Auto merge of #114459 - cjgillot:simplify-ctfe, r=oli-obk
Do not run ConstProp on mir_for_ctfe.

This pass does not seem to be useful any more. The const-prop lints are now run by `tcx.mir_drops_elaborated_and_const_checked`, and the const-prop opt should never emit any diagnostic.
2023-08-05 09:08:34 +00:00
bors
27e2eea54f Auto merge of #15393 - Wilfred:full_moniker_param, r=Veykril
SCIP: Qualify parameters by the containing function

SCIP requires symbols to be unique, but multiple functions may have a parameter with the same name. Qualify parameters according to the containing function.
2023-08-05 08:33:05 +00:00
yukang
c9be1a71b6 Remove invalid lint when there is a generic argument in prefix path 2023-08-05 15:58:26 +08:00
bors
d1174a974e Auto merge of #3013 - RalfJung:tree-borrow-data-races, r=RalfJung
tree borrows: consider some retags as writes for the purpose of data races

Turns out not all retags can be freely reordered. Those that cannot should be considered writes for the data race model, to aid with optimizations.

Only the last commit is the actual change; the ones before that are some refactoring I couldn't stop myself from doing.
2023-08-05 07:46:12 +00:00
Ralf Jung
36716dc21c add a test ensuring that we enforce noalias on accesses 2023-08-05 09:45:13 +02:00
Ralf Jung
ee674e7961 tree borrows: consider some retags as writes for the purpose of data races 2023-08-05 09:23:46 +02:00
Ralf Jung
f0cbc7d3dc ensure we allow zero-sized references to functions and vtables 2023-08-05 09:20:55 +02:00
Ralf Jung
e55f49415d borrow tracking: simplify provenance updating 2023-08-05 09:20:55 +02:00
Ralf Jung
a73c86d8a5 fix return place protection when the place is given as a local 2023-08-05 09:20:55 +02:00
bors
67626b8e89 Auto merge of #113734 - cjgillot:no-crate-lint, r=petrochenkov
Convert builtin "global" late lints to run per module

The compiler currently has 4 non-incremental lints:
1. `clashing_extern_declarations`;
2. `missing_debug_implementations`;
3. ~`unnameable_test_items`;~ changed by https://github.com/rust-lang/rust/pull/114414
4. `missing_docs`.

Non-incremental lints get reexecuted for each compilation, which is slow. Moreover, those lints are allow-by-default, so run for nothing most of the time. This PR attempts to make them more incremental-friendly.

`clashing_extern_declarations` is moved to a standalone query.

`missing_debug_implementation` can use `non_blanket_impls_for_ty` instead of recomputing it.

`missing_docs` is harder as it needs to track if there is a `doc(hidden)` module surrounding. I hack around this using the lint level engine. That's easy to implement and allows to re-enable the lint for a re-exported module, while a more proper solution would reuse the same device as `unnameable_test_items`.
2023-08-05 07:20:16 +00:00
Taiki Endo
dddd2190b9 Remove arm crypto target feature 2023-08-05 15:23:31 +09:00