- 07 12月, 2019 14 次提交
-
-
由 Mazdak Farrokhzad 提交于
get rid of __ in field names This old work-around should not be needed any more.
-
由 Mazdak Farrokhzad 提交于
Fix comment typos in src/libcore/alloc.rs
-
由 Mazdak Farrokhzad 提交于
Change "either" to "any" in Layout::from_size_align's docs
-
由 Mazdak Farrokhzad 提交于
accept union inside enum if not followed by identifier Fixes #66943
-
由 Mazdak Farrokhzad 提交于
Do not ICE on closure typeck Tackle #66868. r? @davidtwco
-
由 Mazdak Farrokhzad 提交于
Ditch `parse_in_attr` Fixes #66940 r? @petrochenkov
-
由 Mazdak Farrokhzad 提交于
Emit coercion suggestions in more places Fixes #66910 We have several different kinds of suggestions we can try to make when type coercion fails. However, we were previously only emitting these suggestions from `demand_coerce_diag`. This resulted in the compiler failing to emit applicable suggestions in several different cases, such as when the implicit return value of a function had the wrong type. This commit adds a new `emit_coerce_suggestions` method, which tries to emit a number of related suggestions. This method is called from both `demand_coerce_diag` and `CoerceMany::coerce_inner`, which covers a much wider range of cases than before. We now suggest using `.await` in more cases where it is applicable, among other improvements. I'm not happy about disabling the `issue-59756`, but from what I can tell, the suggestion infrastructure in rustc lacks any way of indicating mutually exclusive suggestions (and compiletest lacks a way to only apply a subset of available suggestions).
-
由 Mazdak Farrokhzad 提交于
Add `{f32,f64}::approx_unchecked_to<Int>` unsafe methods As discussed in https://github.com/rust-lang/rust/issues/10184 Currently, casting a floating point number to an integer with `as` is Undefined Behavior if the value is out of range. `-Z saturating-float-casts` fixes this soundness hole by making `as` “saturate” to the maximum or minimum value of the integer type (or zero for `NaN`), but has measurable negative performance impact in some benchmarks. There is some consensus in that thread for enabling saturation by default anyway, but provide an `unsafe fn` alternative for users who know through some other mean that their values are in range. <del>The “fit” wording is copied from https://llvm.org/docs/LangRef.html#fptoui-to-instruction, but I’m not certain what it means exactly. Presumably this is after rounding towards zero, and the doc-test with `i8::MIN` seems to confirm this.</del> Clang presumably uses those LLVM intrinsics to implement C and C++ casts, whose respective standard specify that the value *after truncating to keep its integral part* must be representable in the target type.
-
由 Mazdak Farrokhzad 提交于
Add feature gate for mut refs in const fn r? @oli-obk
-
由 Mazdak Farrokhzad 提交于
-
由 Mazdak Farrokhzad 提交于
-
由 Mazdak Farrokhzad 提交于
-
由 bors 提交于
Rename `bool::then_*` to `bool::to_option_*` and use where appropriate Name change following https://github.com/rust-lang/rfcs/pull/2757. Also try it out throughout the compiler in places I think makes the code more readable.
-
由 Ralf Jung 提交于
-
- 06 12月, 2019 26 次提交
-
-
由 Matthew Kraai 提交于
-
由 Matthew Kraai 提交于
-
由 bors 提交于
Rollup of 11 pull requests Successful merges: - #66846 (Make try_mark_previous_green aware of cycles.) - #66959 (Remove potential cfgs duplicates) - #66988 (Fix angle bracket formatting when dumping MIR debug vars) - #66998 (Modified the testcases for VxWorks) - #67008 (rustdoc: Add test for fixed issue) - #67023 (SGX: Fix target linker used by bootstrap) - #67033 (Migrate to LLVM{Get,Set}ValueName2) - #67049 (Simplify {IoSlice, IoSliceMut}::advance examples and tests) - #67054 (codegen "unreachable" for invalid SetDiscriminant) - #67081 (Fix Query type docs) - #67085 (Remove boxed closures in address parser.) Failed merges: r? @ghost
-
由 Yuki Okushi 提交于
Remove boxed closures in address parser. Simplify address parser by removing unnecessary boxed closures. Also relevant for https://github.com/rust-lang/rfcs/pull/2832.
-
由 Yuki Okushi 提交于
Fix Query type docs `give` no longer exists, `compute` is used to generate query results now.
-
由 Yuki Okushi 提交于
codegen "unreachable" for invalid SetDiscriminant Follow-up from https://github.com/rust-lang/rust/pull/66960. I also realized I don't understand our policy for using `abort` vs `unreachable`. AFAIK `abort` is safe to call and just aborts the process, while `unreachable` is UB. But sometimes we use both, like here https://github.com/rust-lang/rust/blob/d825e35ee8325146e6c175a4c61bcb645b347d5e/src/librustc_codegen_ssa/mir/block.rs#L827-L828 and here https://github.com/rust-lang/rust/blob/d825e35ee8325146e6c175a4c61bcb645b347d5e/src/librustc_codegen_ssa/mir/block.rs#L264-L265 The second case is even more confusing because that looks like an unreachable `return` to me, so why would we codegen a safe abort there? r? @EddyB Cc @oli-obk
-
由 Yuki Okushi 提交于
Simplify {IoSlice, IoSliceMut}::advance examples and tests Remove unnecessary calls to `std::mem::replace` and make variables immutable.
-
由 Yuki Okushi 提交于
Migrate to LLVM{Get,Set}ValueName2 The deprecated `LLVM{Get,Set}ValueName` only work with NUL-terminated strings, but the `2` variants use explicit lengths, which fits better with Rust strings and slices. We now use these in new helper functions `llvm::{get,set}_value_name` that convert to/from `&[u8]`. Closes #64223. r? @rkruppe
-
由 Yuki Okushi 提交于
SGX: Fix target linker used by bootstrap Bootstrap, for some reason, overrides the target linker. This is not correct for x86_64-fortanix-unknown-sgx. Add such targets to the list of exceptions. r? @alexcrichton
-
由 Yuki Okushi 提交于
rustdoc: Add test for fixed issue #61732 was almost certainly fixed by #63400. Closes #61732
-
由 Yuki Okushi 提交于
Modified the testcases for VxWorks
-
由 Yuki Okushi 提交于
Fix angle bracket formatting when dumping MIR debug vars Fixes #66985
-
由 Yuki Okushi 提交于
Remove potential cfgs duplicates Fixes https://github.com/rust-lang/rust/issues/66921. Before going any further (the issue seems to be linked to metadata as far as I can tell). Do you think this is the good place to do it or should it be done before? r? @EddyB
-
由 Yuki Okushi 提交于
Make try_mark_previous_green aware of cycles. Fixes #61323 r? @michaelwoerister
-
由 Matthew Kraai 提交于
-
由 varkor 提交于
-
由 Simon Sapin 提交于
This makes `libcore/num/mod.rs` slightly smaller. It’s still 4911 lines and not easy to navigate. This doesn’t change any public API.
-
由 Simon Sapin 提交于
As discussed in https://github.com/rust-lang/rust/issues/10184 Currently, casting a floating point number to an integer with `as` is Undefined Behavior if the value is out of range. `-Z saturating-float-casts` fixes this soundness hole by making `as` “saturate” to the maximum or minimum value of the integer type (or zero for `NaN`), but has measurable negative performance impact in some benchmarks. There is some consensus in that thread for enabling saturation by default anyway, but provide an `unsafe fn` alternative for users who know through some other mean that their values are in range.
-
由 Simon Sapin 提交于
-
由 Markus Reiter 提交于
-
由 varkor 提交于
-
由 varkor 提交于
-
由 varkor 提交于
-
由 varkor 提交于
-
由 varkor 提交于
-
由 varkor 提交于
-