1. 01 7月, 2015 1 次提交
  2. 30 6月, 2015 15 次提交
    • B
      Auto merge of #26667 - arielb1:audit-walk, r=eddyb · 27975c49
      bors 提交于
      This was originally motivated by checking for HRTB hygiene, but I found several other bugs on the way.
      
      This does not fix the biggest user of ty_walk, which is dtorck - I would prefer to coordinate that with @pnkfelix.
      
      r? @EddyB
      27975c49
    • B
      Auto merge of #26666 - huonw:unc-rec, r=alexcrichton · faa04a8b
      bors 提交于
      This fixes two false positives for the unconditional recursion lint, when functions use themselves (or almost-themselves) internally, without actually being recursive.
      
      ````rust
      fn main() { let _ = main; }
      ```
      ```rust
      trait Bar {
          fn method<T: Bar>(&self, x: &T) {
              x.method(x)
          }
      }
      ```
      faa04a8b
    • A
      Remove now-useless code · fb5dd398
      Ariel Ben-Yehuda 提交于
      fb5dd398
    • A
      Kill count_late_bound_regions · a5e21daa
      Ariel Ben-Yehuda 提交于
      No, it didn't show up in my profiler. It still needs to die.
      a5e21daa
    • H
      lint: default methods must be called on Self to unconditionally recur. · 900af2c6
      Huon Wilson 提交于
      This catches the case when a trait defines a default method that calls
      itself, but on a type that isn't necessarily `Self`, e.g. there's no
      reason that `T = Self` in the following, so the call isn't necessarily
      recursive (`T` may override the call).
      
          trait Bar {
              fn method<T: Bar>(&self, x: &T) {
                  x.method(x)
              }
          }
      
      Fixes #26333.
      900af2c6
    • H
      lint: only consider actual calls as unconditional recursion. · b1931e48
      Huon Wilson 提交于
      Specifically, just mentioning the function name as a value is fine, as
      long as it isn't called, e.g. `fn main() { let _ = main; }`.
      
      Closes #21705.
      b1931e48
    • A
      Remove type_needs_unwind_cleanup · 336f8121
      Ariel Ben-Yehuda 提交于
      After the last @dinosaur went extinct, the check became redundant with
      type_needs_drop, except for its bugginess.
      
      Fixes #26655.
      336f8121
    • A
      Fix lifetime elision region accounting · bf164bc6
      Ariel Ben-Yehuda 提交于
      This merges accumulate_regions_in_type with ty_fold::collect_regions.
      Fixes #26638
      bf164bc6
    • B
      Auto merge of #26660 - steveklabnik:fix_up_pointers, r=alexcrichton · 9a26e494
      bors 提交于
      This is a bit outdated.
      9a26e494
    • B
      Auto merge of #26659 - nagisa:cas-docs, r=alexcrichton · fe283b40
      bors 提交于
      Namely:
      
      * Change parameter `old` to read `current` so it is clearer what the argument refers to (originally
         suggested `expected`, but shot down by Steve);
      * Add some formatting and fix some mistakes like referring to the method as `swap` rather than
        `compare_and_swap`.
      fe283b40
    • S
      Refine Atomic*::compare_and_swap documentation · 08b21661
      Simonas Kazlauskas 提交于
      Namely:
      
      * Change parameter `old` to read `current` so it is clearer what the argument refers to (originally
          suggested `expected`, but shot down by Steve);
      * Add some formatting and fix some mistakes like referring to the method as `swap` rather than
        `compare_and_swap`.
      08b21661
    • B
      Auto merge of #26623 - Saser:master, r=steveklabnik · f9b6929f
      bors 提交于
      In Chapter 5.9 (References and Borrowing), there is an example [at the very end](https://doc.rust-lang.org/stable/book/references-and-borrowing.html#use-after-free) which shows that declaring a reference before declaring the variable that it points to results in a compilation error. The book does not really mention why this happens though -- in the sections before, it has described how different scopes affects the lifetime of resources, but there is no mention of how resources within the same scope work.
      
      This confused me a little, so I asked on #rust and got the answer that the resources are destroyed in the reverse order that they are declared, but the book makes no mention of it (as far as I can find) -- except in Chapter 5.21 (Drop), where it says:
      
      > When `x` goes out of scope at the end of `main()`, the code for `Drop` will run. `Drop` has one method, which is also called `drop()`. It takes a mutable reference to `self`.
      > 
      > That’s it! The mechanics of `Drop` are very simple, but there are some subtleties. For example, values are dropped in the opposite order they are declared. [...]
      
      ---
      
      I feel like Chapter 5.9 (References and Borrowing) is probably the best place to put this information (as I have done in my additions), since it deals with other types of referencing and borrowing. However, since English is not my native language, the wording of my additions perhaps are a little "off" -- any feedback on them is appreciated.
      f9b6929f
    • S
      Change removal notice for pointer guide. · 8d6b5689
      Steve Klabnik 提交于
      This is a bit outdated.
      8d6b5689
    • A
      Fix off-by-one error in default-type-parameter checking · a1110bc3
      Ariel Ben-Yehuda 提交于
      Fixes #18183
      a1110bc3
    • B
      Auto merge of #26530 - steveklabnik:gh26471, r=alexcrichton · 34f35a53
      bors 提交于
      Fixes #26471
      
      r? @alexcrichton 
      34f35a53
  3. 29 6月, 2015 15 次提交
  4. 28 6月, 2015 9 次提交
    • B
      Auto merge of #26631 - richo:comment-updates, r=steveklabnik · c1b8bd2d
      bors 提交于
      I've attempted to lurk these into a few PRs since they're tiny, but those PR's haven't landed so here they are.
      
      r? @steveklabnik 
      c1b8bd2d
    • B
      Auto merge of #26601 - alexcrichton:xp, r=brson · 5da0d415
      bors 提交于
      This series of commits (currently rebased on https://github.com/rust-lang/rust/pull/26569 to avoid conflicts) adds support for the standard library to run on Windows XP. The main motivation behind this PR is that to enable any Rust code in Firefox we need to support Windows XP.
      
      This PR doesn't yet intend to be a move to make Windows XP an officially supported platform, but instead simply get Rust code running on it. APIs like condition variables and RWLocks will immediately panic currently on XP, and it's unclear if that story wants to change much. Additionally, we may bind APIs like IOCP which aren't available on XP and would be *very* difficult to provide a fallback implementation. Essentially this PR enables running Rust on XP, but you still have to be careful to avoid non-XP portions of the standard library.
      
      The major components of this PR are:
      
      * Support for a new `i686-pc-windows-msvc` triple. This primarily involves a lot of build system hackery, but there are also a number of floating point functions which had to get switched up a bit.
      * All APIs not available on Windows are now accessed through our dynamic-detection mechanism
      * Mutexes on Windows were rewritten to use SRWLOCK as an optimization but can fall back to CRITICAL_SECTION.
      5da0d415
    • J
      Address nits · 15bc4a30
      Jared Roesch 提交于
      15bc4a30
    • A
      std: Fix Windows XP compatibility · 10b103af
      Alex Crichton 提交于
      This commit enables executables linked against the standard library to run on
      Windows XP. There are two main components of this commit:
      
      * APIs not available on XP are shimmed to have a fallback implementation and use
        runtime detection to determine if they are available.
      * Mutexes on Windows were reimplemented to use critical sections on XP where
        rwlocks are not available.
      
      The APIs which are not available on XP are:
      
      * SetFileInformationByHandle - this is just used by `File::truncate` and that
        function just returns an error now.
      * SetThreadStackGuarantee - this is used by the stack overflow support on
        windows, but if this isn't available then it's just ignored (it seems
        non-critical).
      * All condition variable APIs are missing - the shims added for these apis
        simply always panic for now. We may eventually provide a fallback
        implementation, but for now the standard library does not rely on condition
        variables for normal use.
      * RWLocks, like condition variables, are missing entirely. The same story for
        condition variables is taken here. These APIs are all now panicking stubs as
        the standard library doesn't rely on RWLocks for normal use.
      
      Currently, as an optimization, we use SRWLOCKs for the standard `sync::Mutex`
      implementation on Windows, which is indeed required for normal operation of the
      standard library. To allow the standard library to run on XP, this commit
      reimplements mutexes on Windows to use SRWLOCK instances *if available* and
      otherwise a CriticalSection is used (with some checking for recursive
      locking).
      
      With all these changes put together, a 32-bit MSVC-built executable can run on
      Windows XP and print "hello world"
      
      Closes #12842
      Closes #19992
      Closes #24776
      10b103af
    • R
      rt: Update comment for new location of unwind · 9e58fb85
      Richo Healey 提交于
      9e58fb85
    • R
      rustc_driver: Fix incorrect comment · ba7b47eb
      Richo Healey 提交于
      ba7b47eb
    • J
      Remove ClosureTyper impl for FnCtxt · e5b36848
      Jared Roesch 提交于
      e5b36848
    • J
      Ground work for replacing the ClosureTyper trait · 480cd8fe
      Jared Roesch 提交于
      480cd8fe
    • J
      Begin refactor type checking state · 79d02895
      Jared Roesch 提交于
      This first patch starts by moving around pieces of state related to
      type checking. The goal is to slowly unify the type checking state
      into a single typing context. This initial patch moves the
      ParameterEnvironment into the InferCtxt and moves shared tables
      from Inherited and ty::ctxt into their own struct Tables. This
      is the foundational work to refactoring the type checker to
      enable future evolution of the language and tooling.
      79d02895