1. 08 2月, 2014 1 次提交
  2. 07 2月, 2014 31 次提交
    • B
      auto merge of #12087 : sanxiyn/rust/show-span, r=huonw · c3ccaacc
      bors 提交于
      c3ccaacc
    • S
      Add comments to span debugger · e5463b99
      Seo Sanghyeon 提交于
      e5463b99
    • S
      5109d1ad
    • S
      Span debugger · 104002be
      Seo Sanghyeon 提交于
      104002be
    • B
      auto merge of #12083 : bjz/rust/semver, r=huonw · 14cb4be6
      bors 提交于
      14cb4be6
    • B
      auto merge of #12062 : kballard/rust/from_utf8_lossy, r=huonw · 36f1b38f
      bors 提交于
      `from_utf8_lossy()` takes a byte vector and produces a `~str`, converting
      any invalid UTF-8 sequence into the U+FFFD REPLACEMENT CHARACTER.
      
      The replacement follows the guidelines in §5.22 Best Practice for U+FFFD
      Substitution from the Unicode Standard (Version 6.2)[1], which also
      matches the WHATWG rules for utf-8 decoding[2].
      
      [1]: http://www.unicode.org/versions/Unicode6.2.0/ch05.pdf
      [2]: http://encoding.spec.whatwg.org/#utf-8
      
      Closes #9516.
      36f1b38f
    • B
      auto merge of #12010 : HeroesGrave/rust/libcollection, r=alexcrichton · 21b856d2
      bors 提交于
      Part of #8784
      
      Changes:
      - Everything labeled under collections in libextra has been moved into a new crate 'libcollection'.
      - Renamed container.rs to deque.rs, since it was no longer 'container traits for extra', just a deque trait.
      - Crates that depend on the collections have been updated and dependencies sorted.
      - I think I changed all the imports in the tests to make sure it works. I'm not entirely sure, as near the end of the tests there was yet another `use` that I forgot to change, and when I went to try again, it started rebuilding everything, which I don't currently have time for. 
      
      There will probably be incompatibility between this and the other pull requests that are splitting up libextra. I'm happy to rebase once those have been merged.
      
      The tests I didn't get to run should pass. But I can redo them another time if they don't.
      21b856d2
    • K
      Hoist path::Display on top of from_utf8_lossy() · 544cb42d
      Kevin Ballard 提交于
      544cb42d
    • K
      Add new function str::from_utf8_lossy() · b0b89a57
      Kevin Ballard 提交于
      from_utf8_lossy() takes a byte vector and produces a ~str, converting
      any invalid UTF-8 sequence into the U+FFFD REPLACEMENT CHARACTER.
      
      The replacement follows the guidelines in §5.22 Best Practice for U+FFFD
      Substitution from the Unicode Standard (Version 6.2)[1], which also
      matches the WHATWG rules for utf-8 decoding[2].
      
      [1]: http://www.unicode.org/versions/Unicode6.2.0/ch05.pdf
      [2]: http://encoding.spec.whatwg.org/#utf-8
      b0b89a57
    • B
      aa829c29
    • H
      moved collections from libextra into libcollections · d81bb441
      HeroesGrave 提交于
      d81bb441
    • B
      55f53f55
    • B
      Make semver::Version fields public · 78cb1e2a
      Brendan Zabarauskas 提交于
      78cb1e2a
    • B
      396ef935
    • B
      auto merge of #12076 : alexcrichton/rust/rpath-makefile-dep, r=thestinger · a27934c5
      bors 提交于
      The rpath variable should only be used when executing commands, if it leaks into
      a dependency list is causes havoc with the dependencies.
      a27934c5
    • B
      auto merge of #12039 : alexcrichton/rust/no-conditions, r=brson · 87fe3ccf
      bors 提交于
      This has been a long time coming. Conditions in rust were initially envisioned
      as being a good alternative to error code return pattern. The idea is that all
      errors are fatal-by-default, and you can opt-in to handling the error by
      registering an error handler.
      
      While sounding nice, conditions ended up having some unforseen shortcomings:
      
      * Actually handling an error has some very awkward syntax:
      
              let mut result = None;                                        
              let mut answer = None;                                        
              io::io_error::cond.trap(|e| { result = Some(e) }).inside(|| { 
                  answer = Some(some_io_operation());                       
              });                                                           
              match result {                                                
                  Some(err) => { /* hit an I/O error */ }                   
                  None => {                                                 
                      let answer = answer.unwrap();                         
                      /* deal with the result of I/O */                     
                  }                                                         
              }                                                             
      
        This pattern can certainly use functions like io::result, but at its core
        actually handling conditions is fairly difficult
      
      * The "zero value" of a function is often confusing. One of the main ideas
        behind using conditions was to change the signature of I/O functions. Instead
        of read_be_u32() returning a result, it returned a u32. Errors were notified
        via a condition, and if you caught the condition you understood that the "zero
        value" returned is actually a garbage value. These zero values are often
        difficult to understand, however.
      
        One case of this is the read_bytes() function. The function takes an integer
        length of the amount of bytes to read, and returns an array of that size. The
        array may actually be shorter, however, if an error occurred.
      
        Another case is fs::stat(). The theoretical "zero value" is a blank stat
        struct, but it's a little awkward to create and return a zero'd out stat
        struct on a call to stat().
      
        In general, the return value of functions that can raise error are much more
        natural when using a Result as opposed to an always-usable zero-value.
      
      * Conditions impose a necessary runtime requirement on *all* I/O. In theory I/O
        is as simple as calling read() and write(), but using conditions imposed the
        restriction that a rust local task was required if you wanted to catch errors
        with I/O. While certainly an surmountable difficulty, this was always a bit of
        a thorn in the side of conditions.
      
      * Functions raising conditions are not always clear that they are raising
        conditions. This suffers a similar problem to exceptions where you don't
        actually know whether a function raises a condition or not. The documentation
        likely explains, but if someone retroactively adds a condition to a function
        there's nothing forcing upstream users to acknowledge a new point of task
        failure.
      
      * Libaries using I/O are not guaranteed to correctly raise on conditions when an
        error occurs. In developing various I/O libraries, it's much easier to just
        return `None` from a read rather than raising an error. The silent contract of
        "don't raise on EOF" was a little difficult to understand and threw a wrench
        into the answer of the question "when do I raise a condition?"
      
      Many of these difficulties can be overcome through documentation, examples, and
      general practice. In the end, all of these difficulties added together ended up
      being too overwhelming and improving various aspects didn't end up helping that
      much.
      
      A result-based I/O error handling strategy also has shortcomings, but the
      cognitive burden is much smaller. The tooling necessary to make this strategy as
      usable as conditions were is much smaller than the tooling necessary for
      conditions.
      
      Perhaps conditions may manifest themselves as a future entity, but for now
      we're going to remove them from the standard library.
      
      Closes #9795
      Closes #8968
      87fe3ccf
    • A
      Don't include rpath lines in dependency lists · 80920da6
      Alex Crichton 提交于
      The rpath variable should only be used when executing commands, if it leaks into
      a dependency list is causes havoc with the dependencies.
      80920da6
    • C
      Update link_name=... -> link(name=... · ee608cb9
      Cole Mickens 提交于
      ee608cb9
    • A
      Remove std::condition · 454882dc
      Alex Crichton 提交于
      This has been a long time coming. Conditions in rust were initially envisioned
      as being a good alternative to error code return pattern. The idea is that all
      errors are fatal-by-default, and you can opt-in to handling the error by
      registering an error handler.
      
      While sounding nice, conditions ended up having some unforseen shortcomings:
      
      * Actually handling an error has some very awkward syntax:
      
          let mut result = None;
          let mut answer = None;
          io::io_error::cond.trap(|e| { result = Some(e) }).inside(|| {
              answer = Some(some_io_operation());
          });
          match result {
              Some(err) => { /* hit an I/O error */ }
              None => {
                  let answer = answer.unwrap();
                  /* deal with the result of I/O */
              }
          }
      
        This pattern can certainly use functions like io::result, but at its core
        actually handling conditions is fairly difficult
      
      * The "zero value" of a function is often confusing. One of the main ideas
        behind using conditions was to change the signature of I/O functions. Instead
        of read_be_u32() returning a result, it returned a u32. Errors were notified
        via a condition, and if you caught the condition you understood that the "zero
        value" returned is actually a garbage value. These zero values are often
        difficult to understand, however.
      
        One case of this is the read_bytes() function. The function takes an integer
        length of the amount of bytes to read, and returns an array of that size. The
        array may actually be shorter, however, if an error occurred.
      
        Another case is fs::stat(). The theoretical "zero value" is a blank stat
        struct, but it's a little awkward to create and return a zero'd out stat
        struct on a call to stat().
      
        In general, the return value of functions that can raise error are much more
        natural when using a Result as opposed to an always-usable zero-value.
      
      * Conditions impose a necessary runtime requirement on *all* I/O. In theory I/O
        is as simple as calling read() and write(), but using conditions imposed the
        restriction that a rust local task was required if you wanted to catch errors
        with I/O. While certainly an surmountable difficulty, this was always a bit of
        a thorn in the side of conditions.
      
      * Functions raising conditions are not always clear that they are raising
        conditions. This suffers a similar problem to exceptions where you don't
        actually know whether a function raises a condition or not. The documentation
        likely explains, but if someone retroactively adds a condition to a function
        there's nothing forcing upstream users to acknowledge a new point of task
        failure.
      
      * Libaries using I/O are not guaranteed to correctly raise on conditions when an
        error occurs. In developing various I/O libraries, it's much easier to just
        return `None` from a read rather than raising an error. The silent contract of
        "don't raise on EOF" was a little difficult to understand and threw a wrench
        into the answer of the question "when do I raise a condition?"
      
      Many of these difficulties can be overcome through documentation, examples, and
      general practice. In the end, all of these difficulties added together ended up
      being too overwhelming and improving various aspects didn't end up helping that
      much.
      
      A result-based I/O error handling strategy also has shortcomings, but the
      cognitive burden is much smaller. The tooling necessary to make this strategy as
      usable as conditions were is much smaller than the tooling necessary for
      conditions.
      
      Perhaps conditions may manifest themselves as a future entity, but for now
      we're going to remove them from the standard library.
      
      Closes #9795
      Closes #8968
      454882dc
    • C
      Fix a dead URL · 4352a8d6
      Cole Mickens 提交于
      4352a8d6
    • B
      6d27b013
    • E
      Removed @self and @Trait. · b2d30b72
      Eduard Burtescu 提交于
      b2d30b72
    • B
      auto merge of #12020 : alexcrichton/rust/output-flags, r=brson · c13a929d
      bors 提交于
      This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib,
      --lib, and --bin flags from rustc, adding the following flags:
      
      * --emit=[asm,ir,bc,obj,link]
      * --crate-type=[dylib,rlib,staticlib,bin,lib]
      
      The -o option has also been redefined to be used for *all* flavors of outputs.
      This means that we no longer ignore it for libraries. The --out-dir remains the
      same as before.
      
      The new logic for files that rustc emits is as follows:
      
      1. Output types are dictated by the --emit flag. The default value is
         --emit=link, and this option can be passed multiple times and have all options
         stacked on one another.
      2. Crate types are dictated by the --crate-type flag and the #[crate_type]
         attribute. The flags can be passed many times and stack with the crate
         attribute.
      3. If the -o flag is specified, and only one output type is specified, the
         output will be emitted at this location. If more than one output type is
         specified, then the filename of -o is ignored, and all output goes in the
         directory that -o specifies. The -o option always ignores the --out-dir
         option.
      4. If the --out-dir flag is specified, all output goes in this directory.
      5. If -o and --out-dir are both not present, all output goes in the directory of
         the crate file.
      6. When multiple output types are specified, the filestem of all output is the
         same as the name of the CrateId (derived from a crate attribute or from the
         filestem of the crate file).
      
      Closes #7791
      Closes #11056
      Closes #11667
      c13a929d
    • B
      auto merge of #12007 : Arcterus/rust/libgetopts, r=cmr · 680925e2
      bors 提交于
      Should help towards finishing #8784.
      680925e2
    • A
      Redesign output flags for rustc · 6e7968b1
      Alex Crichton 提交于
      This commit removes the -c, --emit-llvm, -s, --rlib, --dylib, --staticlib,
      --lib, and --bin flags from rustc, adding the following flags:
      
      * --emit=[asm,ir,bc,obj,link]
      * --crate-type=[dylib,rlib,staticlib,bin,lib]
      
      The -o option has also been redefined to be used for *all* flavors of outputs.
      This means that we no longer ignore it for libraries. The --out-dir remains the
      same as before.
      
      The new logic for files that rustc emits is as follows:
      
      1. Output types are dictated by the --emit flag. The default value is
         --emit=link, and this option can be passed multiple times and have all
         options stacked on one another.
      2. Crate types are dictated by the --crate-type flag and the #[crate_type]
         attribute. The flags can be passed many times and stack with the crate
         attribute.
      3. If the -o flag is specified, and only one output type is specified, the
         output will be emitted at this location. If more than one output type is
         specified, then the filename of -o is ignored, and all output goes in the
         directory that -o specifies. The -o option always ignores the --out-dir
         option.
      4. If the --out-dir flag is specified, all output goes in this directory.
      5. If -o and --out-dir are both not present, all output goes in the current
         directory of the process.
      6. When multiple output types are specified, the filestem of all output is the
         same as the name of the CrateId (derived from a crate attribute or from the
         filestem of the crate file).
      
      Closes #7791
      Closes #11056
      Closes #11667
      6e7968b1
    • A
      getopts: fixed a failing test · 968ce53d
      Arcterus 提交于
      968ce53d
    • A
      getopts: unify tests · 2ce7019b
      Arcterus 提交于
      2ce7019b
    • A
      getopts: replaced base functions with those from group · c09ca940
      Arcterus 提交于
      c09ca940
    • A
      Move getopts out of extra · 9752c630
      Arcterus 提交于
      9752c630
    • B
      auto merge of #12053 : fhahn/rust/remove-str-in-comment, r=alexcrichton · 66b9c356
      bors 提交于
      This tiny pull request updates a comment referring to `@str` which was replaced by `(InternedString,StrStyle)` .
      
      related to #10516
      66b9c356
    • B
      f039d10c
  3. 06 2月, 2014 8 次提交