about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-03-11Rollup merge of #106633 - c410-f3r:stabilize-nonzero_bits, r=dtolnayMatthias Krüger-12/+4
Stabilize `nonzero_min_max` ## Overall Stabilizes `nonzero_min_max` to allow the "infallible" construction of ordinary minimum and maximum `NonZero*` instances. The feature is fairly straightforward and already matured for some time in stable toolchains. ```rust let _ = NonZeroU8::MIN; let _ = NonZeroI32::MAX; ``` ## History * On 2022-01-25, implementation was [created](https://github.com/rust-lang/rust/pull/93293). ## Considerations * This report is fruit of the inanition observed after two unsuccessful attempts at getting feedback. * Other constant variants discussed at https://github.com/rust-lang/rust/issues/89065#issuecomment-923238190 are orthogonal to this feature. Fixes https://github.com/rust-lang/rust/issues/89065
2023-03-11Rollup merge of #104363 - WaffleLapkin:bonk_box_new, r=NilstriebMatthias Krüger-39/+59
Make `unused_allocation` lint against `Box::new` too Previously it only linted against `box` syntax, which likely won't ever be stabilized, which is pretty useless. Even now I'm not sure if it's a meaningful lint, but it's at least something :shrug: This means that code like the following will be linted against: ```rust Box::new([1, 2, 3]).len(); f(&Box::new(1)); // where f : &i32 -> () ``` The lint works by checking if a `Box::new` (or `box`) expression has an a borrow adjustment, meaning that the code that first stores the box in a variable won't be linted against: ```rust let boxed = Box::new([1, 2, 3]); // no lint boxed.len(); ```
2023-03-11Auto merge of #109001 - matthiaskrgr:rollup-a3agnwp, r=matthiaskrgrbors-368/+267
Rollup of 8 pull requests Successful merges: - #105798 (Relax ordering rules for `asm!` operands) - #105962 (Stabilize path_as_mut_os_str) - #106085 (use problem matchers for tidy CI) - #107711 (Stabilize movbe target feature) - #108017 (Add `--no-undefined-version` link flag and fix associated breakage) - #108891 (Remove an extraneous include) - #108902 (no more do while :<) - #108912 (Document tool lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-11Auto merge of #108998 - matthiaskrgr:rollup-sxbdulg, r=matthiaskrgrbors-181/+534
Rollup of 9 pull requests Successful merges: - #106921 (Add documentation about the memory layout of `Cell`) - #108828 (Emit alias-eq when equating numeric var and projection) - #108834 (Do not ICE when we have fn pointer `Fn` obligations with bound vars in the self type) - #108900 (fix(lexer): print whitespace warning for \x0c) - #108930 (feat: implement better error for manual impl of `Fn*` traits) - #108937 (improve readability of winnowing) - #108947 (Don't even try to combine consts with incompatible types) - #108976 (Update triagebot rust-analyzer team mention) - #108983 (Forbid `#[target_feature]` on safe default implementations) Failed merges: - #108950 (Directly construct Inherited in typeck.) r? `@ghost` `@rustbot` modify labels: rollup
2023-03-11Auto merge of #104527 - ferrocene:pa-more-licenses, r=pnkfelixbors-137/+261
Add more license annotations This PR updates the `.reuse/dep5` file to include more accurate licensing data for everything in the repository (*excluding* submodules and dependencies). Some decisions were made in this PR: * The standard copyright attribution for files maintained by us is "The Rust Project Developers (see https://thanks.rust-lang.org)", to avoid having to maintain an in-tree `AUTHORS` file. * For files that have specific licensing terms, we added the terms to the `.reuse/dep5` rather than adding SPDX comments in the files themselves. * REUSE picks up any comment/text line with `Copyright` on it, so I had to sprinkle around `REUSE-IgnoreStart` and `REUSE-IgnoreEnd` comments. The rendered `COPYRIGHT` file is available at https://gist.github.com/pietroalbini/efb81103f69596d39758114f3f6a8688. r? `@pnkfelix`
2023-03-10Rollup merge of #108912 - clubby789:doc-tool-lints, r=NilstriebMatthias Krüger-0/+30
Document tool lints Add brief doc comments for the internal tool lints so a summary can be seen without needing to open source code
2023-03-10Rollup merge of #108902 - lcnr:do-while-sus, r=davidtwco,NilstriebMatthias Krüger-25/+23
no more do while :<
2023-03-10Rollup merge of #108891 - kazutakahirata:master, r=cuviperMatthias Krüger-1/+0
Remove an extraneous include SymbolWrapper.cpp doesn't use std::optional or llvm::Optional, so this patch removes the extraneous include. Note that llvm/ADT/Optional.h has been deprecated upstream. This patch ensures that SymbolWrapper.cpp continues to compile even after the upcoming removal of Optional.h.
2023-03-10Rollup merge of #108017 - chbaker0:fix-105967, r=chbaker0Matthias Krüger-40/+38
Add `--no-undefined-version` link flag and fix associated breakage LLVM upstream sets `--no-undefined-version` by default in lld: https://reviews.llvm.org/D135402. Due to a bug in how version scripts are generated, this breaks the `dylib` output type for most crates. See https://github.com/rust-lang/rust/issues/105967#issuecomment-1428671533 for details. This PR adds the flag to gcc flavor linkers in anticipation of this LLVM change rolling in, and patches `rustc` to not attempt to export `__rust_*` allocator symbols when they weren't generated. Fixes #105967
2023-03-10Rollup merge of #107711 - calebzulawski:movbe, r=pnkfelixMatthias Krüger-4/+4
Stabilize movbe target feature Almost all "old" x86 target features are stable. As far as I can tell, these are the last two unstable features in the `x86-64-v2` or `x86-64-v3` microarchitecture levels, so I'm not sure if it was an oversight or if they're still unstable for a reason (see #106323 for `f16c`). Note that this only stabilizes the target features, and not the intrinsics. cc ```@Amanieu``` r? ```@rust-lang/lang```
2023-03-10Rollup merge of #106085 - fee1-dead-contrib:tidy-ci-matchers, r=pietroalbiniMatthias Krüger-3/+18
use problem matchers for tidy CI
2023-03-10Rollup merge of #105962 - zertosh:stabilize_path_as_mut_os_str, r=dtolnayMatthias Krüger-4/+2
Stabilize path_as_mut_os_str Closes #105021 r? ```@dtolnay```
2023-03-10Rollup merge of #105798 - Amanieu:relax-asm, r=joshtriplettMatthias Krüger-291/+152
Relax ordering rules for `asm!` operands The `asm!` and `global_asm!` macros require their operands to appear strictly in the following order: - Template strings - Positional operands - Named operands - Explicit register operands - `clobber_abi` - `options` This is overly strict and can be inconvienent when building complex `asm!` statements with macros. This PR relaxes the ordering requirements as follows: - Template strings must still come before all other operands. - Positional operands must still come before named and explicit register operands. - Named and explicit register operands can be freely mixed. - `options` and `clobber_abi` can appear in any position after the template strings. r? ```````@joshtriplett```````
2023-03-10Auto merge of #108974 - flip1995:clippyup, r=Manishearthbors-779/+2512
Update Clippy r? `@Manishearth` cc `@m-ou-se` This sync also includes https://github.com/rust-lang/rust-clippy/pull/10275
2023-03-10Rollup merge of #108983 - ↵Matthias Krüger-2/+17
LeSeulArtichaut:108646-target-feature-default-impl, r=cjgillot Forbid `#[target_feature]` on safe default implementations Fixes #108646.
2023-03-10Rollup merge of #108976 - Veykril:patch-2, r=jyn514Matthias Krüger-1/+1
Update triagebot rust-analyzer team mention The working group got renamed
2023-03-10Rollup merge of #108947 - compiler-errors:ct-infer-no-shapeshifting, r=BoxyUwUMatthias Krüger-34/+74
Don't even try to combine consts with incompatible types ~I left a more detailed explanation for why this fixes this issue in the UI test, but in general, we should not try to unify const infer vars and rigid consts if they have incompatible types. That's because we don't want something like a `ConstArgHasType` predicate to suddenly go from passing to failing, or vice versa, due to a shallow resolve.~ 1. Use the `type_of` for a parameter in `try_eval_lit_or_param`, instead of the "expected" type from a `WithOptConstParam` def id. 2. Don't combine consts that have incompatible types. Fixes #108781
2023-03-10Rollup merge of #108937 - lcnr:winnowing-enum, r=WaffleLapkinMatthias Krüger-40/+67
improve readability of winnowing
2023-03-10Rollup merge of #108930 - Ezrashaw:better-error-for-manual-fn-impl, ↵Matthias Krüger-51/+142
r=petrochenkov feat: implement better error for manual impl of `Fn*` traits Fixes #39259 cc `@estebank` (you gave me some advice in the linked issue, would you like to review?)
2023-03-10Rollup merge of #108900 - bvanjoi:issue-108275, r=petrochenkovMatthias Krüger-10/+40
fix(lexer): print whitespace warning for \x0c - close https://github.com/rust-lang/rust/issues/108275 - discussion: https://github.com/rust-lang/rust/pull/108403
2023-03-10Rollup merge of #108834 - compiler-errors:fn-ptr-fn-obl, r=spastorinoMatthias Krüger-3/+44
Do not ICE when we have fn pointer `Fn` obligations with bound vars in the self type We never supported solving `for<'a> fn(&'a ()): Fn(&'a ())` -- I tried to add that support in #104929, but iirc `@lcnr` wanted to support this more generally by eagerly instantiating trait predicate binders with placeholders. That never happened due to blockers in the old solver, but we probably shouldn't ICE in any case. On the bright side, this passes on the new solver :^)
2023-03-10Rollup merge of #108828 - compiler-errors:new-solver-alias-eq-on-num-var, r=lcnrMatthias Krüger-40/+143
Emit alias-eq when equating numeric var and projection This doesn't fix everything having to do with projections and infer vars, but it does fix a common case I saw in HIR typeck. r? `@lcnr`
2023-03-10Rollup merge of #106921 - madsmtm:cell-memory-layout, r=dtolnayMatthias Krüger-0/+6
Add documentation about the memory layout of `Cell` https://github.com/rust-lang/rust/pull/101717 guaranteed the memory layout of `UnsafeCell<T>`. This property (a guaranteed memory layout) can be useful to have on `Cell<T>` as well. (Note that `Cell<u8>` [already doesn't trigger the `improper_ctypes` lint](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=34af59ef60b96d8a8bdaec1d52cb5420) since it is `#[repr(transparent)]`). The concrete use-case is for the crate [`objc2`](https://github.com/madsmtm/objc2) to specify that `Cell<T>` is safe to use as an instance variable when `T` is. Fixes https://github.com/rust-lang/rust/issues/79303. --- I'm unsure if we should specify less, for example say that the `Cell` may have extra restrictions on when it may be accessed, or if that's implicit in the (deliberately minimal) way I've worded it here?
2023-03-10Auto merge of #108977 - matthiaskrgr:rollup-1bnl1hu, r=matthiaskrgrbors-121/+157
Rollup of 9 pull requests Successful merges: - #108879 (Unconstrained terms should account for infer vars being equated) - #108936 (Rustdoc: don't hide anonymous reexport) - #108940 (Add myself to compiler reviewers list) - #108945 (Make some report and emit errors take DefIds instead of BodyIds) - #108946 (Document the resulting values produced when using `From<bool>` on floats) - #108956 (Make ptr::from_ref and ptr::from_mut in #106116 const.) - #108960 (Remove `body_def_id` from `Inherited`) - #108963 (only call git on git checkouts during bootstrap) - #108964 (Fix the docs for pointer method with_metadata_of) Failed merges: - #108950 (Directly construct Inherited in typeck.) r? `@ghost` `@rustbot` modify labels: rollup
2023-03-10Forbid `#[target_feature]` on safe default implementationsLéo Lanteri Thauvin-2/+17
2023-03-10Auto merge of #102256 - cjgillot:let-under, r=lcnrbors-19/+271
Introduce a no-op `PlaceMention` statement for `let _ =`. Fixes https://github.com/rust-lang/rust/issues/54003 Fixes https://github.com/rust-lang/rust/issues/80059 Split from https://github.com/rust-lang/rust/pull/101500 This PR introduces a new `PlaceMention` statement dedicated to matches that neither introduce bindings nor ascribe types. Without this, all traces of the match would vanish from MIR, making it impossible to diagnose unsafety or use in #101500. This allows to mark `let _ = <unsafe union access or dereference>` as requiring an unsafe block. Nominating for lang team, as this introduces an extra error.
2023-03-10Rollup merge of #108964 - majaha:ptr_metadata_doc, r=workingjubileeMatthias Krüger-4/+4
Fix the docs for pointer method with_metadata_of The name of the argument to `{*const T, *mut T}::with_metadata_of` was changed from `val` to `meta` recently, but the docs weren't updated to match. Relevant pull request: #103701
2023-03-10Rollup merge of #108963 - jhheider:fix-CI-non-git-builds, r=albertlarsan68Matthias Krüger-1/+1
only call git on git checkouts during bootstrap fixes https://github.com/rust-lang/rust/issues/108959
2023-03-10Rollup merge of #108960 - compiler-errors:no-body-def-id, r=cjgillotMatthias Krüger-84/+55
Remove `body_def_id` from `Inherited` We can just use the body id from the obligation cause. Follow-up to #108945, only my commit is relevant. r? `@cjgillot` cc `@spastorino`
2023-03-10Rollup merge of #108956 - Raekye:master, r=scottmcmMatthias Krüger-2/+2
Make ptr::from_ref and ptr::from_mut in #106116 const. As per https://github.com/rust-lang/rust/issues/106116#issuecomment-1462571833
2023-03-10Rollup merge of #108946 - bmoxb:bool-to-float-docs, r=cuviperMatthias Krüger-2/+24
Document the resulting values produced when using `From<bool>` on floats Have the documentation of the implementation of `From<bool>` on `f32` and `f64` indicate the output values (`0.0` for `false` and `1.0` for `true`). closes #108939
2023-03-10Rollup merge of #108945 - spastorino:pass-def-id-instead-of-using-hir-id, ↵Matthias Krüger-43/+50
r=compiler-errors Make some report and emit errors take DefIds instead of BodyIds Breaking off from #108915 r? `@compiler-errors`
2023-03-10Rollup merge of #108940 - b-naber:reviewers-list, r=compiler-errorsMatthias Krüger-0/+1
Add myself to compiler reviewers list
2023-03-10Rollup merge of #108936 - GuillaumeGomez:rustdoc-anonymous-reexport, r=notriddleMatthias Krüger-4/+34
Rustdoc: don't hide anonymous reexport Fixes https://github.com/rust-lang/rust/issues/108931. From https://github.com/rust-lang/rust/issues/108931, it appears that having anonymous re-exports for traits is actually used in some places, so instead of hiding them automatically, we should prevent them to be ever inlined. r? `@notriddle`
2023-03-10Rollup merge of #108879 - compiler-errors:constrained-root-var, r=lcnrMatthias Krüger-15/+20
Unconstrained terms should account for infer vars being equated Follow-up from the canonicalization PR, wanted to break this one out so I can approve the other PR. r? `@lcnr`
2023-03-10Update triagebot rust-analyzer team mentionLukas Wirth-1/+1
The working group got renamed
2023-03-10Update Cargo.lock (Clippy version)Philipp Krones-4/+4
2023-03-10Merge commit '3c06e0b1ce003912f8fe0536d3a7fe22558e38cf' into clippyupPhilipp Krones-775/+2508
2023-03-10updating commentlcnr-1/+1
Co-authored-by: Ruby Lazuli <general@patchmixolydic.com>
2023-03-10Auto merge of #10275 - Alexendoo:format-args-ast, r=flip1995bors-90/+221
Migrate `write.rs` to `rustc_ast::FormatArgs` changelog: none Part 1 of #10233 The additions to `clippy_utils` are the main novelty of this PR, there's no removals yet since other parts still rely on `FormatArgsExpn` The changes to `write.rs` itself are relatively straightforward this time around, as there's no lints in it that rely on type checking format params r? `@flip1995`
2023-03-10Auto merge of #10473 - flip1995:rustup, r=flip1995bors-65/+49
Rustup r? `@ghost` changelog: none
2023-03-10Bump nightly version -> 2023-03-10Philipp Krones-1/+1
2023-03-10Bump Clippy version -> 0.1.70Philipp Krones-4/+4
2023-03-10Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-723/+2321
2023-03-10Auto merge of #10471 - xFrednet:00000-mark-version-as-released, r=flip1995bors-2/+2
Mark Rust 1.68.0 as release in the changelog Roses are red, this poem is dead, my creativity is lost, outside there is frost? Maybe I should really stop including a "roses are red" with every changelog PR. These are getting worse every time... --- changelog: none <!-- changelog_checked -->
2023-03-10Auto merge of #108934 - matthiaskrgr:rollup-vm414p5, r=matthiaskrgrbors-153/+345
Rollup of 8 pull requests Successful merges: - #106915 (Only load one CSS theme by default) - #108294 (Place binder correctly for arbitrary trait bound suggestion) - #108778 (x fmt: Don't print all modified files if there's more than 10) - #108854 (feat/refactor: improve errors in case of ident with number at start) - #108870 (Fix invalid inlining of reexport of reexport of private item) - #108917 (Consider target_family as pal) - #108922 (Add auto notification for changes to stable mir) - #108929 (Fix typo in span_map.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-10feat: implement better error for manual impl of `Fn*` traitsEzra Shaw-52/+143
2023-03-10Unconstrained terms should account for infer vars being equatedMichael Goulet-15/+20
2023-03-10Auto merge of #108951 - cuviper:solaris-debs, r=Mark-Simulacrumbors-6/+4
ci: use `apt install --download-only` for solaris debs
2023-03-10Fix docs for ptr method with_metadata_of()Matt Harding-4/+4