1. 02 10月, 2014 3 次提交
  2. 01 10月, 2014 1 次提交
  3. 25 9月, 2014 1 次提交
    • M
      debuginfo: Make sure that all calls to drop glue are associated with debug locations. · 302486e4
      Michael Woerister 提交于
      This commit makes rustc emit debug locations for all call
      and invoke statements in LLVM IR, if they are contained
      within a function that debuginfo is enabled for. This is
      important because LLVM does not handle the case where a
      function body containing debuginfo is inlined into another
      function with debuginfo, but the inlined call statement
      does not have a debug location. In this case, LLVM will
      not know where (in terms of source code coordinates) the
      function was inlined to and we end up with some statements
      still linked to the source locations in there original,
      non-inlined function without any indication that they are
      indeed an inline-copy. Later, when generating DWARF from
      the IR, LLVM will interpret this as corrupt IR and abort.
      
      Unfortunately, the undesirable case described above can
      still occur when using LTO. If there is a crate compiled
      without debuginfo calling into a crate compiled with
      debuginfo, we again end up with the conditions triggering
      the error. This is why some LTO tests still fail with the
      dreaded assertion, if the standard library was built with
      debuginfo enabled.
      That is, `RUSTFLAGS_STAGE2=-g make rustc-stage2` will
      succeed but `RUSTFLAGS_STAGE2=-g make check` will still
      fail after this commit has been merged. This is a problem
      that has to be dealt with separately.
      
      Fixes #17201
      Fixes #15816
      Fixes #15156
      302486e4
  4. 21 9月, 2014 1 次提交
  5. 19 9月, 2014 1 次提交
  6. 17 9月, 2014 2 次提交
  7. 02 9月, 2014 1 次提交
  8. 27 8月, 2014 2 次提交
  9. 21 8月, 2014 1 次提交
    • C
      librustc: handle repr on structs, require it for ffi, unify with packed · 6e8ff999
      Corey Richardson 提交于
      As of RFC 18, struct layout is undefined. Opting into a C-compatible struct
      layout is now down with #[repr(C)]. For consistency, specifying a packed
      layout is now also down with #[repr(packed)]. Both can be specified.
      
      To fix errors caused by this, just add #[repr(C)] to the structs, and change
       #[packed] to #[repr(packed)]
      
      Closes #14309
      
      [breaking-change]
      6e8ff999
  10. 15 8月, 2014 1 次提交
  11. 12 8月, 2014 1 次提交
  12. 27 7月, 2014 1 次提交
  13. 25 7月, 2014 1 次提交
    • P
      librustc: Stop desugaring `for` expressions and translate them directly. · caa564be
      Patrick Walton 提交于
      This makes edge cases in which the `Iterator` trait was not in scope
      and/or `Option` or its variants were not in scope work properly.
      
      This breaks code that looks like:
      
          struct MyStruct { ... }
      
          impl MyStruct {
              fn next(&mut self) -> Option<int> { ... }
          }
      
          for x in MyStruct { ... } { ... }
      
      Change ad-hoc `next` methods like the above to implementations of the
      `Iterator` trait. For example:
      
          impl Iterator<int> for MyStruct {
              fn next(&mut self) -> Option<int> { ... }
          }
      
      Closes #15392.
      
      [breaking-change]
      caa564be
  14. 18 7月, 2014 1 次提交
    • P
      librustc: Remove cross-borrowing of `Box<T>` to `&T` from the language, · de70d763
      Patrick Walton 提交于
      except where trait objects are involved.
      
      Part of issue #15349, though I'm leaving it open for trait objects.
      Cross borrowing for trait objects remains because it is needed until we
      have DST.
      
      This will break code like:
      
          fn foo(x: &int) { ... }
      
          let a = box 3i;
          foo(a);
      
      Change this code to:
      
          fn foo(x: &int) { ... }
      
          let a = box 3i;
          foo(&*a);
      
      [breaking-change]
      de70d763
  15. 17 7月, 2014 1 次提交
  16. 16 7月, 2014 1 次提交
  17. 09 7月, 2014 1 次提交
  18. 02 7月, 2014 1 次提交
    • M
      debuginfo: Make names of types in debuginfo reliable and omit source locations... · 40e05413
      Michael Woerister 提交于
      debuginfo: Make names of types in debuginfo reliable and omit source locations from debug info type descriptions.
      
      So far, type names generated for debuginfo where a bit sketchy. It was not clearly defined when a name should be fully qualified and when not, if region parameters should be shown or not, and other things like that.
      This commit makes the debuginfo module responsible for creating type names instead of using ppaux::ty_to_str() and brings type names, as they show up in the DWARF information, in line with GCC and Clang:
      
      * The name of the type being described is unqualified. It's path is defined by its position in the namespace hierarchy.
      * Type arguments are always fully qualified, no matter if they would actually be in scope at the type definition location.
      
      Care is also taken to reliably make type names consistent across crate boundaries. That is, the code now tries make the type name the same, regardless if the type is in the local crate or reconstructed from metadata. Otherwise LLVM will complain about violating the one-definition-rule when using link-time-optimization.
      
      This commit also removes all source location information from type descriptions because these cannot be reconstructed for types instantiated from metadata. Again, with LTO enabled, this can lead to two versions of the debuginfo type description, one with and one without source location information, which then triggers the LLVM ODR assertion.
      Fortunately, source location information about types is rarely used, so this has little impact. Once source location information is preserved in metadata (#1972) it can also be reenabled for type descriptions.
      40e05413
  19. 30 6月, 2014 1 次提交
  20. 25 6月, 2014 1 次提交
    • A
      Test fixes from the rollup · cdccecb2
      Alex Crichton 提交于
      Closes #14482 (std: Bring back half of Add on String)
      Closes #15026 (librustc: Remove the fallback to `int` from typechecking.)
      Closes #15119 (Add more description to c_str::unwrap().)
      Closes #15120 (Add tests for #12470 and #14285)
      Closes #15122 (Remove the cheat sheet.)
      Closes #15126 (rustc: Always include the morestack library)
      Closes #15127 (Improve ambiguous pronoun.)
      Closes #15130 (Fix #15129)
      Closes #15131 (Add the Guide, add warning to tutorial.)
      Closes #15134 (Xfailed tests for hygiene, etc.)
      Closes #15135 (core: Add stability attributes to Clone)
      Closes #15136 (Some minor improvements to core::bool)
      Closes #15137 (std: Add stability attributes to primitive numeric modules)
      Closes #15141 (Fix grammar in tutorial)
      Closes #15143 (Remove few FIXMEs)
      Closes #15145 (Avoid unnecessary temporary on assignments)
      Closes #15147 (Small improvements for metaprogramming)
      Closes #15153 (librustc: Check function argument patterns for legality of by-move)
      Closes #15154 (test: Add a test for regions, traits, and variance.)
      Closes #15159 (rustc: Don't register syntax crates twice)
      Closes #13816 (Stabilize version output for rustc and rustdoc)
      cdccecb2
  21. 24 6月, 2014 1 次提交
  22. 19 6月, 2014 1 次提交
  23. 15 6月, 2014 1 次提交
    • A
      rustc: Obsolete the `@` syntax entirely · ade807c6
      Alex Crichton 提交于
      This removes all remnants of `@` pointers from rustc. Additionally, this removes
      the `GC` structure from the prelude as it seems odd exporting an experimental
      type in the prelude by default.
      
      Closes #14193
      [breaking-change]
      ade807c6
  24. 13 6月, 2014 1 次提交
    • M
      debuginfo: Generate cross-crate unique type identifiers for debuginfo types. · 0a98a4e4
      Michael Woerister 提交于
      With this change, rustc creates a unique type identifier for types in debuginfo. These type identifiers are used by LLVM to correctly handle link-time-optimization scenarios but also help rustc with dealing with inlining from other crates. For more information, see the documentation block at the top of librustc/middle/trans/debuginfo.rs.
      
      Fixes #13681.
      0a98a4e4
  25. 29 5月, 2014 1 次提交
    • M
      debuginfo: Make DWARF representation of enums uniform. · eea329b0
      Michael Woerister 提交于
      So far the DWARF information for enums was different
      for regular enums, univariant enums, Option-like enums,
      etc. Regular enums were encoded as unions of structs,
      while the other variants were encoded as bare structs.
      
      With the changes in this PR all enums are encoded as
      unions so that debuggers can reconstruct if something
      originally was a struct, a univariant enum, or an
      Option-like enum. For the latter case, information
      about the Null variant is encoded into the union field
      name. This information can then be used by the
      debugger to print a None value actually as None
      instead of Some(0x0).
      eea329b0
  26. 25 5月, 2014 1 次提交
  27. 24 5月, 2014 1 次提交
  28. 18 5月, 2014 1 次提交
  29. 15 5月, 2014 1 次提交
  30. 11 5月, 2014 1 次提交
    • A
      core: Remove the cast module · f94d671b
      Alex Crichton 提交于
      This commit revisits the `cast` module in libcore and libstd, and scrutinizes
      all functions inside of it. The result was to remove the `cast` module entirely,
      folding all functionality into the `mem` module. Specifically, this is the fate
      of each function in the `cast` module.
      
      * transmute - This function was moved to `mem`, but it is now marked as
                    #[unstable]. This is due to planned changes to the `transmute`
                    function and how it can be invoked (see the #[unstable] comment).
                    For more information, see RFC 5 and #12898
      
      * transmute_copy - This function was moved to `mem`, with clarification that is
                         is not an error to invoke it with T/U that are different
                         sizes, but rather that it is strongly discouraged. This
                         function is now #[stable]
      
      * forget - This function was moved to `mem` and marked #[stable]
      
      * bump_box_refcount - This function was removed due to the deprecation of
                            managed boxes as well as its questionable utility.
      
      * transmute_mut - This function was previously deprecated, and removed as part
                        of this commit.
      
      * transmute_mut_unsafe - This function doesn't serve much of a purpose when it
                               can be achieved with an `as` in safe code, so it was
                               removed.
      
      * transmute_lifetime - This function was removed because it is likely a strong
                             indication that code is incorrect in the first place.
      
      * transmute_mut_lifetime - This function was removed for the same reasons as
                                 `transmute_lifetime`
      
      * copy_lifetime - This function was moved to `mem`, but it is marked
                        `#[unstable]` now due to the likelihood of being removed in
                        the future if it is found to not be very useful.
      
      * copy_mut_lifetime - This function was also moved to `mem`, but had the same
                            treatment as `copy_lifetime`.
      
      * copy_lifetime_vec - This function was removed because it is not used today,
                            and its existence is not necessary with DST
                            (copy_lifetime will suffice).
      
      In summary, the cast module was stripped down to these functions, and then the
      functions were moved to the `mem` module.
      
          transmute - #[unstable]
          transmute_copy - #[stable]
          forget - #[stable]
          copy_lifetime - #[unstable]
          copy_mut_lifetime - #[unstable]
      
      [breaking-change]
      f94d671b
  31. 08 5月, 2014 1 次提交