1. 01 5月, 2020 9 次提交
    • T
      Rollup merge of #71567 - Mark-Simulacrum:no-success, r=matthiaskrgr · 01fffff6
      Tyler Mandry 提交于
      Handle build completion message from Cargo
      
      This was introduced in the recent bump to 1.44 bootstrap cargo
      
      Fixes #71561.
      01fffff6
    • T
      Rollup merge of #71465 - oli-obk:is_thread_local_cleanup, r=matthewjasper · 94433a60
      Tyler Mandry 提交于
      Add a convenience method on `TyCtxt` for checking for thread locals
      
      This PR extracts the cleanup part of #71192
      
      r? @bjorn3
      94433a60
    • T
      Rollup merge of #71148 - bluss:vec-drop-raw-slice, r=RalfJung · 4adebb9f
      Tyler Mandry 提交于
      Vec drop and truncate: drop using raw slice *mut [T]
      
      By creating a *mut [T] directly (without going through &mut [T]), avoid
      questions of validity of the contents of the slice.
      
      Consider the following risky code:
      
      ```rust
      unsafe {
          let mut v = Vec::<bool>::with_capacity(16);
          v.set_len(16);
      }
      ```
      
      The intention is that with this change, we avoid one of the soundness
      questions about the above snippet, because Vec::drop no longer
      produces a mutable slice of the vector's contents.
      
      r? @RalfJung
      4adebb9f
    • B
      Auto merge of #71717 - Dylan-DPC:rollup-av5vjor, r=Dylan-DPC · 7ced01a7
      bors 提交于
      Rollup of 5 pull requests
      
      Successful merges:
      
       - #70950 (extend NLL checker to understand `'empty` combined with universes)
       - #71433 (Add help message for missing right operand in condition)
       - #71449 (Move `{Free,}RegionRelations` and `FreeRegionMap` to `rustc_infer`)
       - #71559 (Detect git version before attempting to use --progress)
       - #71597 (Rename Unique::empty() -> Unique::dangling())
      
      Failed merges:
      
      r? @ghost
      7ced01a7
    • D
      Rollup merge of #71597 - CohenArthur:refactor-unique-empty, r=shepmaster · 97a88700
      Dylan DPC 提交于
      Rename Unique::empty() -> Unique::dangling()
      
      A `FIXME` comment in `src/libcore/ptr/unique.rs` suggested refactoring `Unique::empty()` to `Unique::dangling()` which this PR does.
      97a88700
    • D
      Rollup merge of #71559 - dillona:detect_git_progress_version, r=Mark-Simulacrum · 2770f820
      Dylan DPC 提交于
      Detect git version before attempting to use --progress
      
      Otherwise each update is run twice and errors are printed
      
      I've tested this with:
      git version 2.8.2.windows.1 (Windows)
      git version 2.26.2.266.ge870325ee8 (Linux built from source)
      git version 2.17.1 (Linux)
      git version 2.21.1 (Apple Git-122.3) (MacOS)
      
      I've tested with Python 2.7 (Windows, Linux, MacOS), 3.6 (Linux), and 3.7 (MacOS)
      2770f820
    • D
      Rollup merge of #71449 - ecstatic-morse:free-region-cleanup, r=Mark-Simulacrum · 5e53f80d
      Dylan DPC 提交于
      Move `{Free,}RegionRelations` and `FreeRegionMap` to `rustc_infer`
      
      ...and out of `rustc_middle`. This is to further #65031, albeit in a very minor way
      
      r? @Mark-Simulacrum
      5e53f80d
    • D
      Rollup merge of #71433 - antoyo:error/missing-right-operand, r=Dylan-DPC · be3faf3f
      Dylan DPC 提交于
      Add help message for missing right operand in condition
      
      closes #30035
      be3faf3f
    • D
      Rollup merge of #70950 - nikomatsakis:leak-check-nll-2, r=matthewjasper · 09f3c908
      Dylan DPC 提交于
      extend NLL checker to understand `'empty` combined with universes
      
      This PR extends the NLL region checker to understand `'empty` combined with universes. In particular, it means that the NLL region checker no longer considers `exists<R2> { forall<R1> { R1: R2 } }` to be provable. This is work towards https://github.com/rust-lang/rust/issues/59490, but we're not all the way there. One thing in particular it does not address is error messages.
      
      The modifications to the NLL region inference code turned out to be simpler than expected. The main change is to require that if `R1: R2` then `universe(R1) <= universe(R2)`.
      
      This constraint follows from the region lattice (shown below), because we assume then that `R2` is "at least" `empty(Universe(R2))`, and hence if `R1: R2` (i.e., `R1 >= R2` on the lattice) then `R1` must be in some universe that can name `'empty(Universe(R2))`, which requires that `Universe(R1) <= Universe(R2)`.
      
      ```
      static ----------+-----...------+       (greatest)
      |                |              |
      early-bound and  |              |
      free regions     |              |
      |                |              |
      scope regions    |              |
      |                |              |
      empty(root)   placeholder(U1)   |
      |            /                  |
      |           /         placeholder(Un)
      empty(U1) --         /
      |                   /
      ...                /
      |                 /
      empty(Un) --------                      (smallest)
      ```
      
      I also made what turned out to be a somewhat unrelated change to add a special region to represent `'empty(U0)`, which we use (somewhat hackily) to indicate well-formedness checks in some parts of the compiler. This fixes #68550.
      
      I did some investigation into fixing the error message situation. That's a bit trickier: the existing "nice region error" code around placeholders relies on having better error tracing than NLL currently provides, so that it knows (e.g.) that the constraint arose from applying a trait impl and things like that. I feel like I was hoping *not* to do such fine-grained tracing in NLL, and it seems like we...largely...got away with that. I'm not sure yet if we'll have to add more tracing information or if there is some sort of alternative.
      
      It's worth pointing out though that I've not kind of shifted my opinion on whose job it should be to enforce lifetimes: I tend to think we ought to be moving back towards *something like* the leak-check (just not the one we *had*). If we took that approach, it would actually resolve this aspect of the error message problem, because we would be resolving 'higher-ranked errors' in the trait solver itself, and hence we wouldn't have to thread as much causal information back to the region checker. I think it would also help us with removing the leak check while not breaking some of the existing crates out there.
      
      Regardless, I think it's worth landing this change, because it was relatively simple and it aligns the set of programs that NLL accepts with those that are accepted by the main region checker, and hence should at least *help* us in migration (though I guess we still also have to resolve the existing crates that rely on leak check for coherence).
      
      r? @matthewjasper
      09f3c908
  2. 30 4月, 2020 29 次提交
    • B
      Auto merge of #71675 - pietroalbini:ci-fix-shrink-regression, r=Mark-Simulacrum · be8589fc
      bors 提交于
      ci: use bash when executing the "bors build finished" jobs
      
      We don't clone the repository in those builders, so the default shell (`src/ci/exec-with-shell.py`) is not present there. This fixes a GHA regression introduced in #71434.
      
      r? @Mark-Simulacrum
      be8589fc
    • O
      A test now fails during check instead of build · 8079dd8a
      Oliver Scherer 提交于
      8079dd8a
    • O
      Address review comments · 9cdc9321
      Oliver Scherer 提交于
      9cdc9321
    • O
      Highlight an error that can only happen in CTFE · a91bad65
      Oliver Scherer 提交于
      a91bad65
    • O
    • O
      Separate miri/ctfe unsupported operations · 582d52f0
      Oliver Scherer 提交于
      582d52f0
    • B
      Auto merge of #71707 - Dylan-DPC:rollup-hk8itvo, r=Dylan-DPC · eece58a8
      bors 提交于
      Rollup of 5 pull requests
      
      Successful merges:
      
       - #71205 (rustc: fix check_attr() for methods, closures and foreign functions)
       - #71540 (Suggest deref when coercing `ty::Ref` to `ty::RawPtr`)
       - #71655 (Miri: better document and fix dynamic const pattern soundness checks)
       - #71672 (document missing stable counterparts of intrinsics)
       - #71692 (Add clarification on std::cfg macro docs v. #[cfg] attribute)
      
      Failed merges:
      
      r? @ghost
      eece58a8
    • D
      Rollup merge of #71692 - dfreese:cfgdocs, r=kennytm · 8f6eabfb
      Dylan DPC 提交于
      Add clarification on std::cfg macro docs v. #[cfg] attribute
      
      The wording was discussed, to a limited degree in #71679.  This tries to
      address some confusion I as well as someone else had independently when
      looking at this macro.
      
      Fixes #71679
      8f6eabfb
    • D
      Rollup merge of #71672 - lcnr:instrinsics-wow, r=Dylan-DPC · e2333a97
      Dylan DPC 提交于
      document missing stable counterparts of intrinsics
      
      Notes the stable counterpart of each intrinsic in case one exists.
      
      Implements #34338
      
      r? @Dylan-DPC
      e2333a97
    • D
      Rollup merge of #71655 - RalfJung:const-pattern-soundness, r=oli-obk · 71bf986f
      Dylan DPC 提交于
      Miri: better document and fix dynamic const pattern soundness checks
      
      https://github.com/rust-lang/const-eval/issues/42 got me thinking about soundness for consts being used in patterns, and I found a hole in our existing dynamic checks: a const referring to a mutable static *in a different crate* was not caught. This PR fixes that. It also adds some comments that explain which invariants are crucial for soundness of const-patterns.
      
      Curiously, trying to weaponize this soundness hole failed: pattern matching compilation ICEd when encountering the cross-crate static, saying "expected allocation ID alloc0 to point to memory". I don't know why that would happen, statics *should* be entirely normal memory for pattern matching to access.
      
      r? @oli-obk
      Cc @rust-lang/wg-const-eval
      71bf986f
    • D
      Rollup merge of #71540 - ldm0:ref2ptr, r=oli-obk · 58d955e6
      Dylan DPC 提交于
      Suggest deref when coercing `ty::Ref` to `ty::RawPtr`
      
      Fixes #32122
      
      Currently we do autoderef when casting `ty::Ref` ->`ty::Ref`, but we don't autoderef when casting `ty::Ref` -> `ty::RawPtr`. This PR make the compiler suggests deref when coercing `ty::Ref` to `ty::RawPtr`
      58d955e6
    • D
      Rollup merge of #71205 - NeoRaider:check_attr, r=jonas-schievink · 4e6772b5
      Dylan DPC 提交于
      rustc: fix check_attr() for methods, closures and foreign functions
      
      This fixes an issue that previously turned up for methods in https://github.com/rust-lang/rust/pull/69274, but also exists for closures and foreign function: `check_attr` does not call `codegen_fn_attrs()` for these types when it should, meaning that incorrectly used function attributes are not diagnosed without codegen.
      
      The issue affects our UI tests, as they run with `--emit=metadata` by default, but as it turns out, this is not the only case: Function attributes are not checked on any dead code without this fix!
      
      This makes the fix a **breaking change**. The following very silly Rust programs compiles fine on stable Rust when it should not, which is fixed by this PR.
      ```rust
      fn main() {
          #[target_feature(enable = "sse2")]
          || {};
      }
      ```
      
      I assume any real-world program which may trigger this issue would at least emit a dead code warning, but of course that is no guarantee that such code does not exist...
      
      Fixes #70307
      4e6772b5
    • C
      rename-unique: Rename Unique::empty() to Unique::dangling() · eda7f8fd
      cohenarthur 提交于
      rename-unique: Change calls and doc in raw_vec.rs
      
      rename-unique: Change empty() -> dangling() in const-ptr-unique-rpass.rs
      eda7f8fd
    • B
      Auto merge of #70175 - Amanieu:remove_nlp, r=pnkfelix · bf459752
      bors 提交于
      Remove -Z no-landing-pads flag
      
      Since #67502, `-Z no-landing-pads` will cause all attempted unwinds to abort since we don't generate a `try` / `catch`. This previously worked because `__rust_try` was located in libpanic_unwind which is always compiled with `-C panic=unwind`, but `__rust_try` is now directly inline into the crate that uses `catch_unwind`.
      
      As such, `-Z no-landing-pads` is now mostly useless and people should use `-C panic=abort` instead.
      bf459752
    • B
      Auto merge of #71687 - RalfJung:miri, r=RalfJung · 7c8dbd96
      bors 提交于
      update Miri
      
      Fixes https://github.com/rust-lang/rust/issues/71632
      r? @ghost
      Cc @rust-lang/miri
      7c8dbd96
    • B
      Auto merge of #71528 - alexcrichton:no-more-bitcode, r=nnethercote · 1357af3a
      bors 提交于
      Store LLVM bitcode in object files, not compressed
      
      This commit is an attempted resurrection of #70458 where LLVM bitcode
      emitted by rustc into rlibs is stored into object file sections rather
      than in a separate file. The main rationale for doing this is that when
      rustc emits bitcode it will no longer use a custom compression scheme
      which makes it both easier to interoperate with existing tools and also
      cuts down on compile time since this compression isn't happening.
      
      The blocker for this in #70458 turned out to be that native linkers
      didn't handle the new sections well, causing the sections to either
      trigger bugs in the linker or actually end up in the final linked
      artifact. This commit attempts to address these issues by ensuring that
      native linkers ignore the new sections by inserting custom flags with
      module-level inline assembly.
      
      Note that this does not currently change the API of the compiler at all.
      The pre-existing `-C bitcode-in-rlib` flag is co-opted to indicate
      whether the bitcode should be present in the object file or not.
      
      Finally, note that an important consequence of this commit, which is also
      one of its primary purposes, is to enable rustc's `-Clto` bitcode
      loading to load rlibs produced with `-Clinker-plugin-lto`. The goal here
      is that when you're building with LTO Cargo will tell rustc to skip
      codegen of all intermediate crates and only generate LLVM IR. Today
      rustc will generate both object code and LLVM IR, but the object code is
      later simply thrown away, wastefully.
      1357af3a
    • B
      Auto merge of #71689 - Dylan-DPC:rollup-8nyuwm1, r=Dylan-DPC · fa51f810
      bors 提交于
      Rollup of 6 pull requests
      
      Successful merges:
      
       - #71507 (Document unsafety in core::ptr)
       - #71572 (test iterator chain type length blowup)
       - #71617 (Suggest `into` instead of `try_into` if possible with int types)
       - #71627 (Fix wrong argument in autoderef process)
       - #71678 (Add an index page for nightly rustc docs.)
       - #71680 (Fix doc link to Eq trait from PartialEq trait)
      
      Failed merges:
      
       - #71597 (Rename Unique::empty() -> Unique::dangling())
      
      r? @ghost
      fa51f810
    • D
      Update src/libcore/macros/mod.rs · 610f9442
      David Freese 提交于
      Co-Authored-By: Nkennytm <kennytm@gmail.com>
      610f9442
    • A
      Store LLVM bitcode in object files, not compressed · ef89cc8f
      Alex Crichton 提交于
      This commit is an attempted resurrection of #70458 where LLVM bitcode
      emitted by rustc into rlibs is stored into object file sections rather
      than in a separate file. The main rationale for doing this is that when
      rustc emits bitcode it will no longer use a custom compression scheme
      which makes it both easier to interoperate with existing tools and also
      cuts down on compile time since this compression isn't happening.
      
      The blocker for this in #70458 turned out to be that native linkers
      didn't handle the new sections well, causing the sections to either
      trigger bugs in the linker or actually end up in the final linked
      artifact. This commit attempts to address these issues by ensuring that
      native linkers ignore the new sections by inserting custom flags with
      module-level inline assembly.
      
      Note that this does not currently change the API of the compiler at all.
      The pre-existing `-C bitcode-in-rlib` flag is co-opted to indicate
      whether the bitcode should be present in the object file or not.
      
      Finally, note that an important consequence of this commit, which is also
      one of its primary purposes, is to enable rustc's `-Clto` bitcode
      loading to load rlibs produced with `-Clinker-plugin-lto`. The goal here
      is that when you're building with LTO Cargo will tell rustc to skip
      codegen of all intermediate crates and only generate LLVM IR. Today
      rustc will generate both object code and LLVM IR, but the object code is
      later simply thrown away, wastefully.
      ef89cc8f
    • D
      Add clarification on std::cfg macro docs v. #[cfg] attribute · 4813a814
      David Freese 提交于
      The wording was discussed, to a limited degree in #71679.  This tries to
      address some confusion I as well as someone else had independently when
      looking at this macro.
      
      Fixes #71679
      4813a814
    • D
      Rollup merge of #71680 - nicholasbishop:bishop-fix-eq-link, r=Mark-Simulacrum · d11b5597
      Dylan DPC 提交于
      Fix doc link to Eq trait from PartialEq trait
      
      The `Eq` link was incorrectly going to the `eq` method of `PartialEq`
      instead of to the `Eq` trait.
      d11b5597
    • D
      Rollup merge of #71678 - ehuss:rustc-doc-index, r=Mark-Simulacrum · 3286436e
      Dylan DPC 提交于
      Add an index page for nightly rustc docs.
      
      This adds an `index.html` page at the root of the nightly-rustc docs so that the URL https://doc.rust-lang.org/nightly/nightly-rustc/ should have a landing page that lists all the crates.
      3286436e
    • D
      Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC · 75561a56
      Dylan DPC 提交于
      Fix wrong argument in autoderef process
      
      The `overloaded_deref_ty` is a function for derefencing a type which overloads the `Deref` trait. But actually this function never uses the parameter pushed in until this PR. -_-
      75561a56
    • D
      Rollup merge of #71617 - samrat:suggest-int-into, r=ecstatic-morse · e3bf8709
      Dylan DPC 提交于
      Suggest `into` instead of `try_into` if possible with int types
      
      If it is possible to convert an integer type into another using `into`, don't suggest `try_into`. This commit changes the suggested method to convert from one integer type to another for the following cases:
      
      - u{n} -> i{m} where n < m
      - u8 -> isize
      - i{n} -> isize where n <= 16
      - u{n} -> usize where n <= 16
      
      Fixes #71580
      e3bf8709
    • D
      Rollup merge of #71572 - lcnr:type_length, r=Dylan-DPC · 843ffb8e
      Dylan DPC 提交于
      test iterator chain type length blowup
      
      Adds a regression test. closes #58952
      
      r? @Dylan-DPC
      843ffb8e
    • D
      Rollup merge of #71507 - CohenArthur:document-unsafe-libcore-ptr, r=Mark-Simulacrum · d9761daa
      Dylan DPC 提交于
      Document unsafety in core::ptr
      
      Contributes to #66219
      
      I have yet to document all the `unsafe` blocks in the lib and would like to know if I'm headed in the right direction
      
      r? @steveklabnik
      d9761daa
    • R
      update Miri · a430bd55
      Ralf Jung 提交于
      a430bd55
    • B
      Auto merge of #71674 - flip1995:clippyup, r=Dylan-DPC · c50bd7e4
      bors 提交于
      Update Clippy
      
      Fixes #71608
      c50bd7e4
    • N
      Fix doc link to Eq trait from PartialEq trait · f408a4e9
      Nicholas Bishop 提交于
      The `Eq` link was incorrectly going to the `eq` method of `PartialEq`
      instead of to the `Eq` trait.
      f408a4e9
  3. 29 4月, 2020 2 次提交