1. 25 5月, 2014 15 次提交
    • R
      core: rename strbuf::StrBuf to string::String · 55307450
      Richo Healey 提交于
      [breaking-change]
      55307450
    • B
      auto merge of #14402 : huonw/rust/arc-field-rename, r=alexcrichton · bbb70cdd
      bors 提交于
      Paper over privacy issues with Deref by changing field names.
      
      Types that implement Deref can cause weird error messages due to their
      private fields conflicting with a field of the type they deref to, e.g.,
      previously
      
          struct Foo { x: int }
      
          let a: Arc<Foo> = ...;
          println!("{}", a.x);
      
      would complain the the `x` field of `Arc` was private (since Arc has a
      private field called `x`) rather than just ignoring it.
      
      This patch doesn't fix that issue, but does mean one would have to write
      `a._ptr` to hit the same error message, which seems far less
      common. (This patch `_`-prefixes all private fields of
      `Deref`-implementing types.)
      
      cc #12808
      bbb70cdd
    • H
      Paper over privacy issues with Deref by changing field names. · 9698221f
      Huon Wilson 提交于
      Types that implement Deref can cause weird error messages due to their
      private fields conflicting with a field of the type they deref to, e.g.,
      previously
      
          struct Foo { x: int }
      
          let a: Arc<Foo> = ...;
          println!("{}", a.x);
      
      would complain the the `x` field of `Arc` was private (since Arc has a
      private field called `x`) rather than just ignoring it.
      
      This patch doesn't fix that issue, but does mean one would have to write
      `a._ptr` to hit the same error message, which seems far less
      common. (This patch `_`-prefixes all private fields of
      `Deref`-implementing types.)
      
      cc #12808
      9698221f
    • B
      auto merge of #14373 : sfackler/rust/unused-attr, r=huonw · 07563be6
      bors 提交于
      The compiler now tracks which attributes were actually looked at during the compilation process and warns for those that were unused.
      
      Some things of note:
      
      * The tracking is done via thread locals, as it made the implementation more straightforward. Note that this shouldn't hamper any future parallelization as each task can have its own thread local state which can be merged for the lint pass. If there are serious objections to this, I can restructure things to explicitly pass the state around.
      * There are a number of attributes that have to be special-cased and globally whitelisted. This happens for four reasons:
        * The `doc` and `automatically_derived` attributes are used by rustdoc, but not by the compiler.
        * The crate-level attributes `license`, `desc` and `comment` aren't currently used by anything.
        * Stability attributes as well as `must_use` are checked only when the tagged item is used, so we can't guarantee that the compiler's looked at them.
        * 12 attributes are used only in trans, which happens after the lint pass.
      
      #14300 is adding infrastructure to track lint state through trans, which this lint should also be able to use to handle the last case. For the other attributes, the right solution would probably involve a specific pass to mark uses that occur in the correct context. For example, a `doc` attribute attached to a match arm should generate a warning, but will not currently.
      
      RFC: 0002-attribute-usage
      07563be6
    • S
      Changes from feedback · 33479932
      Steven Fackler 提交于
      33479932
    • S
      Get "make check" to work with unused-attribute · 864c5016
      Steven Fackler 提交于
      There's a fair number of attributes that have to be whitelisted since
      they're either looked for by rustdoc, in trans, or as needed. These can
      be cleaned up in the future.
      864c5016
    • S
      Whitelist doc attributes · 24f98c6d
      Steven Fackler 提交于
      This is a bit overly permissive but should be okay for now.
      24f98c6d
    • S
      Port more stuff to mark used attributes · e0648093
      Steven Fackler 提交于
      e0648093
    • S
      First sketch of lint pass · 50181add
      Steven Fackler 提交于
      Enough attributes are marked to cleanly compile an empty library.
      50181add
    • S
      Add AttrId to Attribute_ · c305473d
      Steven Fackler 提交于
      c305473d
    • B
      auto merge of #14401 : aochagavia/rust/pr4, r=alexcrichton · 6304a27b
      bors 提交于
      Some functions implemented for the Ascii struct have the same functionality as other functions implemented for the normal chars. For consistency, I think they should have the same name, so I renamed the functions in Ascii to match the names in the Char trait.
      
      * Renamed `to_lower` to `to_lowercase`
      * Renamed `to_upper` to `to_uppercase`
      * Renamed `is_alpha` to `is_alphabetic`
      * Renamed `is_alnum` to `is_alphanumeric`
      * Renamed `is_lower` to `is_lowercase`
      * Renamed `is_upper` to `is_uppercase`
      
      [breaking-change]
      6304a27b
    • A
      Update ascii functions used elsewhere · e9989586
      Adolfo Ochagavía 提交于
      e9989586
    • B
      auto merge of #14378 : huonw/rust/deque-adjustments, r=alexcrichton · 43f942f8
      bors 提交于
      Might as well remove the duplication/`forget` call.
      43f942f8
    • B
      auto merge of #14405 : aochagavia/rust/pr5, r=cmr · b546fff7
      bors 提交于
      b546fff7
    • A
      Removed unnecessary macro declaration · 9088a56d
      Adolfo Ochagavía 提交于
      9088a56d
  2. 24 5月, 2014 25 次提交