- 30 10月, 2020 1 次提交
-
-
由 LeSeulArtichaut 提交于
-
- 27 10月, 2020 1 次提交
-
-
由 Rustin-Liu 提交于
-
- 21 10月, 2020 2 次提交
- 15 10月, 2020 1 次提交
-
-
由 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
-
- 26 9月, 2020 1 次提交
-
-
由 est31 提交于
-
- 21 9月, 2020 1 次提交
-
-
由 yuk1ty 提交于
-
- 13 9月, 2020 1 次提交
-
-
由 Eric Huss 提交于
-
- 04 9月, 2020 1 次提交
-
-
由 LeSeulArtichaut 提交于
-
- 31 8月, 2020 1 次提交
-
-
由 David Wood 提交于
This commit moves `transparent_newtype_field` and `is_zst` to `LateContext` where they are used, rather than being on the `VariantDef` and `TyS` types. Signed-off-by: NDavid Wood <david@davidtw.co>
-
- 30 8月, 2020 1 次提交
-
-
由 mark 提交于
-
- 25 8月, 2020 2 次提交
-
-
由 jumbatm 提交于
Co-authored-by: NBastian Kauschke <bastian_kauschke@hotmail.de>
-
由 jumbatm 提交于
Fixes a false positive for transparent newtype with a non-zero member.
-
- 18 8月, 2020 1 次提交
-
-
由 Ujjwal Sharma 提交于
-
- 16 8月, 2020 2 次提交
-
-
由 David Wood 提交于
This commit simplifies `is_range_literal` by checking for `QPath::LangItem` containing range-related lang items, rather than using a heuristic. Co-authored-by: NMatthew Jasper <mjjasper1@gmail.com> Signed-off-by: NDavid Wood <david@davidtw.co>
-
由 Gurpreet Singh 提交于
-
- 08 8月, 2020 2 次提交
-
-
由 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`
-
由 Matthias Krüger 提交于
-
- 30 7月, 2020 4 次提交
-
-
由 jumbatm 提交于
-
由 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`.
-
由 jumbatm 提交于
Co-authored-by: NTeymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
-
由 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).
-
- 18 7月, 2020 1 次提交
-
-
由 David Wood 提交于
This commit stops linting against `Box` in `extern "C" fn`s for the `improper_ctypes_definitions` lint - boxes are documented to be FFI-safe. Signed-off-by: NDavid Wood <david@davidtw.co>
-
- 17 7月, 2020 1 次提交
-
-
由 Valentin Lazureanu 提交于
-
- 15 7月, 2020 1 次提交
-
-
由 David Wood 提交于
This commit re-uses the `transparent_newtype_field` function instead of manually calling `is_zst` on normalized fields to determine which field in a transparent type is the non-zero-sized field, thus avoiding an ICE. Signed-off-by: NDavid Wood <david@davidtw.co>
-
- 03 7月, 2020 1 次提交
-
-
由 Eduard-Mihai Burtescu 提交于
-
- 26 6月, 2020 2 次提交
-
-
由 David Wood 提交于
This commit replaces the remaining uses of `ParamEnv::reveal_all` with `LateContext`'s `param_env` (normally `Reveal::UserFacing`). Signed-off-by: NDavid Wood <david@davidtw.co>
-
由 Eduard-Mihai Burtescu 提交于
-
- 24 6月, 2020 3 次提交
-
-
由 David Wood 提交于
This commit adjusts the behaviour introduced in a previous commit so that generic parameters and projections are only allowed in the definitions mode - and are otherwise a bug. Generic parameters in declarations are prohibited earlier in the compiler, so if that branch were reached, it would be a bug. Signed-off-by: NDavid Wood <david@davidtw.co>
-
由 David Wood 提交于
This commit changes the improper ctypes lint (when operating on definitions) to consider raw pointers or references to sized types as FFI-safe. Signed-off-by: NDavid Wood <david@davidtw.co>
-
由 David Wood 提交于
This commit adds a new lint - `improper_ctypes_definitions` - which functions identically to `improper_ctypes`, but on `extern "C" fn` definitions (as opposed to `improper_ctypes`'s `extern "C" {}` declarations). Signed-off-by: NDavid Wood <david@davidtw.co>
-
- 20 6月, 2020 1 次提交
-
-
由 David Wood 提交于
This commit normalizes projections which contain opaque types (opaque types are otherwise linted against, which is would have previously made the test cases added in this commit fail). Signed-off-by: NDavid Wood <david@davidtw.co>
-
- 19 6月, 2020 3 次提交
-
-
由 David Wood 提交于
This commit removes the normalization from `transparent_newtype_field` - turns out it wasn't necessary and that makes it a bunch simpler - particularly when handling projections. Signed-off-by: NDavid Wood <david@davidtw.co>
-
由 David Wood 提交于
This commit applies the changes introduced in #72890 to both enum variants and unions - where the logic prior to #72890 was duplicated. Signed-off-by: NDavid Wood <david@davidtw.co>
-
由 David Wood 提交于
Opaque types cannot be used in extern declarations, and normally cannot exist in fields - except with type aliases to `impl Trait` and projections which normalize to them. Signed-off-by: NDavid Wood <david@davidtw.co>
-
- 16 6月, 2020 1 次提交
-
-
由 mark 提交于
-
- 10 6月, 2020 1 次提交
-
-
由 Lzu Tao 提交于
-
- 09 6月, 2020 2 次提交
-
-
由 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>
-
由 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>
-
- 30 5月, 2020 1 次提交
-
-
由 Ralf Jung 提交于
-