Commit Graph

244691 Commits

Author SHA1 Message Date
Michael Woerister eabfe455ec Add mw to review rotation and add some owner assignments 2024-01-24 10:13:28 +01:00
Ralf Jung e611211f30 add __cxa_thread_atexit_impl on freebsd 2024-01-24 10:12:24 +01:00
Ralf Jung cba1fdbff3 refactor extern static handling 2024-01-24 10:12:24 +01:00
bors cf22ee0c0c Auto merge of #3275 - rust-lang:rustup-2024-01-24, r=RalfJung
Automatic Rustup
2024-01-24 08:12:24 +00:00
Ralf Jung a9bc7e99a3 disable freeBSD tests for now 2024-01-24 09:10:40 +01:00
bors 76a75bf145 Auto merge of #12179 - y21:issue12176, r=dswij
[`multiple_crate_versions`]: add a configuration option for allowed duplicate crates

Closes #12176

changelog: [`multiple_crate_versions`]: add a configuration option for allowed duplicate crates
2024-01-24 07:00:34 +00:00
Ralf Jung 0df7810734 remove StructuralEq trait 2024-01-24 07:56:23 +01:00
Zalathar 572d7e9e69 coverage: Flatten the functions for extracting/refining coverage spans
Consolidating this code into flatter functions reduces the amount of
pointer-chasing required to read and modify it.
2024-01-24 16:59:52 +11:00
The Miri Conjob Bot dbe1c58a14 Merge from rustc 2024-01-24 05:03:25 +00:00
The Miri Conjob Bot ef454c4a4a Preparing for merge from rustc 2024-01-24 04:56:15 +00:00
Zalathar 83ef18cd6c coverage: Dismantle `Instrumentor` into ordinary functions 2024-01-24 13:19:56 +11:00
bors f6ee4bf384 Auto merge of #120276 - weihanglo:update-cargo, r=weihanglo
Update cargo

