Commit Graph

232025 Commits

Author SHA1 Message Date
bors
1e836d12d3 Auto merge of #114710 - Urgau:fix-expect-dead_code-114557, r=cjgillot
Respect `#[expect]` the same way `#[allow]` is with the `dead_code` lint

This PR makes the `#[expect]` attribute being respected in the same way the `#[allow]` attribute is with the `dead_code` lint.

The fix is much more involved than I would have liked (and it's not because I didn't tried!), because the implementation took advantage of the fact that firing a lint in a allow context is a nop (for the user, as the lint is suppressed) to not fire-it at all.

And will it's fine for `#[allow]`, it definitively isn't for `#[expect]`, as the presence and absence of the lint is significant. So a big part of the PR is just adding the context information of whenever an item is on the worklist because of an `[allow]`/`#[expect]` or not.

Fixes https://github.com/rust-lang/rust/issues/114557
2023-08-12 15:14:42 +00:00
León Orell Valerian Liehr
1a18158891
Don't crash when reporting nice region errors for generic const items 2023-08-12 15:34:28 +02:00
DianQK
6f5b4e3581
Add test for method debuginfo declaration.
We've investigated one reason why debugging information often goes wrong at https://reviews.llvm.org/D152095.
> LLVM can't handle IR where subprogram definitions are nested within DICompositeType when doing LTO builds,
> because there's no good way to cross the CU boundary to insert a nested DISubprogram definition in one CU into a type defined in another CU.
2023-08-12 21:27:46 +08:00
Urgau
b517dd5bc9 Also consider transmute with the invalid_reference_casting lint 2023-08-12 13:05:44 +02:00
Matthias Krüger
cf9081c0a1
Rollup merge of #114734 - oli-obk:vacation_time, r=oli-obk
Mark oli as "on vacation"
2023-08-12 12:06:37 +02:00
Matthias Krüger
1d0792bd80
Rollup merge of #114703 - ouz-a:smir_allocation, r=oli-obk
Cover ParamConst in smir

Others variants won't be useful for a while or ever(?), but we might need this one.

r? ````@oli-obk````
2023-08-12 12:06:37 +02:00
Matthias Krüger
70cd8d5f3f
Rollup merge of #114692 - lcnr:internal_features-warn, r=Nilstrieb
downgrade `internal_features` to warn

Not sure if this requires an FCP or whatever. By having the lint as deny I need to modify test cases when testing them outside of the test suite as the test suite implicitly allows the lint. This takes maybe 10 to 20 seconds per test, but given just how frequently I end up copying tests to different repos it's a significant annoyance.

r? `@Nilstrieb`
2023-08-12 12:06:36 +02:00
Matthias Krüger
a12c329b35
Rollup merge of #114667 - compiler-errors:issue-114664, r=davidtwco
Record binder for bare trait object in LifetimeCollectVisitor

The `LifetimeCollectVisitor` had a bug where it was not recording the binder of bate trait objects. This was uncovered in #114487, when I changed opaque type lowering to ICE if it encountered a captured fresh lifetime with no def-id to map back to: https://github.com/rust-lang/rust/pull/114487/files#diff-ad0c15bbde97a607d4758ec7eaf88248be5d6b8ae084dfc84127f81e3f7a9bb4R1585

Fixes #114664
2023-08-12 12:06:36 +02:00
Matthias Krüger
83756d97a8
Rollup merge of #114584 - darklyspaced:master, r=cjgillot
E0277 nolonger points at phantom `.await`

fixes #113203
2023-08-12 12:06:35 +02:00
Matthias Krüger
8a997b159c
Rollup merge of #114132 - tamird:better-env-debug-impls, r=Amanieu
Better Debug for Vars and VarsOs

Display actual vars instead of two dots.

The same was done for Args and ArgsOs in 275f9a04af.
2023-08-12 12:06:35 +02:00
Matthias Krüger
9aea966e4b
Rollup merge of #94455 - jhpratt:stabilize-int_roundings, r=joshtriplett
Partially stabilize `int_roundings`

This stabilizes the following:

```rust
impl uX {
    pub const fn div_ceil(self, rhs: Self) -> Self;
    pub const fn next_multiple_of(self, rhs: Self) -> Self;
    pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>;
}
```

