1. 08 6月, 2020 12 次提交
    • R
      Rollup merge of #72963 - poliorcetics:cstring-from-raw, r=dtolnay · 824ea6bf
      Ralf Jung 提交于
      Cstring `from_raw` and `into_raw` safety precisions
      
      Fixes #48525.
      Fixes #68456.
      
      This issue had two points:
      
      - The one about `from_raw` has been addressed (I hope).
      - The other one, about `into_raw`, has only been partially fixed.
      
      About `into_raw`: the idea was to:
      
      > steer users away from using the pattern of CString::{into_raw,from_raw} when interfacing with C APIs that may change the effective length of the string by writing interior NULs or erasing the final NUL
      
      I tried making a `Vec<c_char>` like suggested but my current solution feels very unsafe and *hacky* to me (most notably the type cast), I included it here to make it available for discussion:
      
      ```rust
      fn main() {
          use std::os::raw::c_char;
      
          let v = String::from("abc")
              .bytes()
              // From u8 to i8,
              // I feel like it will be a problem for values of u8 > 255
              .map(|c| c as c_char)
              .collect::<Vec<_>>();
      
          dbg!(v);
      }
      ```
      824ea6bf
    • R
      Rollup merge of #72811 - pickfire:liballoc-impl, r=Amanieu · 13815e4b
      Ralf Jung 提交于
      Liballoc impl
      
      Mainly code rearrangements
      13815e4b
    • R
      Rollup merge of #72799 - Aaron1011:feature/span-debug, r=petrochenkov · e1350878
      Ralf Jung 提交于
      Add `-Z span-debug` to allow for easier debugging of proc macros
      
      Currently, the `Debug` impl for `proc_macro::Span` just prints out
      the byte range. This can make debugging proc macros (either as a crate
      author or as a compiler developer) very frustrating, since neither the
      actual filename nor the `SyntaxContext` is displayed.
      
      This commit adds a perma-unstable flag `-Z span-debug`. When enabled,
      the `Debug` impl for `proc_macro::Span` simply forwards directly to
      `rustc_span::Span`. Once #72618 is merged, this will start displaying
      actual line numbers.
      
      While `Debug` impls are not subject to Rust's normal stability
      guarnatees, we probably shouldn't expose any additional information on
      stable until `#![feature(proc_macro_span)]` is stabilized. Otherwise,
      we would be providing a 'backdoor' way to access information that's
      supposed be behind unstable APIs.
      e1350878
    • R
      Rollup merge of #72761 - poliorcetics:use-keyword-doc, r=Dylan-DPC · 89d8979c
      Ralf Jung 提交于
      Added the documentation for the 'use' keyword
      
      This is a partial fix of #34601.
      
      I heavily inspired myself from the Reference on the `use` keyword.
      
      I checked the links when compiling the documentation, they should be ok.
      
      I also added an example for the wildcard `*` in the case of types, because it's behaviour is not *import everything* like one might think at first.
      89d8979c
    • R
      Rollup merge of #72615 - jschwe:fix-Zprofile-documentation, r=steveklabnik · e8bb4c70
      Ralf Jung 提交于
      Fix documentation example for gcov profiling
      
      closes #72546
      Improves the documentation for the unstable Rustflag `-Zprofile` by:
      - stating that Incremental compilation must be turned off.
      - Adding the other `RUSTFLAGS` that should/need to be turned on (taken from [grcov documentation](https://github.com/mozilla/grcov#example-how-to-generate-gcda-files-for-a-rust-project))
      - Mentioning `RUSTC_WRAPPER` to prevent everything getting instrumented.
      
      r? @steveklabnik
      e8bb4c70
    • R
      Rollup merge of #72583 - CAD97:vec-iter-asref-slice, r=dtolnay · b0559beb
      Ralf Jung 提交于
      impl AsRef<[T]> for vec::IntoIter<T>
      
      Adds `impl<T> AsRef<[T]> for vec::IntoIter<T>`. This mirrors the same trait impl for [`slice::Iter`](https://doc.rust-lang.org/nightly/std/slice/struct.Iter.html). Both types already offer `fn as_slice(&self) -> &[T]`, this just adds the trait impl for `vec::IntoIter`.
      
      If/when `fn as_slice(&self) -> &[T]` stabilizes for `vec::Drain` and `slice::IterMut`, they should get `AsRef<[T]>` impls as well. As thus, tangentially related to #58957.
      
      My ultimate goal here: being able to use `for<T, I: Iterator<Item=T> + AsRef<[T]>> I` to refer to `vec::IntoIter`, `vec::Drain`, and eventually `array::IntoIter`, as an approximation of the set of by-value iterators that can be "previewed" as by-ref iterators. (Actually expressing that as a trait requires GAT.)
      b0559beb
    • R
      Rollup merge of #72026 - botika:master, r=estebank · 8484b993
      Ralf Jung 提交于
      Update annotate-snippets-rs to 0.8.0
      
      #59346
      I made major changes to this library. In the previous version we worked with owned while in the current one with borrowed.
      
      I have adapted it without changing the behavior.
      I have modified the coverage since the previous one did not return correctly the index of the character in the line.
      8484b993
    • B
      Auto merge of #73046 - marmeladema:save-analysis-fix-path, r=Xanewok · 73558160
      bors 提交于
      save_analysis: fix some ICEs
      
      Fixes #73020
      Fixes #73022
      Fixes #73041
      73558160
    • B
      Auto merge of #72904 - shepmaster:reduce-abi-symbol-hash-churn, r=jonas-schievink,RalfJung · 6aa1d93c
      bors 提交于
      Order the Rust and C ABIs first to reduce test churn
      6aa1d93c
    • B
      Auto merge of #73099 - Dylan-DPC:rollup-7u8f3m4, r=Dylan-DPC · 0262de55
      bors 提交于
      Rollup of 2 pull requests
      
      Successful merges:
      
       - #72952 (run-make regression test for issue #70924.)
       - #72977 (Fix codegen tests for RISC-V)
      
      Failed merges:
      
      r? @ghost
      0262de55
    • D
      Rollup merge of #72977 - tblah:riscv-codegen-llvm10, r=nikomatsakis · 4dd5d5d4
      Dylan DPC 提交于
      Fix codegen tests for RISC-V
      
      Some codegen tests didn't seem relevant (e.g. unsupported annotations).
      
      The RISC-V abi tests were broken by LLVM 10, c872dcf9 fixes that (cc: @msizanoen1)
      
      I'm not sure about skipping catch-unwind.rs and included that change here mostly as a request for comment - I can't tell if that's a bug.
      4dd5d5d4
    • D
      Rollup merge of #72952 - pnkfelix:regression-test-for-issue-70924, r=nikomatsakis · b7333682
      Dylan DPC 提交于
      run-make regression test for issue #70924.
      
      Sometime after my PR #72767 (to fix issue #70924) landed, I realized that I *could* make a local regression test, thanks to `rustc --print sysroot`: I can make a fresh "copy" (really mostly symlinks) of the sysroot, and then modify it to recreate the terms of this bug.
      b7333682
  2. 07 6月, 2020 21 次提交
  3. 06 6月, 2020 7 次提交