10 commits in 1ae631085f01c1a72d05df1ec81f3759a8360042..7bb7b539558dc88bea44cee4168b6269bf8177b0
2024-01-17 17:26:41 +0000 to 2024-01-20 00:15:32 +0000
- feat: inherit jobserver from env for all kinds of runner (rust-lang/cargo#12776)
- Fix static_mut_ref warning. (rust-lang/cargo#13329)
- fix(trim-paths): remap common prefix only (rust-lang/cargo#13210)
- fix(cargo-rustdoc): use same path by output format logic everywhere (rust-lang/cargo#13325)
- chore: Make MSRV=N-2 the workspace default (rust-lang/cargo#13324)
- Fix precise-prerelease tracking link. (rust-lang/cargo#13320)
- test(pkgid): keep package ID format in sync (rust-lang/cargo#13322)
- Improve GitHub Actions CI config (rust-lang/cargo#13317)
- Go back to passing an empty `values()` when no features are declared (rust-lang/cargo#13316)
- fix(`--package`): accept `?` if it's a valid pkgid spec (rust-lang/cargo#13315)

r? ghost
2024-01-24 01:34:12 +00:00
clubby789 da336190e3 Bump `askama` version 2024-01-24 01:04:34 +00:00
Maybe Waffle 0b1d7ffbd4 Add `NonZero*::count_ones` 2024-01-24 00:15:14 +00:00
est31 9676e18868 Remove extra # from url 2024-01-24 00:41:45 +01:00
Vadim Petrochenkov 03f23c1a2f linker: Fix Rust dylib crate extension on windows-msvc 2024-01-24 01:51:43 +03:00
Vadim Petrochenkov 1b8e871f1c linker: Cleanup implementations of `link_staticlib_*` 2024-01-24 01:51:43 +03:00
Vadim Petrochenkov d15db6b260 linker: Merge `link_staticlib_*` and `link_whole_staticlib_*` 2024-01-24 01:51:43 +03:00
Vadim Petrochenkov 859f37ae86 linker: Do not collect search paths unless necessary 2024-01-24 01:51:43 +03:00
Vadim Petrochenkov 14cd3fd6f9 linker: Group library linking methods together and sort them consistently 2024-01-24 01:51:43 +03:00
Vadim Petrochenkov 0e38a65612 linker: Refactor APIs for linking static libraries
Rename `link(_whole)(staticlib,rlib)` to something more suitable.
2024-01-24 01:51:43 +03:00
Vadim Petrochenkov 50501c6fba linker: Refactor APIs for linking dynamic libraries
Rename `link_(dylib,framework)`, remove `link_rust_dylib`.
2024-01-24 01:51:43 +03:00
bors 0b7730105f Auto merge of #120283 - fmease:rollup-rk0f6r5, r=fmease
Rollup of 9 pull requests

Successful merges:

 - #112806 (Small code improvements in `collect_intra_doc_links.rs`)
 - #119766 (Split tait and impl trait in assoc items logic)
 - #120139 (Do not normalize closure signature when building `FnOnce` shim)
 - #120160 (Manually implement derived `NonZero` traits.)
 - #120171 (Fix assume and assert in jump threading)
 - #120183 (Add `#[coverage(off)]` to closures introduced by `#[test]` and `#[bench]`)
 - #120195 (add several resolution test cases)
 - #120259 (Split Diagnostics for Uncommon Codepoints: Add List to Display Characters Involved)
 - #120261 (Provide structured suggestion to use trait objects in some cases of `if` arm type divergence)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-23 22:44:44 +00:00
Vadim Petrochenkov ba75970473 privacy: Refactor top-level visiting in `TypePrivacyVisitor` 2024-01-24 00:42:01 +03:00
León Orell Valerian Liehr 3f2f8eee02
Rollup merge of #120261 - estebank:issue-102629, r=wesleywiser
Provide structured suggestion to use trait objects in some cases of `if` arm type divergence

```
error[E0308]: `if` and `else` have incompatible types
  --> $DIR/suggest-box-on-divergent-if-else-arms.rs:15:9
   |
LL |       let _ = if true {
   |  _____________-
LL | |         Struct
   | |         ------ expected because of this
LL | |     } else {
LL | |         foo()
   | |         ^^^^^ expected `Struct`, found `Box<dyn Trait>`
LL | |     };
   | |_____- `if` and `else` have incompatible types
   |
   = note: expected struct `Struct`
              found struct `Box<dyn Trait>`
help: `Struct` implements `Trait` so you can box it to coerce to the trait object `Box<dyn Trait>`
   |
LL |         Box::new(Struct)
   |         +++++++++      +

error[E0308]: `if` and `else` have incompatible types
  --> $DIR/suggest-box-on-divergent-if-else-arms.rs:20:9
   |
LL |       let _ = if true {
   |  _____________-
LL | |         foo()
   | |         ----- expected because of this
LL | |     } else {
LL | |         Struct
   | |         ^^^^^^ expected `Box<dyn Trait>`, found `Struct`
LL | |     };
   | |_____- `if` and `else` have incompatible types
   |
   = note: expected struct `Box<dyn Trait>`
              found struct `Struct`
   = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
help: store this in the heap by calling `Box::new`
   |
LL |         Box::new(Struct)
   |         +++++++++      +

error[E0308]: `if` and `else` have incompatible types
  --> $DIR/suggest-box-on-divergent-if-else-arms.rs:25:9
   |
LL |   fn bar() -> impl Trait {
   |               ---------- the found opaque type
...
LL |       let _ = if true {
   |  _____________-
LL | |         Struct
   | |         ------ expected because of this
LL | |     } else {
LL | |         bar()
   | |         ^^^^^ expected `Struct`, found opaque type
LL | |     };
   | |_____- `if` and `else` have incompatible types
   |
   = note:   expected struct `Struct`
           found opaque type `impl Trait`
help: `Struct` implements `Trait` so you can box both arms and coerce to the trait object `Box<dyn Trait>`
   |
LL ~         Box::new(Struct) as Box<dyn Trait>
LL |     } else {
LL ~         Box::new(bar())
   |

error[E0308]: `if` and `else` have incompatible types
  --> $DIR/suggest-box-on-divergent-if-else-arms.rs:30:9
   |
LL |   fn bar() -> impl Trait {
   |               ---------- the expected opaque type
...
LL |       let _ = if true {
   |  _____________-
LL | |         bar()
   | |         ----- expected because of this
LL | |     } else {
LL | |         Struct
   | |         ^^^^^^ expected opaque type, found `Struct`
LL | |     };
   | |_____- `if` and `else` have incompatible types
   |
   = note: expected opaque type `impl Trait`
                   found struct `Struct`
help: `Struct` implements `Trait` so you can box both arms and coerce to the trait object `Box<dyn Trait>`
   |
LL ~         Box::new(bar()) as Box<dyn Trait>
LL |     } else {
LL ~         Box::new(Struct)
   |
```

Partially address #102629.
2024-01-23 21:53:59 +01:00
León Orell Valerian Liehr 4d9b983368
Rollup merge of #120259 - HTGAzureX1212:HTGAzureX1212/split-diagnostics-uncommon-codepoints, r=Manishearth
Split Diagnostics for Uncommon Codepoints: Add List to Display Characters Involved

This Pull Request adds a list of the uncommon codepoints involved in the `uncommon_codepoints` lint, as outlined as a first step in #120228.

Example rendered diagnostic:
```
error: identifier contains an uncommon Unicode codepoint: 'µ'
  --> $DIR/lint-uncommon-codepoints.rs:3:7
   |
LL | const µ: f64 = 0.000001;
   |       ^
   |
note: the lint level is defined here
  --> $DIR/lint-uncommon-codepoints.rs:1:9
   |
LL | #![deny(uncommon_codepoints)]
   |         ^^^^^^^^^^^^^^^^^^^
```

(Retrying #120258.)
2024-01-23 21:53:59 +01:00
León Orell Valerian Liehr 7ee8142420
Rollup merge of #120195 - bvanjoi:add-some-resolution-test-case, r=petrochenkov
add several resolution test cases

r? ``@petrochenkov``
2024-01-23 21:53:58 +01:00
León Orell Valerian Liehr ecb8702308
Rollup merge of #120183 - Zalathar:test-closure, r=compiler-errors
Add `#[coverage(off)]` to closures introduced by `#[test]` and `#[bench]`

These closures are an internal implementation detail of the `#[test]` and `#[bench]` attribute macros, so from a user perspective there is no reason to instrument them for coverage.

Skipping them makes coverage reports slightly cleaner, and will also allow other changes to span processing during coverage instrumentation, without having to worry about how they affect the `#[test]` macro.

The `#[coverage(off)]` attribute has no effect when `-Cinstrument-coverage` is not used.

Fixes #120046.

---

Note that this PR has no effect on the user-written function that has the `#[test]` attribute attached to it. That function will still be instrumented as normal.
2024-01-23 21:53:58 +01:00
León Orell Valerian Liehr 6cca9b33ec
Rollup merge of #120171 - cjgillot:jump-threading-assume-assert, r=tmiasko
Fix assume and assert in jump threading

r? ``@tmiasko``
2024-01-23 21:53:57 +01:00
León Orell Valerian Liehr 19a840d676
Rollup merge of #120160 - reitermarkus:nonzero-traits, r=dtolnay
Manually implement derived `NonZero` traits.

Step 3 as mentioned in https://github.com/rust-lang/rust/pull/100428#pullrequestreview-1767139731.

Manually implement the traits that would cause “borrow of layout constrained field with interior mutability” errors when switching to `NonZero<T>`.

r? ```@dtolnay```
2024-01-23 21:53:57 +01:00
León Orell Valerian Liehr 6131ba62ad
Rollup merge of #120139 - compiler-errors:fnonce-shim, r=BoxyUwU
Do not normalize closure signature when building `FnOnce` shim

It is not necessary to normalize the closure signature when building an `FnOnce` shim for an `Fn`/`FnMut` closure. That closure shim is just calling `FnMut::call_mut(&mut self)` anyways.

It's also somewhat sketchy that we were ever doing this to begin with, since we're normalizing with a `ParamEnv::reveal_all()` param-env, which is definitely not right with possibly polymorphic substs.

This cuts out a tiny bit of unnecessary work in `Instance::resolve` and simplifies the signature because now we can unconditionally return an `Instance`.
2024-01-23 21:53:56 +01:00
León Orell Valerian Liehr 5da220a095
Rollup merge of #119766 - oli-obk:split_tait_and_atpit, r=compiler-errors
Split tait and impl trait in assoc items logic

And simplify the assoc item logic where applicable.

This separation shows that it is easier to reason about impl trait in assoc items compared with TAITs. See https://rust-lang.zulipchat.com/#narrow/stream/315482-t-compiler.2Fetc.2Fopaque-types/topic/impl.20trait.20in.20associated.20type for some discussion.

The current plan is to try to stabilize impl trait in associated items before TAIT, as they do not have any issues with their defining scopes (see https://github.com/rust-lang/rust/issues/107645 for why this is not a trivial or uncontroversial topic).
2024-01-23 21:53:56 +01:00
León Orell Valerian Liehr 023c3eb44b
Rollup merge of #112806 - kadiwa4:collect_intra_doc_links, r=notriddle
Small code improvements in `collect_intra_doc_links.rs`

Makes some of the code more readable by shortening it, and removes some unnecessary bounds checks.
2024-01-23 21:53:55 +01:00
bors 5d3d3479d7 Auto merge of #120281 - fmease:rollup-9nxail8, r=fmease
Rollup of 10 pull requests

Successful merges:

 - #119028 (Add more weirdness to weird-exprs.rs)
 - #119805 (Suggest array::from_fn for array initialization)
 - #120188 (compiler: update freebsd and netbsd base specs.)
 - #120215 (Update some deps with `bitflags` v1 dependencies)
 - #120244 (Use `Self` in `NonZero*` implementations.)
 - #120246 (Re-add estebank to review rotation)
 - #120252 (rename `RawTy` to `LoweredTy`)
 - #120255 (correct my mailmap entry)
 - #120270 (A bunch of random modifications)
 - #120280 (Move condition enabling the pass to `is_enabled`)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-01-23 20:43:38 +00:00
León Orell Valerian Liehr 08bac31f8f
Rollup merge of #120280 - tmiasko:is-enabled, r=compiler-errors
Move condition enabling the pass to `is_enabled`

The practical motivation is to omit the pass from -Zdump-mir=all when disabled.
2024-01-23 21:19:56 +01:00
León Orell Valerian Liehr 3b1c2eb44c
Rollup merge of #120270 - compiler-errors:randos, r=lcnr
A bunch of random modifications

r? oli-obk

Kitchen sink of changes that I didn't know where to put elsewhere. Documentation tweaks mostly, but also removing some unreachable code and simplifying the pretty printing for closures/coroutines.
2024-01-23 21:19:56 +01:00
León Orell Valerian Liehr 456974ba93
Rollup merge of #120255 - emberian:patch-1, r=Nilstrieb
correct my mailmap entry
2024-01-23 21:19:55 +01:00
León Orell Valerian Liehr 0c769cc8ca
Rollup merge of #120252 - lcnr:rename-astconv-ty, r=compiler-errors
rename `RawTy` to `LoweredTy`

I believe this name to more closely match its purpose

r? ``@compiler-errors``
2024-01-23 21:19:55 +01:00
León Orell Valerian Liehr 0d3af593cd
Rollup merge of #120246 - estebank:revert_breathing_room, r=estebank
Re-add estebank to review rotation

r? ``@compiler-errors``
2024-01-23 21:19:54 +01:00
León Orell Valerian Liehr 8fea4a8cab
Rollup merge of #120244 - reitermarkus:nonzero-self, r=dtolnay
Use `Self` in `NonZero*` implementations.

This slightly reduces the size of the eventual diff when making these generic, since this can be merged independently.
2024-01-23 21:19:54 +01:00
León Orell Valerian Liehr 09c31b860b
Rollup merge of #120215 - clubby789:dep-updates, r=Nilstrieb
Update some deps with `bitflags` v1 dependencies

This only leaves `pulldown-cmark` (which has updated to bitflags v2 in Git) and `rustc_apfloat` (PR opened previously at https://github.com/rust-lang/rustc_apfloat/pull/12)
2024-01-23 21:19:53 +01:00
León Orell Valerian Liehr 1e5ec4d82a
Rollup merge of #120188 - devnexen:update_bsd_compiler_base_specs, r=wesleywiser
compiler: update freebsd and netbsd base specs.

both support thread local.
2024-01-23 21:19:53 +01:00
León Orell Valerian Liehr dd538b5f05
Rollup merge of #119805 - chenyukang:yukang-fix-119530, r=davidtwco
Suggest array::from_fn for array initialization

Fixes #119530
2024-01-23 21:19:52 +01:00
León Orell Valerian Liehr e8f9e5481e
Rollup merge of #119028 - oberien:patch-1, r=cjgillot
Add more weirdness to weird-exprs.rs
2024-01-23 21:19:52 +01:00
Tomasz Miąsko c8e4aaa023 Move condition enabling the pass to `is_enabled`
The practical motivation is to omit the pass from -Zdump-mir=all when
disabled.
2024-01-23 20:58:44 +01:00
David Koloski 849d884141 Remove --fatal-warnings on wasm targets
These were added with good intentions, but a recent change in LLVM 18
emits a warning while examining .rmeta sections in .rlib files. Since
this flag is a nice-to-have and users can update their LLVM linker
independently of rustc's LLVM version, we can just omit the flag.
2024-01-23 19:10:17 +00:00
王宇逸 27a6e6e67b Wrap `HeapAlloc` and never inline 2024-01-24 02:43:06 +08:00
Weihang Lo d616bb1426
Update cargo 2024-01-23 13:35:15 -05:00
Nicholas Thompson 9dccd5dce1 Further Implement Power of Two Optimization 2024-01-23 12:03:50 -05:00
Nicholas Thompson 55e04d5236 Further Implement `is_val_statically_known` 2024-01-23 12:02:31 -05:00