This feature is tracked in #88581.
2023-08-12 12:06:35 +02:00
Guillaume Gomez
611c0ea21c Migrate GUI colors test to original CSS color format 2023-08-12 12:05:13 +02:00
bors
f1b854818d Auto merge of #109356 - jackh726:issue-108544, r=lcnr
Only check outlives goals on impl compared to trait

Fixes #108544

r? `@compiler-errors`
2023-08-12 10:02:45 +00:00
Jacob Pratt
62ca5aa8e4
Remove unnecessary feature gates 2023-08-12 00:21:04 -04:00
Jacob Pratt
7f08376964
Partially stabilize #![feature(int_roundings)] 2023-08-12 00:12:11 -04:00
Jack Huey
3028dc4ef7 Only check outlives goals on impl compared to trait 2023-08-11 21:09:17 -04:00
bors
b08dd92552 Auto merge of #114720 - scottmcm:better-sub, r=workingjubilee
Tell LLVM that the negation in `<*const T>::sub` cannot overflow

Today it's just `sub` <https://rust.godbolt.org/z/8EzEPnMr5>; with this PR it's `sub nsw`.
2023-08-11 23:40:33 +00:00
ouz-a
d5120d4a46 Make Const more useful in smir 2023-08-11 23:43:58 +03:00
bors
a6f8aa5a09 Auto merge of #114735 - RalfJung:miri, r=RalfJung
update Miri

r? `@ghost`
2023-08-11 20:02:14 +00:00
lcnr
bb76fde734 remove builtin impl for float and int infer 2023-08-11 19:08:11 +02:00
bors
b03864d546 Auto merge of #114729 - flip1995:clippyup, r=Manishearth
Update Clippy

r? `@Manishearth`

cc `@Centri3` This reinstates the `filter_map_bool_then` lint https://github.com/rust-lang/rust/pull/114715, since I think you fixed the ICE in beb57f074e which is included in this sync.
2023-08-11 14:46:07 +00:00
Oli Scherer
2801ae83d5 Mark oli as "on vacation" 2023-08-11 14:18:01 +00:00
bors
a45f181eb0 Auto merge of #2989 - eduardosm:x86-intrinsics, r=RalfJung
miri: implement some `llvm.x86.sse.*` intrinsics and add tests

