1. 30 10月, 2020 1 次提交
  2. 27 10月, 2020 1 次提交
  3. 21 10月, 2020 2 次提交
  4. 15 10月, 2020 1 次提交
    • E
      Replace target.target with target and target.ptr_width with target.pointer_width · 4fa55787
      est31 提交于
      Preparation for a subsequent change that replaces
      rustc_target::config::Config with its wrapped Target.
      
      On its own, this commit breaks the build. I don't like making
      build-breaking commits, but in this instance I believe that it
      makes review easier, as the "real" changes of this PR can be
      seen much more easily.
      
      Result of running:
      
      find compiler/ -type f -exec sed -i -e 's/target\.target\([)\.,; ]\)/target\1/g' {} \;
      find compiler/ -type f -exec sed -i -e 's/target\.target$/target/g' {} \;
      find compiler/ -type f -exec sed -i -e 's/target.ptr_width/target.pointer_width/g' {} \;
      ./x.py fmt
      4fa55787
  5. 26 9月, 2020 1 次提交
  6. 21 9月, 2020 1 次提交
  7. 13 9月, 2020 1 次提交
  8. 04 9月, 2020 1 次提交
  9. 31 8月, 2020 1 次提交
  10. 30 8月, 2020 1 次提交
  11. 25 8月, 2020 2 次提交
  12. 18 8月, 2020 1 次提交
  13. 16 8月, 2020 2 次提交
  14. 08 8月, 2020 2 次提交
    • N
      Eliminate the `SessionGlobals` from `librustc_ast`. · e539dd65
      Nicholas Nethercote 提交于
      By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This
      means they are accessed via the `Session`, rather than via TLS. A few
      `Attr` methods and `librustc_ast` functions are now methods of
      `Session`.
      
      All of this required passing a `Session` to lots of functions that didn't
      already have one. Some of these functions also had arguments removed, because
      those arguments could be accessed directly via the `Session` argument.
      
      `contains_feature_attr()` was dead, and is removed.
      
      Some functions were moved from `librustc_ast` elsewhere because they now need
      to access `Session`, which isn't available in that crate.
      - `entry_point_type()` --> `librustc_builtin_macros`
      - `global_allocator_spans()` --> `librustc_metadata`
      - `is_proc_macro_attr()` --> `Session`
      e539dd65
    • M
      a605e510
  15. 30 7月, 2020 4 次提交
    • J
      Handle structs with zst members. · 30a6f573
      jumbatm 提交于
      30a6f573
    • J
      Address code review comments. · 060666d0
      jumbatm 提交于
      - Make `is_repr_nullable_ptr` freestanding again to avoid usage of
      ImproperCTypesVisitor in ClashingExternDeclarations (and don't
      accidentally revert the ParamEnv::reveal_all() fix from a week earlier)
      - Revise match condition for 1 Adt, 1 primitive
      - Generalise check for non-null type so that it would also work for
      ranges which exclude any single value (all bits set, for example)
      - Make is_repr_nullable_ptr return the representable type instead of
      just a boolean, to avoid adding an additional, independent "source of
      truth" about the FFI-compatibility of Option-like enums. Also, rename to
      `repr_nullable_ptr`.
      060666d0
    • J
    • J
      Don't emit clashing decl lint for FFI-safe enums. · 3eaead7d
      jumbatm 提交于
      An example of an FFI-safe enum conversion is when converting
      Option<NonZeroUsize> to usize. Because the Some value must be non-zero,
      rustc can use 0 to represent the None variant, making this conversion is
      safe. Furthermore, it can be relied on (and removing this optimisation
      already would be a breaking change).
      3eaead7d
  16. 18 7月, 2020 1 次提交
  17. 17 7月, 2020 1 次提交
  18. 15 7月, 2020 1 次提交
  19. 03 7月, 2020 1 次提交
  20. 26 6月, 2020 2 次提交
  21. 24 6月, 2020 3 次提交
  22. 20 6月, 2020 1 次提交
  23. 19 6月, 2020 3 次提交
  24. 16 6月, 2020 1 次提交
  25. 10 6月, 2020 1 次提交
  26. 09 6月, 2020 2 次提交
    • D
      lint: transitive FFI-safety for transparent types · d4d3d7de
      David Wood 提交于
      This commit ensures that if a `repr(transparent)` newtype's only
      non-zero-sized field is FFI-safe then the newtype is also FFI-safe.
      
      Previously, ZSTs were ignored for the purposes of linting FFI-safety
      in transparent structs - thus, only the single non-ZST would be checked
      for FFI-safety. However, if the non-zero-sized field is a generic
      parameter, and is substituted for a ZST, then the type would be
      considered FFI-unsafe (as when every field is thought to be zero-sized,
      the type is considered to be "composed only of `PhantomData`" which is
      FFI-unsafe).
      
      In this commit, for transparent structs, the non-zero-sized field is
      identified (before any substitutions are applied, necessarily) and then
      that field's type (now with substitutions) is checked for FFI-safety
      (where previously it would have been skipped for being zero-sized in
      this case).
      
      To handle the case where the non-zero-sized field is a generic
      parameter, which is substituted for `()` (a ZST), and is being used
      as a return type - the `FfiUnsafe` result (previously `FfiPhantom`) is
      caught and silenced.
      Signed-off-by: NDavid Wood <david@davidtw.co>
      d4d3d7de
    • D
      lint: check for unit ret type after normalization · 3e7aabb1
      David Wood 提交于
      This commit moves the check that skips unit return types to after
      where the return type has been normalized - therefore ensuring that
      FFI-safety lints are not emitted for types which normalize to unit.
      Signed-off-by: NDavid Wood <david@davidtw.co>
      3e7aabb1
  27. 30 5月, 2020 1 次提交