1. 05 3月, 2015 5 次提交
    • H
      Use `#[allow_internal_unstable]` for `thread_local!` · ab7ef740
      Huon Wilson 提交于
      This destabilises all the implementation details of `thread_local!`,
      since they do not *need* to be stable with the new attribute.
      ab7ef740
    • 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
    • B
      Auto merge of #22061 - pczarn:quote_matcher_and_attr, r=kmcallister · 68740b40
      bors 提交于
      Fixes #19674
      Fixes #17396 (already closed, yeah)
      
      cc @kmcallister , @cmr
      68740b40
    • B
      Auto merge of #22873 - alexcrichton:deprecate-fs, r=aturon · cc722a4d
      bors 提交于
      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.
      
      [breaking-change]
      cc722a4d
    • 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 11 次提交
    • P
      Add quasiquote for matchers and attributes · 3541abed
      Piotr Czarnecki 提交于
      3541abed
    • B
      Auto merge of #22235 - michaelwoerister:cross-crate-spans, r=michaelwoerister · 3b3bb0e6
      bors 提交于
      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, positions of line-beginnings, etc. but not the actual source code itself.
      
      Crate metadata size is increased by this change because spans in the encoded ASTs take up space now:
      ```
                      BEFORE    AFTER
      libcore         36 MiB    39.6 MiB    +10%
      libsyntax       51.1 MiB  60.5 MiB    +18.4%
      libcollections  11.2 MiB  12.8 MiB    +14.3%
      ```
      This only affects binaries containing metadata (rlibs and dylibs), executables should not be affected in size. 
      
      Fixes #19228 and probably #22226.
      3b3bb0e6
    • B
      bdf6e4fc
    • B
      6e055c3f
    • 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
    • B
      Auto merge of #23002 - pnkfelix:fsk-box-place-runway, r=nikomatsakis · fed12499
      bors 提交于
      Runway for RFC 809 (overloaded box/placement-in) by adding type annotations or explicit calls to `Box::new` where I found it necessary on PR #22086.
      
      I have broken this up into more than one PR because the entire commit chain (see PR #22086) is long, widespread and unwieldy to rebase frequently.
      
      To my knowledge this is not a breaking change.  Also, there is in principle nothing stopping someone from reverting some/all of these annotations, since without the rest of the commit chain in #22086, the associated code would continue to compile.
      
      All I can do is ask: Try to discourage others from removing seemingly "unnecessary" uses of the `Box` type or the `Box::new()` function, until the rest of RFC 809 lands.
      fed12499
    • F
      Fix doc example to accommodate overloaded-box. · cb1b0dd5
      Felix S. Klock II 提交于
      cb1b0dd5
    • 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
    • F
      inline `Box::new` always. · b03279aa
      Felix S. Klock II 提交于
      (You shouldn't use it, but it is a semi-reasonable way to annotate
      types when necessary.)
      b03279aa
    • F
      Add `: Box<_>` or `::Box<_>` type annotations to various places. · 270f0eef
      Felix S. Klock II 提交于
      This is the kind of change that one is expected to need to make to
      accommodate overloaded-`box`.
      
      ----
      
      Note that this is not *all* of the changes necessary to accommodate
      Issue 22181.  It is merely the subset of those cases where there was
      already a let-binding in place that made it easy to add the necesasry
      type ascription.
      
      (For unnamed intermediate `Box` values, one must go down a different
      route; `Box::new` is the option that maximizes portability, but has
      potential inefficiency depending on whether the call is inlined.)
      
      ----
      
      There is one place worth note, `run-pass/coerce-match.rs`, where I
      used an ugly form of `Box<_>` type ascription where I would have
      preferred to use `Box::new` to accommodate overloaded-`box`.  I
      deliberately did not use `Box::new` here, because that is already done
      in coerce-match-calls.rs.
      
      ----
      
      Precursor for overloaded-`box` and placement-`in`; see Issue 22181.
      270f0eef
    • B
      Auto merge of #22997 - pnkfelix:make-timestamps-robust-to-concurrent-edits, r=nikomatsakis · 129173f1
      bors 提交于
      Make build timestamp files robust in face of concurrent source modification.
      
      Strategy: If the end goal is to touch e.g. `stamp.std`, then we first touch `stamp.std.start_time` before doing anything else.  Then when the receipe finishes, we touch `stamp.std` using the timestamp from `stamp.std.start_time` as the reference time, and remove `stamp.std.start_time`.
      
      Fix #6518.
      129173f1
  3. 03 3月, 2015 24 次提交