PR moved from https://github.com/rust-lang/rust/pull/113932.

Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`.

Also adds miri tests for those functions (mostly copied from core_arch tests).

r? `@RalfJung`

The first commit is the same that the commit in the PR I had opened in the Rust repository. I addressed review comments in additional commits to make it easier to review. I also fixed formatting and clippy warnings.
2023-08-11 13:47:30 +00:00
Gurinder Singh
e903752b48 Fix typo 2023-08-11 18:23:57 +05:30
bors
6276e5ad14 Auto merge of #3023 - RalfJung:gamma, r=RalfJung
add gamma function shims

needs a rustup to fetch the new declarations in std
2023-08-11 12:51:25 +00:00
Eduardo Sánchez Muñoz
01140a3eb1 miri: implement some llvm.x86.sse.* intrinsics and add tests
Implements LLVM intrisics needed to run most SSE functions from `core::arch::x86{,_64}`.

Also adds miri tests for those functions (mostly copied from core_arch tests).
2023-08-11 14:12:52 +02:00
bors
08691f0c92 Auto merge of #113432 - klensy:ms-cut-backtrace, r=ChrisDenton
reduce deps for windows-msvc targets for backtrace

(eventually) mirrors https://github.com/rust-lang/backtrace-rs/pull/543

Some dependencies of backtrace don't used on windows-msvc targets, so exclude them:

    miniz_oxide (+ adler)
    addr2line (+ gimli)
    object (+ memchr)

This saves about 30kb of std.dll + 17.5mb of rlibs
2023-08-11 12:07:04 +00:00
Philipp Krones
852bf4e51b
Merge commit '1e8fdf492808a25d78a97e1242b835ace9924e4d' into clippyup 2023-08-11 14:05:13 +02:00
bors
1e8fdf4928 Auto merge of #11320 - max-niederman:redundant_locals_shadow_mutated, r=Alexendoo
redundant_locals: fix FPs on mutated shadows

Fixes #11290.

When a mutable binding is shadowed by
a mutable binding of the same name in a different scope, mutations in that scope have different meaning.
This PR fixes spurious `redundant_locals` emissions on such locals.

cc `@Centri3,` `@flip1995`

changelog: [`redundant_locals`]: fix false positives on mutated shadows
2023-08-11 10:58:13 +00:00
bors
4d7a80d486 Auto merge of #114672 - lenawanel:master, r=compiler-errors
make `typeid::typeid_itanium_cxx_abi::transform_ty` evaluate length in array types

the ICE in https://github.com/rust-lang/rust/issues/114275 was caused by `transform_ty`
in compiler/rustc_symbol_mangling/src/typeid/typeid_itanium_cxx_abi.rs encountering an unevaluated const, while expecting it to already be evaluated.
2023-08-11 09:30:41 +00:00
bors
8703661a9a Auto merge of #11316 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

cc `@max-niederman` With the latest sync, I'm getting a lot of FP in the `redundant_locals` lint you recently added. Any ideas where this could come from?

changelog: none
2023-08-11 08:54:35 +00:00
Philipp Krones
3927677234
Dogfood and bless tests 2023-08-11 10:53:18 +02:00
Vadim Petrochenkov
7353c96be8 rustc: Move features from Session to GlobalCtxt
Removes two pieces of mutable state.
Follow up to #114622.
2023-08-11 16:51:50 +08:00
Philipp Krones
0fc051ddba
Fix redundant_locals for Async desugaring 2023-08-11 10:51:18 +02:00
bors
7d8386f05c Auto merge of #114719 - compiler-errors:rollup-bf1vr51, r=compiler-errors
Rollup of 5 pull requests

Successful merges:

 - #114194 (Inline trivial (noop) flush calls)
 - #114257 (Avoid using `ptr::Unique` in `LinkedList` code)
 - #114359 ([library/std] Replace condv while loop with `cvar.wait_while`.)
 - #114402 (Fix documentation of impl From<Vec<T>> for Rc<[T]>)
 - #114715 (Revert clippy lint [`filter_map_bool_then`])

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-11 06:54:10 +00:00
Scott McMurray
ab6e2bc3d0 Tell LLVM that the negation in <*const T>::sub cannot overflow
Today it's just `sub` <https://rust.godbolt.org/z/8EzEPnMr5>; with this PR it's `sub nsw`.
2023-08-10 23:00:39 -07:00
bors
a07bc13e14 Auto merge of #114718 - compiler-errors:rollup-1am5rpn, r=compiler-errors
Rollup of 7 pull requests

Successful merges:

 - #114599 (Add impl trait declarations to SMIR)
 - #114622 (rustc: Move `crate_types` and `stable_crate_id` from `Session` to `GlobalCtxt`)
 - #114662 (Unlock trailing where-clauses for lazy type aliases)
 - #114693 (Remove myself from the review rotation)
 - #114694 (make the provisional cache slightly less broken)
 - #114705 (Add spastorino to mailmap)
 - #114712 (Fix a couple of bad comments)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-08-11 04:17:57 +00:00
Michael Goulet
35a76a6c32
Rollup merge of #114715 - Centri3:revert-clippy-11115, r=Manishearth
Revert clippy lint [`filter_map_bool_then`]

r? `@Manishearth`

Issue in question is https://github.com/rust-lang/rust-clippy/issues/11309.

We usually wait until the next sync but this ICE is entirely unpreventable and happens often for code where type annotations are needed alongside a lifetime parameter so I think it's a good idea to revert it here. Also, this got into 1.71.1: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=620a95846a0e4810dffb39d7594d62d7
2023-08-10 21:17:38 -07:00
Michael Goulet
9546d7140e
Rollup merge of #114402 - tifv:tifv-fix-rc-doc, r=cuviper
Fix documentation of impl From<Vec<T>> for Rc<[T]>

The example in the documentation of `impl From<Vec<T>> for <Rc<[T]>` is irrelevant (likely was copied from `impl From<Box<T>> for <Rc<T>`). I suggest taking corresponding example from the documentation of `Arc` and replacing `Arc` with `Rc`.
2023-08-10 21:17:37 -07:00
Michael Goulet
5da7f36485
Rollup merge of #114359 - ttsugriy:barrier-simpl, r=cuviper
[library/std] Replace condv while loop with `cvar.wait_while`.

`wait_while` takes care of spurious wake-ups in centralized place, reducing chances for mistakes and potential future optimizations (who knows, maybe in future there will be no spurious wake-ups? :)
2023-08-10 21:17:37 -07:00
Michael Goulet
3791f6dded
Rollup merge of #114257 - rytheo:linked-list-avoid-unique, r=cuviper
Avoid using `ptr::Unique` in `LinkedList` code

Addresses a [comment](https://github.com/rust-lang/rust/pull/103093#discussion_r1268506747) by `@RalfJung` about avoiding use of `core::ptr::Unique` in the standard library.
2023-08-10 21:17:36 -07:00
Michael Goulet
0c241e6bdb
Rollup merge of #114194 - thomcc:flushinline, r=cuviper
Inline trivial (noop) flush calls

At work I noticed that `writer.flush()?` didn't get optimized away in cases where the flush is obviously a no-op, which I had expected (well, desired).

I went through and added `#[inline]` to a bunch of cases that were obviously noops, or delegated to ones that were obviously noops. I omitted platforms I don't have access to (some tier3). I didn't do this very scientifically, in cases where it was non-obvious I left `#[inline]` off.
2023-08-10 21:17:36 -07:00
Michael Goulet
5f906897f6
Rollup merge of #114712 - compiler-errors:comment-nits, r=lcnr
Fix a couple of bad comments

