- 24 8月, 2020 1 次提交
-
-
由 Eric Huss 提交于
-
- 23 8月, 2020 23 次提交
-
-
由 bors 提交于
stabilize ptr_offset_from This stabilizes ptr::offset_from, and closes https://github.com/rust-lang/rust/issues/41079. It also removes the deprecated `wrapping_offset_from`. This function was deprecated 19 days ago and was never stable; given an FCP of 10 days and some waiting time until FCP starts, that leaves at least a month between deprecation and removal which I think is fine for a nightly-only API. Regarding the open questions in https://github.com/rust-lang/rust/issues/41079: * Should offset_from abort instead of panic on ZSTs? -- As far as I know, there is no precedent for such aborts. We could, however, declare this UB. Given that the size is always known statically and the check thus rather cheap, UB seems excessive. * Should there be more methods like this with different restrictions (to allow nuw/nsw, perhaps) or that return usize (like how isize-taking offset is more conveniently done with usize-taking add these days)? -- No reason to block stabilization on that, we can always add such methods later. Also nominating the lang team because this exposes an intrinsic. The stabilized method is best described [by its doc-comment](https://github.com/RalfJung/rust/blob/56d4b2d69abb93e4f0ca79471deca7aaaaeca214/src/libcore/ptr/const_ptr.rs#L227). The documentation forgot to mention the requirement that both pointers must "have the same provenance", aka "be derived from pointers to the same allocation", which I am adding in this PR. This is a precondition that [Miri already implements](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a3b9d0a07a01321f5202cd99e9613480) and that, should LLVM ever obtain a `psub` operation to subtract pointers, will likely be required for that operation (following the semantics in [this paper](https://people.mpi-sws.org/~jung/twinsem/twinsem.pdf)).
-
由 Ralf Jung 提交于
Co-authored-by: NJosh Stone <cuviper@gmail.com>
-
由 Ralf Jung 提交于
-
由 bors 提交于
Use intra-doc-links in `core::{raw, ffi, pin}` Helps with #75080. r? @jyn514
-
由 bors 提交于
compiletest: fix a couple clippy lint findings
-
由 bors 提交于
Use smaller def span for functions Currently, the def span of a function encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); } ``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
-
由 bors 提交于
Lazy decoding of DefPathTable from crate metadata (non-incremental case) The is the half of https://github.com/rust-lang/rust/pull/74967 that doesn't touch incremental-related structures. We are still decoding def path hashes eagerly if we are in incremental mode. The incremental part of https://github.com/rust-lang/rust/pull/74967 feels hacky, but I'm not qualified enough to suggest improvements. I'll reassign it so someone else once this PR lands. @Aaron1011, I wasn't asking you to do this split because I wasn't sure that it's feasible (or simple to do). r? @Aaron1011
-
由 bors 提交于
Upgrade to LLVM 11 (rc2) This builds on #73525 to try actually moving rust-lang/llvm-project to LLVM 11.
-
由 bors 提交于
Re-land PR #72388: Recursively expand `TokenKind::Interpolated` in `probably_equal_for_proc_macro` PR #72388 allowed us to preserve the original `TokenStream` in more cases during proc-macro expansion, but had to be reverted due to a large number of regressions (See #72545 and #72622). These regressions fell into two categories 1. Missing handling for `Group`s with `Delimiter::None`, which are inserted during `macro_rules!` expansion (but are lost during stringification and re-parsing). A large number of these regressions were due to `syn` and `proc-macro-hack`, but several crates needed changes to their own proc-macro code. 2. Legitimate hygiene issues that were previously being masked by stringification. Some of these were relatively benign (e.g. [a compiliation error](https://github.com/paritytech/parity-scale-codec/pull/210) caused by misusing `quote_spanned!`). However, two crates had intentionally written unhygenic `macro_rules!` macros, which were able to access identifiers that were not passed as arguments (see https://github.com/rust-lang/rust/issues/72622#issuecomment-636402573). All but one of the Crater regressions have now been fixed upstream (see https://hackmd.io/ItrXWRaSSquVwoJATPx3PQ?both). The remaining crate (which has a PR pending at https://github.com/sammhicks/face-generator/pull/1) is not on `crates.io`, and is a Yew application that seems unlikely to have any reverse dependencies. As @petrochenkov mentioned in https://github.com/rust-lang/rust/issues/72545#issuecomment-638632434, not re-landing PR #72388 allows more crates to write unhygenic `macro_rules!` macros, which will eventually stop compiling. Since there is only one Crater regression remaining, since additional crates could write unhygenic `macro_rules!` macros in the time it takes that PR to be merged.
-
由 Aaron Hill 提交于
Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
-
由 Aaron Hill 提交于
See issue #74616
-
由 Aaron Hill 提交于
Fixes #68430 This is a re-attempt of PR #72388, which was previously reverted due to a large number of breakages. All of the known breakages should now be patched upstream.
-
由 Josh Stone 提交于
-
由 Josh Stone 提交于
LLVM 11 started using `phi` and `select` for `fn pair_i32_bool`, which is still valid, but harder to match than the simple instructions we were getting before. We'll just check that the unpacked args are directly referenced in any way, and call it good.
-
由 Josh Stone 提交于
Flatten the INC definition to one line. Co-authored-by: Nlzutao <taolzu@gmail.com>
-
由 Josh Stone 提交于
-
由 Josh Stone 提交于
-
由 Josh Stone 提交于
This was breaking `#include_next <limits.h>`, such that we weren't getting definitions of `PATH_MAX` and `_POSIX_ARG_MAX`.
-
由 LeSeulArtichaut 提交于
-
由 bors 提交于
New zeroed slice Add to #63291 the methods ```rust impl<T> Box<[T]> { pub fn new_zeroed_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} } impl<T> Rc<[T]> { pub fn new_zeroed_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} } impl<T> Arc<[T]> { pub fn new_zeroed_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} } ``` as suggested in https://github.com/rust-lang/rust/issues/63291#issuecomment-605511675 . Also optimize `{Rc, Arc}::new_zeroed` to use `alloc_zeroed`, otherwise they are no more efficient than using `new_uninit` and zeroing the memory manually (which was the original implementation).
-
由 Vadim Petrochenkov 提交于
-
由 Vadim Petrochenkov 提交于
-
由 Aaron Hill 提交于
-
- 22 8月, 2020 16 次提交
-
-
由 bors 提交于
Gate if-let guard feature Enhanced on #74315. That PR is in crater queue so I don't want to push to it. Close #74232 cc #51114
-
由 bors 提交于
Move to intra-doc links for library/core/src/alloc/{layout, global, mod}.rs Helps with #75080. The files already contained intra-doc links, so there are only minor changes. @rustbot modify labels: T-doc, A-intra-doc-links, T-rustdoc Known issues: * [`handle_alloc_error`]: Link from `core` to `alloc` could not be resolved. * [`slice`]: slice is a primitive type, but could not be resolved; had to use [`crate::slice`] instead.
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 Ralf Jung 提交于
-
由 bors 提交于
cargotest: fix clippy warnings Fixes clippy::redundant_static_lifetimes and clippy::toplevel_ref_arg I also replaced some .expect("") calls with .unwrap()s since there was no message passed by the .expect() anyway.
-
由 Denis Vasilik 提交于
-
由 Matthias Krüger 提交于
-
由 bors 提交于
Use intra-doc-links in `std::sync::*` Helps with #75080. r? @jyn514
-
由 bors 提交于
Missing doc examples lint improvements Fixes #75719. To be merged after #75718 (only the two last commits are from this PR). Since you already reviewed #75718, I'll set you as reviewer here as well. :) r? @jyn514
-
由 bors 提交于
Remove unused `Maybe` wrapper around raw standard streams * Remove result type from raw standard streams constructors * Make raw standard stream constructors const * Remove wrapper type handling absent raw standard streams cargo checked with: ```shell env CC=true ./x.py check library/std/ \ --target i686-unknown-linux-gnu \ --target wasm32-unknown-emscripten \ --target wasm32-wasi \ --target x86_64-fortanix-unknown-sgx \ --target x86_64-pc-windows-gnu \ --target x86_64-unknown-cloudabi \ --target x86_64-unknown-hermit \ --target x86_64-unknown-linux-gnu \ --target x86_64-uwp-windows-gnu \ --target x86_64-wrs-vxworks ``` Note: Last target doesn't compile currently.
-
由 bors 提交于
bootstrap: fix a couple of clippy lint warnings clippy::print_literal clippy::clone_on_copy clippy::single_char_pattern clippy::into_iter_on_ref clippy::match_like_matches_macro
-
由 bors 提交于
Rollup of 12 pull requests Successful merges: - #75705 (Move to intra-doc links for /library/core/src/intrinsics.rs) - #75711 (Split `astconv.rs` into its own submodule) - #75718 (Don't count variants/fields/consts/associated types in doc-coverage doc examples) - #75725 (Use intra-doc-links in `alloc`) - #75745 (Remove duplication in `fold_item`) - #75753 (Another motivation for CFG: return-oriented programming) - #75769 (Minor, remove double nesting of a test module) - #75771 (Extend normalization in const-eval-query-stack test) - #75781 (More inline asm register name fixups for LLVM) - #75782 (Convert core/src/str/pattern.rs to Intra-doc links) - #75787 (Use intra-doc-links in `core::ops::*`) - #75788 (MIR call terminator represents diverging calls too) Failed merges: - #75773 (Introduce expect snapshot testing library into rustc) r? @ghost
-
由 Dylan DPC 提交于
MIR call terminator represents diverging calls too @bors rollup=always
-