- 15 6月, 2020 1 次提交
-
-
由 David Wood 提交于
This commit adds a `Closure` variant to `NonStructuralMatchTy` in `structural_match`, fixing an ICE which can occur when `impl_trait_in_bindings` is used with constants. Signed-off-by: NDavid Wood <david@davidtw.co>
-
- 14 6月, 2020 1 次提交
-
-
由 Dylan MacKenzie 提交于
-
- 13 6月, 2020 1 次提交
-
-
由 Lzu Tao 提交于
-
- 12 6月, 2020 6 次提交
-
-
由 Aaron Hill 提交于
-
由 Aaron Hill 提交于
-
由 Ayush Kumar Mishra 提交于
Minor refactoring Minor refactoring Update src/librustc_error_codes/error_codes/E0724.md Co-authored-by: NDavid Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co> Update src/librustc_error_codes/error_codes/E0724.md Co-authored-by: NDavid Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co> Update src/librustc_error_codes/error_codes/E0724.md Co-authored-by: NDavid Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co> Minor refactoring
-
由 Matthew Jasper 提交于
-
由 Ayaz Hafiz 提交于
-
由 Ayaz Hafiz 提交于
Given a code ```rust fn foo(x: u8, y: u32) -> bool { x > y } fn main() {} ``` it could be more helpful to provide a suggestion to do "u32::from(x)" rather than "y.try_into().unwrap()", since the latter may panic. We do this by passing the LHS of a binary expression up the stack into the coercion checker. Closes #73145
-
- 11 6月, 2020 7 次提交
-
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
This is consistent with types.
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Amanieu d'Antras 提交于
-
由 Tyler Mandry 提交于
Fixes #73050
-
由 Aaron Hill 提交于
Fixes #69977 When we parse a chain of method calls like `foo.a().b().c()`, each `MethodCallExpr` gets assigned a span that starts at the beginning of the call chain (`foo`). While this is useful for diagnostics, it means that `Location::caller` will return the same location for every call in a call chain. This PR makes us separately record the span of the function name and arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This `Span` is passed through HIR lowering and MIR building to `TerminatorKind::Call`, where it is used in preference to `Terminator.source_info.span` when determining `Location::caller`. This new span is also useful for diagnostics where we want to emphasize a particular method call - for an example, see https://github.com/rust-lang/rust/pull/72389#discussion_r436035990
-
- 10 6月, 2020 4 次提交
-
-
由 Guillaume Gomez 提交于
-
由 Lzu Tao 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Santiago Pastorino 提交于
-
- 09 6月, 2020 14 次提交
-
-
由 Amanieu d'Antras 提交于
-
由 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>
-
由 David Wood 提交于
This commit adds a test of the improper ctypes lint, checking that return type are normalized bethat return types are normalized before being checked for FFI-safety, and that transparent newtype wrappers are FFI-safe if the type being wrapped is FFI-safe. Signed-off-by: NDavid Wood <david@davidtw.co>
-
由 Dylan McKay 提交于
Patch generated with `./x.py test --stage 1 src/test/ui/feature-gates --bless`.
-
由 Dylan McKay 提交于
-
由 Jake Goulding 提交于
-
由 Ayush Kumar Mishra 提交于
Fixed failing test-cases Remove noisy suggestion of hash_map #72642 Fixed failing test-cases
-
由 Aaron Hill 提交于
This is only really useful in debug messages, so I've switched to calling `span_to_string` in any place that causes a `Span` to end up in user-visible output.
-
由 Aaron Hill 提交于
Previously, we would parse `struct Foo where;` and `struct Foo;` identically, leading to an 'empty' `where` clause being omitted during pretty printing. This will cause us to lose spans when proc-macros involved, since we will have a collected `where` token that does not appear in the pretty-printed item. We now explicitly track the presence of a `where` token during parsing, so that we can distinguish between `struct Foo where;` and `struct Foo;` during pretty-printing
-
由 Ayaz Hafiz 提交于
-
由 Ayaz Hafiz 提交于
-
由 Dylan MacKenzie 提交于
Co-authored-by: NAaron1011 <aa1ronham@gmail.com>
-
由 Dylan MacKenzie 提交于
-
- 08 6月, 2020 1 次提交
-
-
由 Nathan Corbyn 提交于
-
- 07 6月, 2020 5 次提交
-
-
由 Guillaume Gomez 提交于
-
由 Ilya Bobyr 提交于
When creating default values a trait method needs to be called with an explicit trait name. `Default::default()` seems redundant. A free function on the other hand, when imported directly, seems to be a better API, as it is just `default()`. When implementing the trait, a method is still required.
-
由 Jake Goulding 提交于
-
由 marmeladema 提交于
-
由 Amanieu d'Antras 提交于
-