1. 22 6月, 2014 8 次提交
    • N
      Rename ty_param_bounds_and_ty to Polytype · 8a4bb8a5
      Niko Matsakis 提交于
      8a4bb8a5
    • N
      Rename and move ty_param_substs_and_ty · 7ead6bed
      Niko Matsakis 提交于
      7ead6bed
    • B
      auto merge of #15005 : dotdash/rust/i1_bool, r=alexcrichton · 4c39962d
      bors 提交于
      We currently compiled bools to i8 values, because there was a bug in
      LLVM that sometimes caused miscompilations when using i1 in, for
      example, structs.
      
      Using i8 means a lot of unnecessary zero-extend and truncate operations
      though, since we have to convert the value from and to i1 when using for
      example icmp or br instructions. Besides the unnecessary overhead caused
      by this, it also sometimes made LLVM miss some optimizations.
      
      First, we have to fix some bugs concerning the handling of
      attributes in foreign function declarations and calls. These
      are required because the i1 type needs the ZExt attribute when
      used as a function parameter or return type.
      
      Then we have to update LLVM to get a bugfix without which LLVM
      sometimes generates broken code when using i1.
      
      And then, finally, we can switch bools over to i1.
      4c39962d
    • B
      Compile bools to i1 · d747de5a
      Björn Steinbrink 提交于
      We currently compiled bools to i8 values, because there was a bug in
      LLVM that sometimes caused miscompilations when using i1 in, for
      example, structs.
      
      Using i8 means a lot of unnecessary zero-extend and truncate operations
      though, since we have to convert the value from and to i1 when using for
      example icmp or br instructions. Besides the unnecessary overhead caused
      by this, it also sometimes made LLVM miss some optimizations.
      
      Fixes #8106.
      d747de5a
    • B
      Update LLVM · 90a9f65b
      Björn Steinbrink 提交于
      To fix #8106, we need an LLVM version that contains r211082 aka 0dee6756
      which fixes a bug that blocks that issue.
      
      There have been some tiny API changes in LLVM, and cmpxchg changed its
      return type. The i1 part of the new return type is only interesting when
      using the new weak cmpxchg, which we don't do.
      90a9f65b
    • B
      Add missing attributes to indirect calls for foreign functions · 5e720aac
      Björn Steinbrink 提交于
      When calling a foreign function, some arguments and/or return value
      attributes are required to conform to the foreign ABI. Currently those
      attributes are only added to the declaration of foreign functions. With
      direct calls, this is no problem, because LLVM can see that those
      attributes apply to the call. But with an indirect call, LLVM cannot do
      that and the attribute is missing.
      
      To fix that, we have to add those attribute to the calls to foreign
      functions as well.
      
      This also allows to remove the special handling of the SRet attribute,
      which is ABI-dependent and will be set via the `attr` field of the
      return type's `ArgType`.
      5e720aac
    • B
      Correctly set return type attributes on foreign function declarations · abdbaa2e
      Björn Steinbrink 提交于
      The ArgType type gives us a generic way to specify an attribute for a
      type to ensure ABI conformance for foreign functions. But the code that
      actually sets the argument attributes in the function declaration
      only sets the attribute for the return type when the type is indirect.
      
      Since LLVMAddAttribute() doesn't allow to set attributes on the return
      type, we have to use LLVMAddFunctionAttribute() instead.
      
      This didn't cause problems yet, because currently only some indirect
      types require attributes to be set.
      abdbaa2e
    • B
      auto merge of #15074 : conradkleinespel/rust/master, r=pcwalton · db9af1d5
      bors 提交于
      Using something like:
      
      ```rust
      box "string"
      ```
      
      yields
      ```shell
      "`~\"string\"` has been removed; use `\"string\".to_string()` instead"
      ```
      
      Should the error message maybe say `box "string"` instead?
      db9af1d5
  2. 21 6月, 2014 10 次提交
    • B
      auto merge of #15062 : pcwalton/rust/trailing-plus, r=brson · f556c8cb
      bors 提交于
      This will break code that looks like `Box<Trait+>`. Change that code to
      `Box<Trait>` instead.
      
      Closes #14925.
      
      [breaking-change]
      
      r? @brson
      f556c8cb
    • C
      8bcfabae
    • B
      auto merge of #15029 : aturon/rust/stability-index, r=brson · 0ae4b97c
      bors 提交于
      This commit makes several changes to the stability index infrastructure:
      
      * Stability levels are now inherited lexically, i.e., each item's
        stability level becomes the default for any nested items.
      
      * The computed stability level for an item is stored as part of the
        metadata. When using an item from an external crate, this data is
        looked up and cached.
      
      * The stability lint works from the computed stability level, rather
        than manual stability attribute annotations. However, the lint still
        checks only a limited set of item uses (e.g., it does not check every
        component of a path on import). This will be addressed in a later PR,
        as part of issue #8962.
      
      * The stability lint only applies to items originating from external
        crates, since the stability index is intended as a promise to
        downstream crates.
      
      * The "experimental" lint is now _allow_ by default. This is because
        almost all existing crates have been marked "experimental", pending
        library stabilization. With inheritance in place, this would generate
        a massive explosion of warnings for every Rust program.
      
        The lint should be changed back to deny-by-default after library
        stabilization is complete.
      
      * The "deprecated" lint still warns by default.
      
      The net result: we can begin tracking stability index for the standard
      libraries as we stabilize, without impacting most clients.
      
      Closes #13540.
      0ae4b97c
    • B
      auto merge of #14731 : jakub-/rust/pattern-matching-refactor, r=alexcrichton · b1646cbf
      bors 提交于
      This PR is changing the error messages for non-exhaustive pattern matching to include a more accurate witness, i.e. a pattern that is not covered by any of the ones provided by the user. Example:
      
      ```rust
      fn main() {
      	match (true, (Some("foo"), [true, true]), Some(42u)) {
      		(false, _, _) => (),
      		(true, (None, [true, _]), None) => (),
      		(true, (None, [false, _]), Some(1u)) => ()
      	}
      }
      ```
      
      ```sh
      /tmp/witness.rs:2:2: 6:3 error: non-exhaustive patterns: (true, (core::option::Some(_), _), _) not covered
      /tmp/witness.rs:2 	match (true, (Some("foo"), [true, true]), Some(42u)) {
      /tmp/witness.rs:3 		(false, _, _) => (),
      /tmp/witness.rs:4 		(true, (None, [true, _]), None) => (),
      /tmp/witness.rs:5 		(true, (None, [false, _]), Some(1u)) => ()
      /tmp/witness.rs:6 	}
      ```
      
      As part of that, I refactored some of the relevant code and carried over the changes to fixed vectors from the previous PR.
      
      I'm putting it out there for now but the tests will be red.
      b1646cbf
    • P
      libsyntax: Stop parsing `+` with no bounds after it. · ae067477
      Patrick Walton 提交于
      This will break code that looks like `Box<Trait+>`. Change that code to
      `Box<Trait>` instead.
      
      Closes #14925.
      
      [breaking-change]
      ae067477
    • B
      auto merge of #14988 : pcwalton/rust/unsafe-destructor-feature-gate, r=alexcrichton · 2563481c
      bors 提交于
      Closes #8142.
      
      This is not the semantics we want long-term. You can continue to use
      `#[unsafe_destructor]`, but you'll need to add
      `#![feature(unsafe_destructor)]` to the crate attributes.
      
      [breaking-change]
      
      r? @alexcrichton
      2563481c
    • P
      librustc: Put `#[unsafe_destructor]` behind a feature gate. · dcbf4ec2
      Patrick Walton 提交于
      Closes #8142.
      
      This is not the semantics we want long-term. You can continue to use
      `#[unsafe_destructor]`, but you'll need to add
      `#![feature(unsafe_destructor)]` to the crate attributes.
      
      [breaking-change]
      dcbf4ec2
    • J
      Ignore issue-14393 on Windows · a88819ad
      Jakub Wieczorek 提交于
      a88819ad
    • B
      auto merge of #15056 : alexcrichton/rust/issue-15043, r=kballard · 43d19382
      bors 提交于
      The parser already has special logic for parsing `>` tokens from `>>`, and this
      commit extends the logic to the acquiring a `>` from the `>=` and `>>=` tokens
      as well.
      
      Closes #15043
      43d19382
    • A
      syntax: Parse GT tokens from `>=` and `>>=` · f0c730b8
      Alex Crichton 提交于
      The parser already has special logic for parsing `>` tokens from `>>`, and this
      commit extends the logic to the acquiring a `>` from the `>=` and `>>=` tokens
      as well.
      
      Closes #15043
      f0c730b8
  3. 20 6月, 2014 22 次提交