- 16 2月, 2020 7 次提交
-
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 bors 提交于
Use `ResultsCursor` for `elaborate_drops` Some cleanup after #68241. The old code was using a custom cursor-like struct called `InitializationData`.
-
由 bors 提交于
Record proc macro harness order for use during metadata deserialization Fixes #68690 When we generate the proc macro harness, we now explicitly recorder the order in which we generate entries. We then use this ordering data to deserialize the correct proc-macro-data from the crate metadata.
-
由 bors 提交于
Struct variant field search Fixes #16017. Reopening of #64724. cc @tomjakubowski cc @ollie27 r? @kinnison
-
由 Aaron Hill 提交于
-
由 Aaron Hill 提交于
Fixes #68690 When we generate the proc macro harness, we now explicitly recorder the order in which we generate entries. We then use this ordering data to deserialize the correct proc-macro-data from the crate metadata.
-
- 15 2月, 2020 33 次提交
-
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #64069 (Added From<Vec<NonZeroU8>> for CString) - #66721 (implement LowerExp and UpperExp for integers) - #69106 (Fix std::fs::copy on WASI target) - #69154 (Avoid calling `fn_sig` on closures) - #69166 (Check `has_typeck_tables` before calling `typeck_tables_of`) - #69180 (Suggest a comma if a struct initializer field fails to parse) Failed merges: r? @ghost
-
由 Dylan DPC 提交于
Suggest a comma if a struct initializer field fails to parse Currently, we emit a "try adding a comma" suggestion if a comma is missing in a struct definition. However, we emit no such suggestion if a comma is missing in a struct initializer. This commit adds a "try adding a comma" suggestion when we don't find a comma during the parsing of a struct initializer field. The change to `src/test/ui/parser/removed-syntax-with-1.stderr` isn't great, but I don't see a good way of avoiding it.
-
由 Dylan DPC 提交于
Check `has_typeck_tables` before calling `typeck_tables_of` Fixes #68684 r? @matthewjasper
-
由 Dylan DPC 提交于
Avoid calling `fn_sig` on closures Fixes #68060 r? @petrochenkov
-
由 Dylan DPC 提交于
Fix std::fs::copy on WASI target Previously `std::fs::copy` on wasm32-wasi would reuse code from the `sys_common` module and would successfully copy contents of the file just to fail right before closing it. This was happening because `sys_common::copy` tries to copy permissions of the file, but permissions are not a thing in WASI (at least yet) and `set_permissions` is implemented as an unconditional runtime error. This change instead adds a custom working implementation of `std::fs::copy` (like Rust already has on some other targets) that doesn't try to call `set_permissions` and is essentially a thin wrapper around `std::io::copy`. Fixes #68560.
-
由 Dylan DPC 提交于
implement LowerExp and UpperExp for integers Addresses https://github.com/rust-lang/rust/issues/39479 This implementation is heavily based on the preexisting `macro_rules! impl_Display` in the same file. I don't like the liberal use of unsafe in that macro and would like to modify it so `unsafe` is only present where necessary. What is Rust's policy on doing such modifications? Also, I couldn't figure out where to put tests, can I have some help with that?
-
由 Dylan DPC 提交于
Added From<Vec<NonZeroU8>> for CString Added a `From<Vec<NonZeroU8>>` `impl` for `CString` # Rationale - `CString::from_vec_unchecked` is a subtle function, that makes `unsafe` code harder to audit when the generated `Vec`'s creation is non-trivial. This `impl` allows to write safer `unsafe` code thanks to the very explicit semantics of the `Vec<NonZeroU8>` type. - One such situation is when trying to `.read()` a `CString`, see issue #59229. - this lead to a PR: #59314, that was closed for being too specific / narrow (it only targetted being able to `.read()` a `CString`, when this pattern could have been generalized). - the issue suggested another route, based on `From<Vec<NonZeroU8>>`, which is indeed a less general and more concise code pattern. - quoting @shnatsel: - > For me the main thing about making this safe is simplifying auditing - people have spent like an hour looking at just this one unsafe block in libflate because it's not clear what exactly is unchecked, so you have to look it up when auditing anyway. This has distracted us from much more serious memory safety issues the library had. Having this trivial impl in stdlib would turn this into safe code with compiler more or less guaranteeing that it's fine, and save anyone auditing the code a whole lot of time.
-
由 Aaron Hill 提交于
Currently, we emit a "try adding a comma" suggestion if a comma is missing in a struct definition. However, we emit no such suggestion if a comma is missing in a struct initializer. This commit adds a "try adding a comma" suggestion when we don't find a comma during the parsing of a struct initializer field. The change to `src/test/ui/parser/removed-syntax-with-1.stderr` isn't great, but I don't see a good way of avoiding it.
-
由 Max Blachman 提交于
-
由 bors 提交于
Infer regions for opaque types in borrowck This is a step towards the goal of typeck not doing region inference. The commits up to `Arena allocate the result of mir_borrowck` are various bug fixes and prerequisites. The remaining commits move opaque type inference to borrow checking. r? @nikomatsakis
-
由 bors 提交于
Rollup of 7 pull requests Successful merges: - #68129 (Correct inference of primitive operand type behind binary operation) - #68475 (Use a `ParamEnvAnd<Predicate>` for caching in `ObligationForest`) - #68856 (typeck: clarify def_bm adjustments & add tests for or-patterns) - #69051 (simplify_try: address some of eddyb's comments) - #69128 (Fix extra subslice lowering) - #69150 (Follow-up to #68848) - #69164 (Update pulldown-cmark dependency) Failed merges: r? @ghost
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
This ensures that NLL will infer suitable values for regions in opaque types when it's possible.
-
由 Matthew Jasper 提交于
Also correctly calculate what the upper bounds are.
-
由 Matthew Jasper 提交于
* Use better span for member constraint errors * Avoid a bad suggestion * Don't report member constraint errors if we have other universal region errors.
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
We want type checking for function bodies to ignore/erase regions. As such, we need to infer the regions in opaque types in borrow check instead.
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Matthew Jasper 提交于
-
由 Yuki Okushi 提交于
-
由 Yuki Okushi 提交于
Update pulldown-cmark dependency r? @kinnison cc @ollie27 Reopening of #65894.