- 22 3月, 2021 21 次提交
-
-
由 Dylan DPC 提交于
Cleanup LLVM debuginfo module docs - Move debuginfo docs from `doc.rs` module to `doc.md` file - Cleanup LLVM debuginfo module docs
-
由 Dylan DPC 提交于
slice: Stabilize IterMut::as_slice. Much like #72584. As per #58957 there's no blocker for this, and I wanted to use this today :-) Closes #58957
-
由 Dylan DPC 提交于
Move `std::sys::unix::platform` to `std::sys::unix::ext` This moves the operating system dependent alias `platform` (`std::os::{linux, android, ...}`) from `std::sys::unix` to `std::sys::unix::ext` (a.k.a. `std::os::unix`), removing the need for compatibility code in `unix_ext` when documenting on another platform. This is also a step in making it possible to properly move `std::sys::unix::ext` to `std::os::unix`, as ideally `std::sys` should not depend on the rest of `std`.
-
由 Dylan DPC 提交于
Fix invalid slice access in String::retain As noted in #78499, the previous fix was technically still unsound because it accessed elements of a slice outside its bounds (even though they were still inside the same allocation). This PR addresses that concern by switching to a dropguard approach.
-
由 Dylan DPC 提交于
Implement TrustedLen and TrustedRandomAccess for Range<integer>, array::IntoIter, VecDequeue's iterators This should make some `FromIterator` and `.zip()` specializations applicable in a few more cases. ``@rustbot`` label libs-impl
-
由 Dylan DPC 提交于
Make NonNull::as_ref (and friends) return refs with unbound lifetimes # Rationale: 1. The documentation for all of these functions claims that this is what the functions already do, as they all come with this comment: > You must enforce Rust's aliasing rules, *since the returned lifetime 'a is arbitrarily chosen* and does not necessarily reflect the actual lifetime of the data... So I think it's just a bug that they weren't this way already. Note that had it not been for this part, I wouldn't be making this PR, so if we decide we won't take this change, I'll follow it up with a docs PR to fix this. 2. This is how the equivalent raw pointer functions behave. They also take `self` and not `&self`/`&mut self`, but that can't be changed compatibly at this point. This is the next best thing. 3. Without this fix, often code that uses these methods will find it has to expand the lifetime of the result. (I can't speak for others but even in unsafe-heavy code, needing to do this unexpectedly is a huge red flag -- if Rust thinks something should have a specific lifetime, I assume it's for a reason) ### Can this cause existing code to be unsound? I'm confident this can't cause new unsoundness since the reference exists for at most its lifetime, but you get a borrow checker error if you do something that would require/allow the reference to exist past its lifetime. Additionally, the aliasing rules of a reference only applies while the reference exists. This *must* be the case, as it is required by the rules used by safe code. (That said, the documentation in this file sort of contradicts it, but I think it's just ambiguity between the lifetime `'a` in `&'a T` and lifetime of the `&'a T` reference itself...) We are increasing the lifetime of these references, but they should already have hard bounds on that lifetime, or they'd have borrow checker errors. (CC ``@RalfJung`` because I have gone and done the mistake where I say something definitive about aliasing in Rust which is honestly outside the group of things I should make definitive comments about). # Caveats 1. This is insta-stable (except for on the unstable functions ofc). I don't think there's any other alternative. 2. I don't believe this is a breaking change in practice. In theory someone could be assigning `NonNull::as_ref` to a function pointer of type `fn(&NonNull<T>) -> &T`. Now they'd need to use a slightly different function pointer type which is (probably) incompatible. This seems pathological, but I guess crater could be used if there are concerns. 3. This has no tests. The old version didn't either that I saw. I could add some stuff that fails to compile without it, if that would be useful. 4. Sometimes the NLL borrow checker gives up and decides lifetimes live till the end of the scope, as opposed to the range where they're used. If this change can cause this to happen more, then my soundness rationale is wrong, and it's likely breaking. In practice this seems super unlikely. Anyway. That was a lot of typing. Fixes https://github.com/rust-lang/rust/issues/80183
-
由 Dylan DPC 提交于
stabilize `feature(osstring_ascii)` This PR stabilizes `feature(osstring_ascii)`. Fixes #70516.
-
由 Mara Bos 提交于
-
由 bors 提交于
Enable mutable noalias for LLVM >= 12 Enable mutable noalias by default on LLVM 12, as previously known miscompiles have been resolved. Now it's time to find the next one ;) * The `-Z mutable-noalias` option no longer has an explicit default and accepts `-Z mutable-noalias=yes` and `-Z mutable-noalias=no` to override the LLVM version based default behavior. * The decision on whether to apply the noalias attribute is moved into rustc_codegen_llvm. rustc_middle only provides us with the necessary information to make the decision. * `noalias` is not emitted for types that are `!Unpin`, as a heuristic for self-referential structures (see #54878 and #63818).
-
由 Nikita Popov 提交于
In particular this pulls in an update to the auto-deref recursion_limit example, to no longer rely on the Freeze query.
-
由 Nikita Popov 提交于
This saves us both the Freeze/Unpin queries, and avoids placing noalias attributes, which have a compile-time impact on LLVM even in optnone builds (due to always_inline functions).
-
由 The8472 提交于
-
由 The8472 提交于
-
由 The8472 提交于
-
由 The8472 提交于
-
由 Nikita Popov 提交于
We don't have any known noalias bugs for LLVM 12 ... yet.
-
由 Nikita Popov 提交于
Such structures may contain self-references, in which case the same location may be accessible through a pointer that is not based-on the noalias pointer. This is still grey area as far as language semantics are concerned, but checking for !Unpin as an indicator for self-referential sturctures seems like a good approach for the meantime.
-
由 Nikita Popov 提交于
The default value will dependend on the LLVM version in the future, so don't specify one to start with.
-
由 Nikita Popov 提交于
The frontend shouldn't be deciding whether or not to use mutable noalias attributes, as this is a pure LLVM concern. Only provide the necessary information and do the actual decision in codegen_llvm.
-
由 Mara Bos 提交于
-
由 bors 提交于
Fix const stability `since` versions. fixes #82085 r? `@m-ou-se`
-
- 21 3月, 2021 17 次提交
-
-
由 bors 提交于
Perform 'deep recollection' in test helper macros Currently, the print helper macro performs 'recollection' by doing `token_stream.into_iter().collect()`. However, this will not affect nonterminals that occur nested inside delimited groups, since the wrapping delimited group will be left untouched. This commit adds 'deep recollection', which recursively recollects every delimited group in the token stream. As with normal recollection, we only print out something if deep recollection results in a different stringified token stream. This is useful for catching bugs where we update the AST of a nonterminal (which affects pretty-printing), but do not update the attatched `TokenStream`
-
由 Aaron Hill 提交于
Currently, the print helper macro performs 'recollection' by doing `token_stream.into_iter().collect()`. However, this will not affect nonterminals that occur nested inside delimited groups, since the wrapping delimited group will be left untouched. This commit adds 'deep recollection', which recursively recollects every delimited group in the token stream. As with normal recollection, we only print out something if deep recollection results in a different stringified token stream. This is useful for catching bugs where we update the AST of a nonterminal (which affects pretty-printing), but do not update the attatched `TokenStream`
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #82707 (const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable`) - #83040 (extract `ConstKind::Unevaluated` into a struct) - #83280 (Fix pluralization in keyword docs) - #83289 (Move some tests to more reasonable directories - 5) - #83306 (Extend `proc_macro_back_compat` lint to `js-sys`) - #83327 (Extend comment in `UsedLocals::visit_lhs`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Dylan DPC 提交于
Extend comment in `UsedLocals::visit_lhs`
-
由 Dylan DPC 提交于
Extend `proc_macro_back_compat` lint to `js-sys` With this PR, we now lint for all cases where we perform some kind of proc-macro back-compat hack. The `js-sys` had an internal fix made to properly handle `None`-delimited groups, so we need to manually check the version in the filename. As a result, we no longer apply the back-compat hack to cases where the version number is missing file the file path. This should not affect any users of the `crates.io` crate.
-
由 Dylan DPC 提交于
Move some tests to more reasonable directories - 5 cc #73494 Threshold is 0.95. Next time I promise I will take a look into the special/misclassified directories. - [issues/issue-23208.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-23208.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/23208)</sup>: associated-types 0.951 - [weird-exprs.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/weird-exprs.rs) <sup>unknown</sup>: destructuring-assignment 0.958 - [issues/issue-1701.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-1701.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/1701)</sup>: structs-enums 0.974 - [issues/issue-48508-aux.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-48508-aux.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/48508)</sup>: numbers-arithmetic 0.991 - [fn_must_use.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/fn_must_use.rs) <sup>unknown</sup>: lint 1.000 - [mir_check_nonconst.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/mir_check_nonconst.rs) <sup>unknown</sup>: consts 1.002 - [issues/issue-52060.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-52060.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/52060)</sup>: consts 1.017 - [issues/issue-45729-unsafe-in-generator.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-45729-unsafe-in-generator.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/45729)</sup>: generator 1.024 - [issues/issue-10392.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-10392.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/10392)</sup>: pattern 1.039 - [no-implicit-prelude.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/no-implicit-prelude.rs) <sup>unknown</sup>: resolve 1.071 - [issues/issue-68000-unicode-ident-after-missing-comma.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-68000-unicode-ident-after-missing-comma.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/68000)</sup>: parser 1.079 - [shadow.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/shadow.rs) <sup>unknown</sup>: binding 1.099 - [issues/issue-65611.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-65611.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/65611)</sup>: consts 1.139 - [concat-rpass.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/concat-rpass.rs) <sup>unknown</sup>: macros 1.194 - [issues/issue-31597.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-31597.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/31597)</sup>: associated-types 1.195 - [issues/issue-78372.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-78372.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/78372)</sup>: resolve 1.426 - [impl-trait-in-bindings-issue-73003.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-trait-in-bindings-issue-73003.rs) <sup>[issue](https://github.com/rust-lang/rust/issues/73003)</sup>: impl-trait 1.471 - [impl-trait-in-bindings.rs](https://github.com/rust-lang/rust/blob/master/src/test/ui/impl-trait-in-bindings.rs) <sup>unknown</sup>: impl-trait 2.500 r? `@petrochenkov`
-
由 Dylan DPC 提交于
Fix pluralization in keyword docs
-
由 Dylan DPC 提交于
extract `ConstKind::Unevaluated` into a struct r? `@oli-obk`
-
由 Dylan DPC 提交于
const_evaluatable_checked: Stop eagerly erroring in `is_const_evaluatable` Fixes #82279 We don't want to be emitting errors inside of is_const_evaluatable because we may call this during selection where it should be able to fail silently There were two errors being emitted in `is_const_evaluatable`. The one causing the compile error in #82279 was inside the match arm for `FailureKind::MentionsParam` but I moved the other error being emitted too since it made things cleaner imo The `NotConstEvaluatable` enum \*should\* have a fourth variant for when we fail to evaluate a concrete const, e.g. `0 - 1` but that cant happen until #81339 cc `@oli-obk` `@lcnr` r? `@nikomatsakis`
-
由 bors 提交于
Bump to 1.53.0 r? `@Mark-Simulacrum`
-
由 Camelid 提交于
* Use Markdown list syntax and unindent a bit to prevent Markdown interpreting the nested lists as code blocks * A few more small typographical cleanups
-
由 Camelid 提交于
And use `#[doc = include_str!("doc.md")]` in `mod.rs` so the docs are rendered as if they were inline in the root module.
-
由 lcnr 提交于
-
由 lcnr 提交于
-
由 lcnr 提交于
-
由 bors 提交于
Debug-print result when an unstable fingerprint is detected Helps with issues like #83311 I had previously tried to do this in https://github.com/rust-lang/rust/pull/80692, but it had a significant performance impact (even though the code was never actually run). Hopefully, this will be better now that https://github.com/rust-lang/rust/pull/79100 has been merged.
-
由 Mark Rousskov 提交于
-
- 20 3月, 2021 2 次提交
-
-
由 Caio 提交于
-
由 bors 提交于
Add simd_neg platform intrinsic Stdarch needs to add simd_neg to support the implementation of vneg neon instructions. Look [here](https://github.com/rust-lang/stdarch/pull/1087)
-