A couple of nits I saw. Sorry, this really should be folded into some other PR of mine, but I will literally forget if I don't put these up now.
2023-08-10 21:17:10 -07:00
Michael Goulet
891b3842b7
Rollup merge of #114705 - spastorino:add-spastorino-mailmap, r=compiler-errors
Add spastorino to mailmap
2023-08-10 21:17:09 -07:00
Michael Goulet
a04dfc32e6
Rollup merge of #114694 - lcnr:provisional-cache, r=compiler-errors
make the provisional cache slightly less broken

It is still broken for the following cycles:
```mermaid
graph LR
   R["R: coinductive"] --> A["A: inductive"]
   R --> B["B: coinductive"]
   A --> B
   B --> R
```
the `R -> A -> B -> R` cycle should be considered to not hold, as it is mixed, but because we first put `B` into the cache from the `R -> B -> R` cycle which is coinductive, it does hold.

This issue will also affect our new coinduction approach. Longterm cycles are coinductive as long as one step goes through an impl where-clause, see f4fc5bae36/crates/formality-prove/src/prove/prove_wc.rs (L51-L62). Here we would first have a fully inductive cycle `R -> B -> R` which is then entered by a cycle with a coinductive step `R -> A -coinductive-> B -> R`.

I don't know how to soundly implement a provisional cache for goals not on the stack without tracking all cycles the goal was involved in and whether they were inductive or not. We could then only use goals from the cache if the *inductivity?* of every cycle remained the same. This is a mess to implement. I therefore want to rip out the provisional cache entirely, but will wait with this until I talked about it with `@nikomatsakis.`

r? `@compiler-errors`
2023-08-10 21:17:09 -07:00
Michael Goulet
2845baddb3
Rollup merge of #114693 - pietroalbini:pa-pietro-review-rotation, r=compiler-errors
Remove myself from the review rotation

I'll go on vacation soon, and in general I've not been able to keep up with the reviews.

r? `@Mark-Simulacrum`
2023-08-10 21:17:08 -07:00
Michael Goulet
076c9d7593
Rollup merge of #114662 - fmease:lazy-ty-aliases-unlock-trailing-wcs, r=oli-obk
Unlock trailing where-clauses for lazy type aliases

Allows trailing where-clauses on lazy type aliases and forbids[^1] leading ones.
Completes #89122 (see section *Top-level type aliases*).

`@rustbot` label F-lazy_type_alias
r? `@oli-obk`

[^1]: This is absolutely fine since lazy type aliases are only meant to be stabilized as part of a new edition.
2023-08-10 21:17:08 -07:00
Michael Goulet
94533d924e
Rollup merge of #114622 - petrochenkov:noplugin, r=oli-obk
rustc: Move `crate_types` and `stable_crate_id` from `Session` to `GlobalCtxt`

Removes two pieces of mutable state.
Follow up to https://github.com/rust-lang/rust/pull/114578.
2023-08-10 21:17:07 -07:00
Michael Goulet
12551a5151
Rollup merge of #114599 - spastorino:add-impl-trait-smir, r=oli-obk
Add impl trait declarations to SMIR

r? `@oli-obk`
2023-08-10 21:17:07 -07:00
Michael Goulet
bbe7a96bec Record binder for bare trait object in LifetimeCollectVisitor 2023-08-11 03:15:41 +00:00