1. 05 3月, 2015 3 次提交
    • H
      Add more debugging to syntax::feature_gate. · 10426f69
      Huon Wilson 提交于
      10426f69
    • H
      Add #[allow_internal_unstable] to track stability for macros better. · 84b060ce
      Huon Wilson 提交于
      Unstable items used in a macro expansion will now always trigger
      stability warnings, *unless* the unstable items are directly inside a
      macro marked with `#[allow_internal_unstable]`. IOW, the compiler warns
      unless the span of the unstable item is a subspan of the definition of a
      macro marked with that attribute.
      
      E.g.
      
          #[allow_internal_unstable]
          macro_rules! foo {
              ($e: expr) => {{
                  $e;
                  unstable(); // no warning
                  only_called_by_foo!();
              }}
          }
      
          macro_rules! only_called_by_foo {
              () => { unstable() } // warning
          }
      
          foo!(unstable()) // warning
      
      The unstable inside `foo` is fine, due to the attribute. But the
      `unstable` inside `only_called_by_foo` is not, since that macro doesn't
      have the attribute, and the `unstable` passed into `foo` is also not
      fine since it isn't contained in the macro itself (that is, even though
      it is only used directly in the macro).
      
      In the process this makes the stability tracking much more precise,
      e.g. previously `println!("{}", unstable())` got no warning, but now it
      does. As such, this is a bug fix that may cause [breaking-change]s.
      
      The attribute is definitely feature gated, since it explicitly allows
      side-stepping the feature gating system.
      84b060ce
    • A
      std: Deprecate std::old_io::fs · 95d90462
      Alex Crichton 提交于
      This commit deprecates the majority of std::old_io::fs in favor of std::fs and
      its new functionality. Some functions remain non-deprecated but are now behind a
      feature gate called `old_fs`. These functions will be deprecated once
      suitable replacements have been implemented.
      
      The compiler has been migrated to new `std::fs` and `std::path` APIs where
      appropriate as part of this change.
      95d90462
  2. 04 3月, 2015 3 次提交
    • P
      Add quasiquote for matchers and attributes · 3541abed
      Piotr Czarnecki 提交于
      3541abed
    • M
      Encode codemap and span information in crate metadata. · 2f886555
      Michael Woerister 提交于
      This allows to create proper debuginfo line information for items inlined from other crates (e.g. instantiations of generics).
      Only the codemap's 'metadata' is stored in a crate's metadata. That is, just filename, line-beginnings, etc. but not the actual source code itself. We are thus missing the opportunity of making Rust the first "open-source-only" programming language out there. Pity.
      2f886555
    • F
      Switched to Box::new in many places. · 0d5bcb14
      Felix S. Klock II 提交于
      Many of the modifications putting in `Box::new` calls also include a
      pointer to Issue 22405, which tracks going back to `box <expr>` if
      possible in the future.
      
      (Still tried to use `Box<_>` where it sufficed; thus some tests still
      have `box_syntax` enabled, as they use a mix of `box` and `Box::new`.)
      
      Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
      0d5bcb14
  3. 03 3月, 2015 5 次提交
    • F
    • J
      Add `core::num::wrapping` and fix overflow errors. · 1246d406
      James Miller 提交于
      Many of the core rust libraries have places that rely on integer
      wrapping behaviour. These places have been altered to use the wrapping_*
      methods:
      
       * core::hash::sip - A number of macros
       * core::str - The `maximal_suffix` method in `TwoWaySearcher`
       * rustc::util::nodemap - Implementation of FnvHash
       * rustc_back::sha2 - A number of macros and other places
       * rand::isaac - Isaac64Rng, changed to use the Wrapping helper type
      
      Some places had "benign" underflow. This is when underflow or overflow
      occurs, but the unspecified value is not used due to other conditions.
      
       * collections::bit::Bitv - underflow when `self.nbits` is zero.
       * collections::hash::{map,table} - Underflow when searching an empty
         table. Did cause undefined behaviour in this case due to an
         out-of-bounds ptr::offset based on the underflowed index. However the
         resulting pointers would never be read from.
       * syntax::ext::deriving::encodable - Underflow when calculating the
         index of the last field in a variant with no fields.
      
      These cases were altered to avoid the underflow, often by moving the
      underflowing operation to a place where underflow could not happen.
      
      There was one case that relied on the fact that unsigned arithmetic and
      two's complement arithmetic are identical with wrapping semantics. This
      was changed to use the wrapping_* methods.
      
      Finally, the calculation of variant discriminants could overflow if the
      preceeding discriminant was `U64_MAX`. The logic in `rustc::middle::ty`
      for this was altered to avoid the overflow completely, while the
      remaining places were changed to use wrapping methods. This is because
      `rustc::middle::ty::enum_variants` now throws an error when the
      calculated discriminant value overflows a `u64`.
      
      This behaviour can be triggered by the following code:
      
      ```
      enum Foo {
        A = U64_MAX,
        B
      }
      ```
      
      This commit also implements the remaining integer operators for
      Wrapped<T>.
      1246d406
    • H
      Feature gate `#[static_assert]`. · c195783c
      Huon Wilson 提交于
      The API this exposes is a little strange (being attached to `static`s),
      so it makes sense to conservatively feature gate it. If it is highly
      popular, it is possible to reverse this gating.
      c195783c
    • M
      Add cfg_attr to known attributes · 8567f290
      Manish Goregaokar 提交于
      8567f290
    • F
      Use `const`s instead of `static`s where appropriate · f35f973c
      Florian Zeitz 提交于
      This changes the type of some public constants/statics in libunicode.
      Notably some `&'static &'static [(char, char)]` have changed
      to `&'static [(char, char)]`. The regexp crate seems to be the
      sole user of these, yet this is technically a [breaking-change]
      f35f973c
  4. 28 2月, 2015 6 次提交
  5. 26 2月, 2015 3 次提交
  6. 25 2月, 2015 2 次提交
  7. 24 2月, 2015 7 次提交
  8. 23 2月, 2015 1 次提交
  9. 22 2月, 2015 5 次提交
  10. 21 2月, 2015 3 次提交
  11. 20 2月, 2015 2 次提交