1. 22 5月, 2014 7 次提交
  2. 21 5月, 2014 33 次提交
    • B
      auto merge of #14326 : huonw/rust/tiny-fixes, r=pnkfelix · 803e92de
      bors 提交于
      The changes to flowgraph make invalid invocations slightly more forgiving by (trying to) provide slightly more information and by avoiding the ICE message.
      803e92de
    • P
      Remove two outdated FIXMEs from complex.rs · fe7cc810
      Piotr Jawniak 提交于
      fe7cc810
    • B
      auto merge of #14324 : zecozephyr/rust/docfix, r=luqmana · 1edb0e53
      bors 提交于
      1edb0e53
    • H
      rustc: improve error messages from wrong --pretty flowgraph use. · feb91f32
      Huon Wilson 提交于
      This defers to .fatal and .span_fatal for errors (rather than `fail!`
      which prints the ICE message). It also adds the span lookup when an id
      doesn't correspond to a block, to show what it is pointing at.
      
      It also makes the argument parser slightly looser, so that passing
      `--pretty flowgraph` recognises the `flowgraph` part and suggests to use
      an integer.
      feb91f32
    • H
      rustc: ng -> gn, fix a typo in a string. · dd5365af
      Huon Wilson 提交于
      dd5365af
    • H
      rustc: rename the lint `level` enum for style. · a2396634
      Huon Wilson 提交于
      CamelCase all the way!
      a2396634
    • B
      auto merge of #14319 : kballard/rust/rename_rng_choose_option, r=alexcrichton · a400b31f
      bors 提交于
      Rng.choose() is used so rarely that it doesn't necessitate having two
      methods, especially since the failing, non-option variant also requires
      Clone.
      
      [breaking-change]
      a400b31f
    • J
      Updated doc with correct type. · e549601b
      Jonathan Bailey 提交于
      e549601b
    • B
    • B
      auto merge of #14315 : kballard/rust/stdreader_isatty, r=alexcrichton · 4605232f
      bors 提交于
      StdWriter has .isatty(). StdReader can trivially vend the same function,
      and someone asked today on IRC how to call isatty() on stdin.
      4605232f
    • B
      auto merge of #14259 : alexcrichton/rust/core-mem, r=brson · 4afc15e3
      bors 提交于
      Excluding the functions inherited from the cast module last week (with marked
      stability levels), these functions received the following treatment.
      
      * size_of - this method has become #[stable]
      * nonzero_size_of/nonzero_size_of_val - these methods have been removed
      * min_align_of - this method is now #[stable]
      * pref_align_of - this method has been renamed without the
        `pref_` prefix, and it is the "default alignment" now. This decision is in line
        with what clang does (see url linked in comment on function). This function
        is now #[stable].
      * init - renamed to zeroed and marked #[stable]
      * uninit - marked #[stable]
      * move_val_init - renamed to overwrite and marked #[stable]
      * {from,to}_{be,le}{16,32,64} - all functions marked #[stable]
      * swap/replace/drop - marked #[stable]
      * size_of_val/min_align_of_val/align_of_val - these functions are marked
        #[unstable], but will continue to exist in some form. Concerns have been
        raised about their `_val` prefix.
      4afc15e3
    • A
      core: Stabilize the mem module · 19dc3b50
      Alex Crichton 提交于
      Excluding the functions inherited from the cast module last week (with marked
      stability levels), these functions received the following treatment.
      
      * size_of - this method has become #[stable]
      * nonzero_size_of/nonzero_size_of_val - these methods have been removed
      * min_align_of - this method is now #[stable]
      * pref_align_of - this method has been renamed without the
        `pref_` prefix, and it is the "default alignment" now. This decision is in line
        with what clang does (see url linked in comment on function). This function
        is now #[stable].
      * init - renamed to zeroed and marked #[stable]
      * uninit - marked #[stable]
      * move_val_init - renamed to overwrite and marked #[stable]
      * {from,to}_{be,le}{16,32,64} - all functions marked #[stable]
      * swap/replace/drop - marked #[stable]
      * size_of_val/min_align_of_val/align_of_val - these functions are marked
        #[unstable], but will continue to exist in some form. Concerns have been
        raised about their `_val` prefix.
      
      [breaking-change]
      19dc3b50
    • K
      Change std inject attributes to outer attributes · 23ca66ec
      Kevin Ballard 提交于
      The #[phase(syntax,link)] attribute on `extern crate std` needs to be an
      outer attribute so it can pretty-print properly.
      
      Also add `#![no_std]` and `#[feature(phase)]` so compiling the
      pretty-printed source will work.
      23ca66ec
    • B
      auto merge of #14293 : alexcrichton/rust/weak-lang-items, r=brson · feb9f302
      bors 提交于
      This commit is part of the ongoing libstd facade efforts (cc #13851). The
      compiler now recognizes some language items as "extern { fn foo(...); }" and
      will automatically perform the following actions:
      
      1. The foreign function has a pre-defined name.
      2. The crate and downstream crates can only be built as rlibs until a crate
         defines the lang item itself.
      3. The actual lang item has a pre-defined name.
      
      This is essentially nicer compiler support for the hokey
      core-depends-on-std-failure scheme today, but it is implemented the same way.
      The details are a little more hidden under the covers.
      
      In addition to failure, this commit promotes the eh_personality and
      rust_stack_exhausted functions to official lang items. The compiler can generate
      calls to these functions, causing linkage errors if they are left undefined. The
      checking for these items is not as precise as it could be. Crates compiling with
      `-Z no-landing-pads` will not need the eh_personality lang item, and crates
      compiling with no split stacks won't need the stack exhausted lang item. For
      ease, however, these items are checked for presence in all final outputs of the
      compiler.
      
      It is quite easy to define dummy versions of the functions necessary:
      
          #[lang = "stack_exhausted"]
          extern fn stack_exhausted() { /* ... */ }
      
          #[lang = "eh_personality"]
          extern fn eh_personality() { /* ... */ }
      
      cc #11922, rust_stack_exhausted is now a lang item
      cc #13851, libcollections is blocked on eh_personality becoming weak
      feb9f302
    • K
      Remove Rng.choose(), rename Rng.choose_option() to .choose() · b8270c8d
      Kevin Ballard 提交于
      Rng.choose() is used so rarely that it doesn't necessitate having two
      methods, especially since the failing, non-option variant also requires
      Clone.
      
      [breaking-change]
      b8270c8d
    • K
      c7454853
    • K
      Add .isatty() method to StdReader · dc921c14
      Kevin Ballard 提交于
      StdWriter has .isatty(). StdReader can trivially vend the same function,
      and someone asked today on IRC how to call isatty() on stdin.
      dc921c14
    • B
      auto merge of #13823 : pnkfelix/rust/fsk-fix-13805, r=alexcrichton · f30382d6
      bors 提交于
      Make configure script respect (and save) values for `CC`, `CXX`, `CFLAGS` etc.
      
      I mostly tried to remain backwards compatible with old invocations of
      the `configure` script; if you do not want to use `CC` et al., you
      should not have to; you can keep using `--enable-clang` and/or
      `--enable-ccache`.
      
      The overall intention is to capture the following precedences for
      guessing the C compiler:
      
       1. Value of `CC` at `make` invocation time.
       2. Value of `CC` at `configure` invocation time.
       3. Compiler inferred at configure invocation time (`gcc` or `clang`).
      
      The strategy is to check (at `configure` time) if each of the
      environment variables is set, and if so, save its value in a
      corresponding `CFG_` variable (e.g. `CFG_CC`).
      
      The `configure` script also does not attempt to infer the compiler if
      `CC` is set; but if `--enable-clang` was passed, then it *does* still
      attempt to validate that the clang version is compatible.
      
      Then, in the makefiles, if `CC` is not set but `CFG_CC` is, then we
      use the `CFG_CC` setting as `CC`.
      
      Fix #13805.
      f30382d6
    • A
      green: Remove some unsafe code in BasicLoop · 54f6eacf
      Alex Crichton 提交于
      54f6eacf
    • B
      auto merge of #14305 : tbu-/rust/pr_doc_bytes, r=huonw · e5464527
      bors 提交于
      Only an example was needed, as the ability to write uints into the string is
      already mentioned.
      
      Fix #7102.
      e5464527
    • B
      auto merge of #13975 : nikomatsakis/rust/issue-13794-fn-subtyping-and-static, r=pnkfelix · 6ecf7d97
      bors 提交于
      Tweak region inference to ignore constraints like `'a <= 'static`, since they
      have no value. This also ensures that we can handle some obscure cases of fn
      subtyping with bound regions that we didn't used to handle correctly.
      
      Fixes #13974.
      6ecf7d97
    • K
      vim: Handle box expressions specially · bf0c6d81
      Kevin Ballard 提交于
      Attempt to highlight the placement expression in a `box (expr) foo`
      expression. Also treat GC as a keyword within the placement expression.
      
      This doesn't work correctly for arbitrary expressions. Notably, this
      makes no attempt at balancing delimiters. I believe handling that will
      require rewriting the syntax rules to add a region for every pair of
      delimiters. That may be a desirable thing to do in the end, because we
      can then rewrite our indent rules based on the syntax and get rid of
      cindent(), but for the time being, we'll just live with the limitation.
      bf0c6d81
    • T
      Add non-utf8 byte to the bytes!() example · 84f43c6a
      Tobias Bucher 提交于
      Only an example was needed, as the ability to write uints into the string is
      already mentioned.
      
      Fix #7102.
      84f43c6a
    • K
      Update rust.vim for the latest prelude/keywords · 229338d6
      Kevin Ballard 提交于
      229338d6
    • B
      auto merge of #14304 : brson/rust/moredocs, r=kballard · 4dff9cbf
      bors 提交于
      Includes module docs for `cell`.
      4dff9cbf
    • F
      Make configure respect (and save) values for `CC`, `CXX`, `CFLAGS`, etc. · ae67b74e
      Felix S. Klock II 提交于
      I mostly tried to remain backwards compatible with old invocations of
      the `configure` script; if you do not want to use `CC` et al., you
      should not have to; you can keep using `--enable-clang` and/or
      `--enable-ccache`.
      
      The overall intention is to capture the following precedences for
      guessing the C compiler:
      
       1. Value of `CC` at make invocation time.
       2. Value of `CC` at configure invocation time.
       3. Compiler inferred at configure invocation time (`gcc` or `clang`).
      
      The strategy is to check (at `configure` time) if each of the
      environment variables is set, and if so, save its value in a
      corresponding `CFG_` variable (e.g. `CFG_CC`).
      
      Then, in the makefiles, if `CC` is not set but `CFG_CC` is, then we
      use the `CFG_CC` setting as `CC`.
      
      Also, I fold the potential user-provided `CFLAGS` and `CXXFLAGS`
      values into all of the per-platform `CFLAGS` and `CXXFLAGS` settings.
      (This was opposed to adding `$(CFLAGS)` in an ad-hoc manner to various
      parts of the mk files.)
      
      Fix #13805.
      
      ----
      
      Note that if you try to set the compiler to clang via the `CC` and
      `CXX` environment variables, you will probably need to also set
      `CXXFLAGS` to `--enable-libcpp` so that LLVM will be configured
      properly.
      
      ----
      
      Introduce CFG_USING_CLANG, which is distinguished from
      CFG_ENABLE_CLANG because the former represents "we think we're using
      clang, choose appropriate warning-control options" while the latter
      represents "we asked configure (or the host required) that we attempt
      to use clang, so check that we have an appropriate version of clang."
      
      The main reason I added this is that I wanted to allow the user to
      choose clang via setting the `CC` environment variable, but I did not
      want that method of selection to get confused with the user passing
      the `--enable-clang` option.
      
      ----
      
      A digression: The `configure` script does not infer the compiler
      setting if `CC` is set; but if `--enable-clang` was passed, then it
      *does* still attempt to validate that the clang version is compatible.
      
      Supporting this required revising `CLANG_VERSION` check to be robust
      in face of user-provided `CC` value.
      
      In particular, on Travis, the `CC` is set to `gcc` and so the natural
      thing to do is to attempt to use `gcc` as the compiler, but Travis is
      also passing `--enable-clang` to configure.  So, what is the right
      answer in the face of these contradictory requests?
      
      One approach would be to have `--enable-clang` supersede the setting
      for `CC` (and instead just call whatever we inferred for `CFG_CLANG`).
      That sounds maximally inflexible to me (pnkfelix): a developer
      requesting a `CC` value probably wants it respected, and should be
      able to set it to something else; it is harder for that developer to
      hack our configure script to change its inferred path to clang.
      
      A second approach would be to blindly use the `CC` value but keep
      going through the clang version check when `--enable-clang` is turned
      on.  But on Travis (a Linux host), the `gcc` invocation won't print a
      clang version, so we would not get past the CLANG_VERSION check in
      that context.
      
      A third approach would be to never run the CLANG_VERSION check if `CC`
      is explicitly set.  That is not a terrible idea; but if the user uses
      `CC` to pass in a path to some other version of clang that they want
      to test, probably should still send that through the `CLANG_VERSION`
      check.
      
      So in the end I (pnkfelix) took a fourth approach: do the
      CLANG_VERSION check if `CC` is unset *or* if `CC` is set to a string
      ending with `clang`.  This way setting `CC` to things like
      `path/to/clang` or `ccache clang` will still go through the
      CLANG_VERSION check, while setting `CC` to `gcc` or some unknown
      compiler will skip the CLANG_VERSION check (regardless of whether the
      user passed --enable-clang to `configure`).
      
      ----
      
      Drive-by fixes:
      
      * The call that sets `CFG_CLANG_VERSION` was quoting `"$CFG_CC"` in
        its invocation, but that does not play nicely with someone who sets
        `$CFG_CC` to e.g. `ccache clang`, since you do not want to intepret
        that whole string as a command.
      
        (On the other hand, a path with spaces might need the quoted
        invocation.  Not sure which one of these corner use-cases is more
        important to support.)
      
      * Fix chk_cc error message to point user at `gcc` not `cc`.
      ae67b74e
    • K
      Add slice::MutableCloneableVector to the prelude · badde741
      Kevin Ballard 提交于
      Every other trait in slice is in the prelude, so it makes sense to
      provide MutableCloneableVector as well.
      badde741
    • B
      auto merge of #14283 : Ryman/rust/commented_compile_fail_error, r=kballard · f9bd6b4e
      bors 提交于
      Edit: This now only covers refactoring to regex.
      f9bd6b4e
    • B
      Address review comments · c9ab33a8
      Brian Anderson 提交于
      c9ab33a8
    • B
      core: Convert TODOs to FIXMEs · 26e4680a
      Brian Anderson 提交于
      26e4680a
    • B
      std: Alphabetize crate reexports for rustdoc · 1b8deb29
      Brian Anderson 提交于
      1b8deb29
    • B
      core: Spruce up the crate description · cea4c278
      Brian Anderson 提交于
      cea4c278
    • B
      core: More concise description for mod ops · 220313e5
      Brian Anderson 提交于
      220313e5