- 31 12月, 2020 1 次提交
-
-
由 Yuki Okushi 提交于
-
- 26 12月, 2018 1 次提交
-
-
由 Mark Rousskov 提交于
-
- 14 8月, 2018 2 次提交
-
-
由 David Wood 提交于
-
由 David Wood 提交于
-
- 29 7月, 2015 1 次提交
-
-
由 Simonas Kazlauskas 提交于
Mostly by splitting error messages into proper pairs of errors and helps
-
- 19 5月, 2015 1 次提交
-
-
由 Ariel Ben-Yehuda 提交于
-
- 25 3月, 2015 1 次提交
-
-
由 Nick Cameron 提交于
This permits all coercions to be performed in casts, but adds lints to warn in those cases. Part of this patch moves cast checking to a later stage of type checking. We acquire obligations to check casts as part of type checking where we previously checked them. Once we have type checked a function or module, then we check any cast obligations which have been acquired. That means we have more type information available to check casts (this was crucial to making coercions work properly in place of some casts), but it means that casts cannot feed input into type inference. [breaking change] * Adds two new lints for trivial casts and trivial numeric casts, these are warn by default, but can cause errors if you build with warnings as errors. Previously, trivial numeric casts and casts to trait objects were allowed. * The unused casts lint has gone. * Interactions between casting and type inference have changed in subtle ways. Two ways this might manifest are: - You may need to 'direct' casts more with extra type information, for example, in some cases where `foo as _ as T` succeeded, you may now need to specify the type for `_` - Casts do not influence inference of integer types. E.g., the following used to type check: ``` let x = 42; let y = &x as *const u32; ``` Because the cast would inform inference that `x` must have type `u32`. This no longer applies and the compiler will fallback to `i32` for `x` and thus there will be a type error in the cast. The solution is to add more type information: ``` let x: u32 = 42; let y = &x as *const u32; ```
-
- 16 3月, 2015 1 次提交
-
-
由 Tamir Duberstein 提交于
-
- 20 12月, 2014 1 次提交
-
-
由 Nick Cameron 提交于
This does NOT break any existing programs because the `[_, ..n]` syntax is also supported.
-
- 29 6月, 2014 1 次提交
-
-
由 Alex Crichton 提交于
-
- 25 6月, 2014 1 次提交
-
-
由 Patrick Walton 提交于
vector-reference-to-unsafe-pointer-to-element cast if the type to be casted to is not fully specified. This is a conservative change to fix the user-visible symptoms of the issue. A more flexible treatment would delay cast checks to after function typechecking. This can break code that did: let x: *u8 = &([0, 0]) as *_; Change this code to: let x: *u8 = &([0, 0]) as *u8; Closes #14893. [breaking-change]
-