1. 16 8月, 2023 4 次提交
  2. 15 8月, 2023 36 次提交
    • B
      Auto merge of #114852 - GuillaumeGomez:rollup-vjagxjr, r=GuillaumeGomez · c57393e4
      bors 提交于
      Rollup of 10 pull requests
      
      Successful merges:
      
       - #114711 (Infer `Lld::No` linker hint when the linker stem is a generic compiler driver)
       - #114772 (Add `{Local}ModDefId` to more strongly type DefIds`)
       - #114800 (std: add some missing repr(transparent))
       - #114820 (Add test for unknown_lints from another file.)
       - #114825 (Upgrade std to gimli 0.28.0)
       - #114827 (Only consider object candidates for object-safe dyn types in new solver)
       - #114828 (Probe when assembling upcast candidates so they don't step on eachother's toes in new solver)
       - #114829 (Separate `consider_unsize_to_dyn_candidate` from other unsize candidates)
       - #114830 (Clean up some bad UI testing annotations)
       - #114831 (Check projection args before substitution in new solver)
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      c57393e4
    • I
      Document Default for ExitStatus · a741a5ad
      Ian Jackson 提交于
      This lets us put a version on the impl, too.
      a741a5ad
    • B
      Auto merge of #112387 - clarfonthey:non-panicking-ceil-char-boundary, r=m-ou-se · 4f4dae05
      bors 提交于
      Don't panic in ceil_char_boundary
      
      Implementing the alternative mentioned in this comment: https://github.com/rust-lang/rust/issues/93743#issuecomment-1579935853
      
      Since `floor_char_boundary` will always work (rounding down to the length of the string is possible), it feels best for `ceil_char_boundary` to not panic either. However, the semantics of "rounding up" past the length of the string aren't very great, which is why the method originally panicked in these cases.
      
      Taking into account how people are using this method, it feels best to simply return the end of the string in these cases, so that the result is still a valid char boundary.
      4f4dae05
    • M
      Fix typo. · 2f75dd4e
      Mara Bos 提交于
      Co-authored-by: NJosh Stone <cuviper@gmail.com>
      2f75dd4e
    • G
      Rollup merge of #114831 - compiler-errors:next-solver-projection-subst-compat, r=lcnr · 31a41310
      Guillaume Gomez 提交于
      Check projection args before substitution in new solver
      
      Don't ICE when an impl has the wrong kind of GAT arguments
      
      r? lcnr
      31a41310
    • G
      Rollup merge of #114830 - compiler-errors:ui-test-annotations, r=petrochenkov · 81efd47a
      Guillaume Gomez 提交于
      Clean up some bad UI testing annotations
      
      These annotations do nothing 😅
      81efd47a
    • G
      Rollup merge of #114829 - compiler-errors:next-solver-only-unsize-to-dyn-once, r=lcnr · da4e7bd0
      Guillaume Gomez 提交于
      Separate `consider_unsize_to_dyn_candidate` from other unsize candidates
      
      Move the unsize candidate assembly *just for* `T -> dyn Trait` out of `assemble_candidates_via_self_ty` so that we only consider it once, instead of for every normalization step of the self ty. This makes sure that we don't assemble several candidates that are equal modulo normalization when we really don't care about normalizing the self type of an `T: Unsize<dyn Trait>` goal anyways.
      
      Fixes rust-lang/trait-system-refactor-initiative#57
      
      r? lcnr
      da4e7bd0
    • G
      Rollup merge of #114828 - compiler-errors:next-solver-probe-upcasting, r=lcnr · 47bdda2b
      Guillaume Gomez 提交于
      Probe when assembling upcast candidates so they don't step on eachother's toes in new solver
      
      Lack of a probe causes one candidate to disqualify the other due to inference side-effects.
      
      r? lcnr
      47bdda2b
    • G
      Rollup merge of #114827 - compiler-errors:next-solver-dyn-safe-candidates, r=lcnr · e4b9e72e
      Guillaume Gomez 提交于
      Only consider object candidates for object-safe dyn types in new solver
      
      We apparently allow this per RFC2027 💀
      
      r? lcnr
      e4b9e72e
    • G
      Rollup merge of #114825 - cuviper:gimli-0.28, r=compiler-errors · 0e7f9e57
      Guillaume Gomez 提交于
      Upgrade std to gimli 0.28.0
      
      Gimli 0.28 removed its `From<EndianSlice> for &[u8]` that was the root cause of #113238.
      
      This dependency update mirrors rust-lang/backtrace-rs#557, but since that doesn't require any code changes in `backtrace`, we can also apply that right away for our nested `std/backtrace` feature.
      0e7f9e57
    • G
      Rollup merge of #114820 - ehuss:unknown-lint-mod-warning, r=compiler-errors · dd76268a
      Guillaume Gomez 提交于
      Add test for unknown_lints from another file.
      
      This adds a test for #84936 which was incidentally fixed via #97266. It is a strange issue where `#![allow(unknown_lints)]` at the crate root was not applying to unknown lints that fired in a non-inline-module. I did not dig further into how #97266 fixed it, but I did verify it. I couldn't find any existing tests which did anything similar.
      
      Closes #84936
      dd76268a
    • G
      Rollup merge of #114800 - RalfJung:transparent, r=cuviper · f527d56c
      Guillaume Gomez 提交于
      std: add some missing repr(transparent)
      
      For some types we don't want to stably guarantee this, so hide the `repr` from rustdoc. This nice approach was suggested by `@thomcc.`
      f527d56c
    • G
      Rollup merge of #114772 - fee1-dead-contrib:typed-did, r=b-naber · f0987ab4
      Guillaume Gomez 提交于
      Add `{Local}ModDefId` to more strongly type DefIds`
      
      Based on #110862 by `@Nilstrieb`
      f0987ab4
    • G
      Rollup merge of #114711 - lqd:linker-inference, r=petrochenkov · f9297418
      Guillaume Gomez 提交于
      Infer `Lld::No` linker hint when the linker stem is a generic compiler driver
      
      This PR basically reverts the temporary solution in https://github.com/rust-lang/rust/pull/113631 to a more long-term solution.
      
      r? ``@petrochenkov``
      
      In [this comment](https://github.com/rust-lang/rust/pull/113631#issuecomment-1634598238), you had ideas about a long-term solution:
      
      > I wonder what a good non-temporary solution for the inference would look like.
      >
      >     * If the default is `(Cc::No, Lld::Yes)` (e.g. `rust-lld`)
      >
      >       * and we switch to some specific platform compiler (e.g. `-C linker=arm-none-eabi-gcc`), should we change to `Lld::No`? Maybe yes?
      >       * and we switch to some non-default but generic compiler `-C linker=clang`? Then maybe not?
      >
      >     * If the default is `(Cc::Yes, Lld::Yes)` (e.g. future x86_64 linux with default LLD)
      >
      >       * and we switch to some specific platform compiler (e.g. `-C linker=arm-none-eabi-gcc`), should we change to `Lld::No`? Maybe yes?
      >       * and we switch to some non-default but generic compiler `-C linker=clang`? Then maybe not?
      >
      
      I believe that we should infer the `Lld::No` linker hint for any `-Clinker` override, and all the cases above:
      - the linker drivers have their own defaults, so in my mind `-Clinker` is a signal to use its default linker / flavor, rather than ours or the target's. In the case of generic compilers, it's more likely than not going to be `Lld::No`. I would expect this to be the case in general, even when including platform-specific compilers.
      - the guess will be wrong if the linker driver uses lld by default (and we also don't want to search for `-fuse-ld` link args), but will work in the more common cases. And the minority of other cases can fix the wrong guess by opting into the precise linker flavor.
      - this also ensures backwards-compatibility: today, even on targets with an lld default and overriding the linker, rustc will not use lld. That includes `thumbv6m-none-eabi` where issue #113597 happened.
      
      It looks like the simplest option, and the one with least churn: we maintain the current behavior in ambiguous cases.
      
      I've tested that this works on #113597, as expected from the failure.
      
      (I also have a no-std `run-make` test using a custom target json spec: basically simulating a future `x86_64-unknown-linux-gnu` using an lld flavor by default, to check that  e.g. `-Clinker=clang` doesn't use lld. I could add that test to this PR, but IIUC such a custom target requires `cargo -Z build-std` and we have no tests depending on this cargo feature yet. Let me know if you want to add this test of the linker inference for such targets.)
      
      What do you think ?
      f9297418
    • B
      Auto merge of #114467 - Amanieu:asm-unstable-features, r=davidtwco · c1699a79
      bors 提交于
      Use `unstable_target_features` when checking inline assembly
      
      This is necessary to properly validate register classes even when the relevant target feature name is still unstable.
      c1699a79
    • B
      Auto merge of #114717 - loongarch-rs:rust-lld, r=b-naber · fd9525ad
      bors 提交于
      Switch to LLD as default linker for loongarch64-unknown-none*
      
      The [LLD already supports LoongArch](https://github.com/rust-lang/llvm-project/commit/6084ee742064cf8121444febee342133b0cb7abd), it's time to switch to LLD as default linker for `loongarch64-unknown-none*`.
      fd9525ad
    • B
      Auto merge of #114023 - compiler-errors:coinductive-cycle-lint, r=lcnr · a32978a5
      bors 提交于
      Warn on inductive cycle in coherence leading to impls being considered not overlapping
      
      This PR implements a `coinductive_overlap_in_coherence` lint (#114040), which warns users against cases where two impls are considered **not** to overlap during coherence due to an inductive cycle disproving one of the predicates after unifying the two impls.
      
      Cases where this lint fires will become an overlap error if we ever move to coinduction, so I'd like to make this a warning to avoid having more crates take advantage of this behavior in the mean time. Also, since the new trait solver treats inductive cycles as ambiguity, not an error, this is a blocker for landing the new trait solver in coherence.
      a32978a5
    • M
      Deny FnDef in patterns · 1f42be6f
      Michael Goulet 提交于
      1f42be6f
    • M
      more nits · 0e201556
      Michael Goulet 提交于
      0e201556
    • M
    • M
      nits · d2a14df7
      Michael Goulet 提交于
      Co-authored-by: Nlcnr <rust@lcnr.de>
      d2a14df7
    • M
      Implement lint against coinductive impl overlap · 56f5704f
      Michael Goulet 提交于
      56f5704f
    • M
      more span info · 2ae4bedd
      Michael Goulet 提交于
      2ae4bedd
    • B
      Auto merge of #113679 - chenyukang:yukang-fix-lint-113459, r=cjgillot · d7e75100
      bors 提交于
      Match scrutinee need necessary parentheses for structs
      
      Fixes #113459
      d7e75100
    • B
      Auto merge of #114803 - bjorn3:less_session_mutable_state, r=fee1-dead · ffaa32b7
      bors 提交于
      Couple of global state and driver refactors
      
      * Remove some unused global mutable state
      * Remove a couple of unnecessary queries (both driver and `TyCtxt` queries)
      * Remove an unnecessary use of `FxIndexMap`
      ffaa32b7
    • M
      Check projection arguments before substitution · 77c6c38a
      Michael Goulet 提交于
      77c6c38a
    • M
      Clean up some bad ui testing annotations · dc946649
      Michael Goulet 提交于
      dc946649
    • M
    • M
    • M
      e8ab56fb
    • J
      Add a regression test for #113238 · 677afb4b
      Josh Stone 提交于
      677afb4b
    • B
      Auto merge of #114824 - weihanglo:update-cargo, r=weihanglo · 3276b29d
      bors 提交于
      Update cargo
      
      6 commits in 7e9de3f4ec3708f500bec142317895b96131e47c..7c3904d6c3ed54e8a413023519b55a536ad44d5b
      2023-08-13 00:47:32 +0000 to 2023-08-14 20:11:43 +0000
      - fix(lints): Doctest extraction should respect `[lints]` (rust-lang/cargo#12501)
      - test: relax assertions of panic message (again) (rust-lang/cargo#12500)
      - doc(unstable): `cargo test` does not provide `--keep-going` (rust-lang/cargo#12492)
      - fix(log): enable ansi color only in terminal (rust-lang/cargo#12488)
      - Update cargo-yank.md (rust-lang/cargo#12490)
      - test: bypass `rustc --test` impl details for `-Zfuture-incompat-test` (rust-lang/cargo#12491)
      
      r? `@ghost`
      3276b29d
    • W
      Update cargo · 6d31b148
      Weihang Lo 提交于
      6d31b148
    • B
      Auto merge of #113658 - Dirreke:csky-unknown-linux-gunabiv2, r=bjorn3 · 180dffba
      bors 提交于
      add a csky-unknown-linux-gnuabiv2 target
      
      This is the rustc side changes to support csky based Linux target(`csky-unknown-linux-gnuabiv2`).
      
      Tier 3 policy:
      
      > A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)
      
      I pledge to do my best maintaining it.
      
      > Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.
      
      This `csky`  section is the arch name and the `unknown-linux` section is the same as other linux target, and `gnuabiv2` is from the  cross-compile toolchain of  `gcc`
      
      > Target names should not introduce undue confusion or ambiguity unless absolutely necessary to maintain ecosystem compatibility. For example, if the name of the target makes people extremely likely to form incorrect beliefs about what it targets, the name should be changed or augmented to disambiguate it.
      
      I think the explanation in platform support doc is enough to make this aspect clear.
      
      > Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.
      
      It's using open source tools only.
      
      > The target must not introduce license incompatibilities.
      
      No new license
      
      > Anything added to the Rust repository must be under the standard Rust license (MIT OR Apache-2.0).
      
      Understood.
      
      > The target must not cause the Rust tools or libraries built for any other host (even when supporting cross-compilation to the target) to depend on any new dependency less permissive than the Rust licensing policy. This applies whether the dependency is a Rust crate that would require adding new license exceptions (as specified by the tidy tool in the rust-lang/rust repository), or whether the dependency is a native library or binary. In other words, the introduction of the target must not cause a user installing or running a version of Rust or the Rust tools to be subject to any new license requirements.
      
      There are no new dependencies/features required.
      
      > Compiling, linking, and emitting functional binaries, libraries, or other code for the target (whether hosted on the target itself or cross-compiling from another target) must not depend on proprietary (non-FOSS) libraries. Host tools built for the target itself may depend on the ordinary runtime libraries supplied by the platform and commonly used by other applications built for the target, but those libraries must not be required for code generation for the target; cross-compilation to the target must not require such libraries at all. For instance, rustc built for the target may depend on a common proprietary C runtime library or console output library, but must not depend on a proprietary code generation library or code optimization library. Rust's license permits such combinations, but the Rust project has no interest in maintaining such combinations within the scope of Rust itself, even at tier 3.
      
      As previously said it's using open source tools only.
      
      > "onerous" here is an intentionally subjective term. At a minimum, "onerous" legal/licensing terms include but are not limited to: non-disclosure requirements, non-compete requirements, contributor license agreements (CLAs) or equivalent, "non-commercial"/"research-only"/etc terms, requirements conditional on the employer or employment of any particular Rust developers, revocable terms, any requirements that create liability for the Rust project or its developers or users, or any requirements that adversely affect the livelihood or prospects of the Rust project or its developers or users.
      
      There are no such terms present/
      
      > Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.
      
      I'm not the reviewer here.
      
      > This requirement does not prevent part or all of this policy from being cited in an explicit contract or work agreement (e.g. to implement or maintain support for a target). This requirement exists to ensure that a developer or team responsible for reviewing and approving a target does not face any legal threats or obligations that would prevent them from freely exercising their judgment in such approval, even if such judgment involves subjective matters or goes beyond the letter of these requirements.
      
      I'm not the reviewer here.
      
      > Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.
      
      It supports for std
      
      > The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.
      
      I have added the documentation, and I think it's clear.
      
      > Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via `@)` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.
      
      Understood.
      
      > Backlinks such as those generated by the issue/PR tracker when linking to an issue or PR are not considered a violation of this policy, within reason. However, such messages (even on a separate repository) must not generate notifications to anyone involved with a PR who has not requested such notifications.
      
      Understood.
      
      > Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.
      
      I believe I didn't break any other target.
      
      > In particular, this may come up when working on closely related targets, such as variations of the same architecture with different features. Avoid introducing unconditional uses of features that another variation of the target may not have; use conditional compilation or runtime detection, as appropriate, to let each target run code supported by that target.
      
      I think there are no such problems in this PR.
      180dffba
    • R
      actually this doesn't even affect doctests. nice. · fe1a034f
      Ralf Jung 提交于
      fe1a034f
    • B
      Auto merge of #114821 - matthiaskrgr:rollup-bahtz9m, r=matthiaskrgr · f960bdf1
      bors 提交于
      Rollup of 5 pull requests
      
      Successful merges:
      
       - #114745 (Make Const more useful in smir)
       - #114752 (fixed *const [type error] does not implement the Copy trait)
       - #114760 (DebugInfo: Updates test cases that add method declarations.)
       - #114815 (Update books)
       - #114817 (Remove unnecessary FIXME)
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      f960bdf1