- 11 4月, 2022 1 次提交
-
-
由 bors 提交于
Avoid accessing HIR from MIR passes `hir_owner_nodes` contains a lot of information, and the query result is typically dirty. This forces dependent queries to be re-executed needlessly. This PR refactors some accesses to HIR to go through more targeted queries that yield the same result. Based on https://github.com/rust-lang/rust/pull/95435 and https://github.com/rust-lang/rust/pull/95436
-
- 10 4月, 2022 19 次提交
-
-
由 bors 提交于
update Miri Fixes https://github.com/rust-lang/rust/issues/95844 r? `@ghost`
-
由 bors 提交于
Make it possible to run `cargo test` for bootstrap Note that this only runs bootstrap's self-tests, not compiler or library tests. Helps with https://github.com/rust-lang/rust/issues/94829.
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
This allows to avoid looking at HIR from borrowck.
-
由 Camille GILLOT 提交于
-
由 bors 提交于
Remove ptr-int transmute in std::sync::mpsc Since https://github.com/rust-lang/rust/pull/95340 landed, Miri with `-Zmiri-check-number-validity` produces an error on the test suites of some crates which implement concurrency tools<sup>*</sup>, because it seems like such crates tend to use `std::sync::mpsc` in their tests. This fixes the problem by storing pointer bytes in a pointer. <sup>*</sup> I have so far seen errors in the test suites of `once_cell`, `parking_lot`, and `crossbeam-utils`. (just updating the list for fun, idk) Also `threadpool`, `async-lock`, `futures-timer`, `fragile`, `scoped_threadpool`, `procfs`, `slog-async`, `scheduled-thread-pool`, `tokio-threadpool`, `mac`, `futures-cpupool`, `ntest`, `actix`, `zbus`, `jsonrpc-client-transports`, `fail`, `libp2p-gossipsub`, `parity-send-wrapper`, `async-broadcast,` `libp2p-relay`, `http-client`, `mockito`, `simple-mutex`, `surf`, `pollster`, and `pulse`. Then I turned the bot off.
-
由 bors 提交于
Fix `x doc compiler/rustc` This also has a few cleanups to `doc.rs`. The last two commits I don't care about, but the first commit I'd like to keep - it will be very useful for https://github.com/rust-lang/rust/issues/44293. Fixes https://github.com/rust-lang/rust/issues/95447.
-
由 bors 提交于
Fix `cargo run` on Windows Fixes the following error: ``` error: failed to run custom build command for `bootstrap v0.0.0 (C:\Users\Walther\git\rust\src\bootstrap)` Caused by: process didn't exit successfully: `C:\Users\Walther\git\rust\target\debug\build\bootstrap-7757a4777dec0f86\build-script-build` (exit code: 101) --- stdout cargo:rerun-if-changed=build.rs cargo:rerun-if-env-changed=RUSTC cargo:rustc-env=BUILD_TRIPLE=x86_64-pc-windows-msvc cargo:rerun-if-env-changed=PATH --- stderr thread 'main' panicked at 'assertion failed: rustc.is_absolute()', src\bootstrap\build.rs:22:5 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace warning: build failed, waiting for other jobs to finish... error: build failed ``` The problem was that the `dir.join` check only works with `rustc.exe`, not `rustc`. Thanks `@Walther` for the help testing the fix! Helps with https://github.com/rust-lang/rust/issues/94829.
-
由 bors 提交于
Make def names and HIR names consistent. The name in the `DefKey` is interned to create the `DefId`, so it does not require any query to access. This can be leveraged to avoid a few useless HIR accesses for names. ~In order to achieve that, generic parameters created from universal impl-trait are given the pretty-printed ast as a name, instead of `{{opaque}}`.~ ~Drive-by: the `TyCtxt::opt_item_name` used a dummy span for non-local definitions. We have access to `def_ident_span`, so we use it.~
-
由 bors 提交于
Rollup of 7 pull requests Successful merges: - #94794 (Clarify indexing into Strings) - #95361 (Make non-power-of-two alignments a validity error in `Layout`) - #95369 (Fix `x test src/librustdoc` with `download-rustc` enabled ) - #95805 (Left overs of #95761) - #95808 (expand: Remove `ParseSess::missing_fragment_specifiers`) - #95817 (hide another #[allow] directive from a docs example) - #95831 (Use bitwise XOR in to_ascii_uppercase) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Joshua Nelson 提交于
Note that this only runs bootstrap's self-tests, not compiler or library tests.
-
由 Dylan DPC 提交于
Use bitwise XOR in to_ascii_uppercase This saves an instruction compared to the previous approach, which was to unset the fifth bit with bitwise OR. Comparison of generated assembly on x86: https://godbolt.org/z/GdfvdGs39 This can also affect autovectorization, saving SIMD instructions as well: https://godbolt.org/z/cnPcz75T9 Not sure if `u8::to_ascii_lowercase` should also be changed, since using bitwise OR for that function does not require an extra bitwise negate since the code is setting a bit rather than unsetting a bit. `char::to_ascii_uppercase` already uses XOR, so no change seems to be required there.
-
由 Dylan DPC 提交于
expand: Remove `ParseSess::missing_fragment_specifiers` It was used for deduplicating some errors for legacy code which are mostly deduplicated even without that, but at cost of global mutable state, which is not a good tradeoff. cc https://github.com/rust-lang/rust/pull/95747#issuecomment-1091619403 r? ``@nnethercote``
-
由 Dylan DPC 提交于
Left overs of #95761 These are just nits. Feel free to close this PR if all modifications are not worth merging. * `#![feature(decl_macro)]` is not needed anymore in `rustc_expand` * `tuple_impls` does not require `$Tuple:ident`. I guess it is there to enhance readability? r? ```@petrochenkov```
-
由 Dylan DPC 提交于
Fix `x test src/librustdoc` with `download-rustc` enabled The problem was two-fold: - Bootstrap was hard-coding that unit tests should always run with stage1, not stage2, and - It hard-coded the sysroot layout in stage1, which puts libLLVM.so in `lib/rustlib/` instead of just `lib/`. This also takes the liberty of fixing `test src/librustdoc --no-doc`, which has been broken since it was first added. It would be nice at some point to unify this logic with other tests; I opened a Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Inconsistency.20in.20.60x.20test.60 Fixes https://github.com/rust-lang/rust/issues/91071.
-
由 Dylan DPC 提交于
Make non-power-of-two alignments a validity error in `Layout` Inspired by the zulip conversation about how `Layout` should better enforce `size <= isize::MAX as usize`, this uses an N-variant enum on N-bit platforms to require at the validity level that the existing invariant of "must be a power of two" is upheld. This was MIRI can catch it, and means there's a more-specific type for `Layout` to store than just `NonZeroUsize`. It's left as `pub(crate)` here; a future PR could consider giving it a tracking issue for non-internal usage.
-
由 Dylan DPC 提交于
Clarify indexing into Strings **This Commit** Adds some clarity around indexing into Strings. **Why?** I was reading through the `Range` documentation and saw an implementation for `SliceIndex<str>`. I was surprised to see this and went to read the [`String`][0] documentation and, to me, it seemed to say (at least) three things: 1. you cannot index into a `String` 2. indexing into a `String` could not be constant-time 3. indexing into a `String` does not have an obvious return type I absolutely agree with the last point but the first two seemed contradictory to the documentation around [`SliceIndex<str>`][1] which mention: 1. you can do substring slicing (which is probably different than "indexing" but, because the method is called `index` and I associate anything with square brackets with "indexing" it was enough to confuse me) 2. substring slicing is constant-time (this may be algorithmic ignorance on my part but if `&s[i..i+1]` is O(1) then it seems confusing that `&s[i]` _could not possibly_ be O(1)) So I was hoping to clarify a couple things and, hopefully, in this PR review learn a little more about the nuances here that confused me in the first place. [0]: https://doc.rust-lang.org/stable/std/string/struct.String.html#utf-8 [1]: https://doc.rust-lang.org/stable/std/slice/trait.SliceIndex.html#impl-SliceIndex%3Cstr%3E
-
- 09 4月, 2022 20 次提交
-
-
由 Ralf Jung 提交于
-
由 Mark Lodato 提交于
**This Commit** Adds some clarity around indexing into Strings and the constraints driving various decisions there. **Why?** The [`String` documentation][0] mentions how `String`s can't be indexed but `Range` has an implementation for `SliceIndex<str>`. This can be confusing. There are also several statements to explain the lack of `String` indexing: - the inability to index into a `String` is an implication of UTF-8 encoding - indexing into a `String` could not be constant-time with UTF-8 encoding - indexing into a `String` does not have an obvious return type This last statement made sense but the first two seemed contradictory to the documentation around [`SliceIndex<str>`][1] which mention: - one can index into a `String` with a `Range` (also called substring slicing but it uses the same syntax and the method name is `index`) - `Range` indexing into a `String` is constant-time To resolve this seeming contradiction the documentation is reworked to more clearly explain what factors drive the decision to disallow indexing into a `String` with a single number. [0]: https://doc.rust-lang.org/stable/std/string/struct.String.html#utf-8 [1]: https://doc.rust-lang.org/stable/std/slice/trait.SliceIndex.html#impl-SliceIndex%3Cstr%3E
-
由 bors 提交于
refactor: simplify few string related interactions Few small optimizations: check_doc_keyword: don't alloc string for emptiness check check_doc_alias_value: get argument as Symbol to prevent needless string convertions check_doc_attrs: don't alloc vec, iterate over slice. replace as_str() check with symbol check get_single_str_from_tts: don't prealloc string trivial string to str replace LifetimeScopeForPath::NonElided use Vec<Symbol> instead of Vec<String> AssertModuleSource use FxHashSet<Symbol> instead of BTreeSet<String> CrateInfo.crate_name replace FxHashMap<CrateNum, String> with FxHashMap<CrateNum, Symbol>
-
由 Vadim Petrochenkov 提交于
It was used for deduplicating some errors for legacy code which are mostly deduplicated even without that, but at cost of global mutable state, which is not a good tradeoff.
-
由 bors 提交于
Rollup of 6 pull requests Successful merges: - #95308 (Reduce the amount of unstable features used in libproc_macro) - #95676 (Update RLS) - #95769 (Hide cross-crate `#[doc(hidden)]` associated items in trait impls) - #95785 (interpret: err instead of ICE on size mismatches in to_bits_or_ptr_internal) - #95802 (fix unused constant warning on some Windows targets) - #95810 (Use `format-args-capture` and remove unnecessary nested blocks) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Dylan DPC 提交于
Rollup merge of #95810 - TaKO8Ki:use-format-args-capture-and-remove-unnecessary-nesting-in-rustc-borrowck, r=davidtwco Use `format-args-capture` and remove unnecessary nested blocks
-
由 Dylan DPC 提交于
fix unused constant warning on some Windows targets When none of those `cfg_if!` apply (and on Miri), the constant remains unused.
-
由 Dylan DPC 提交于
interpret: err instead of ICE on size mismatches in to_bits_or_ptr_internal We did this a while ago already for `to_i32()` and friends, but missed this one. That became quite annoying when I was debugging an ICE caused by `read_pointer` in a Miri shim where the code was passing an argument at the wrong type. Having `scalar_to_ptr` be fallible is consistent with all the other `Scalar::to_*` methods being fallible. I added `unwrap` only in code outside the interpreter, which is no worse off than before now in terms of panics. r? ````@oli-obk````
-
由 Dylan DPC 提交于
Hide cross-crate `#[doc(hidden)]` associated items in trait impls Fixes #95717. r? ```@GuillaumeGomez``` This is the bug I ran into in #95316. ```@rustbot``` label T-rustdoc A-cross-crate-reexports
-
由 Dylan DPC 提交于
Update RLS This PR updates RLS to include the following PRs: * https://github.com/rust-lang/rls/pull/1766 * https://github.com/rust-lang/rls/pull/1767 * https://github.com/rust-lang/rls/pull/1771 * https://github.com/rust-lang/rls/pull/1772 It also updates racer to fix RLS compilation with the parallel compiler enabled.
-
由 Dylan DPC 提交于
Reduce the amount of unstable features used in libproc_macro This makes it easier to adapt the source for stable when copying it into rust-analyzer to load rustc compiled proc macros.
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 bors 提交于
CI: update `rustc-perf` version used in CI and also the corresponding PGO benchmarks The old version was from May 2021. The `rustc-perf` benchmarks have seen a significant overhaul recently, so let's see if the new benchmarks can improve PGO performance.
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #90066 (Add new ThinBox type for 1 stack pointer wide heap allocated trait objects) - #95374 (assert_uninit_valid: ensure we detect at least arrays of uninhabited types) - #95599 (Strict provenance lints) - #95751 (Don't report numeric inference ambiguity when we have previous errors) - #95764 ([macro_metavar_expr] Add tests to ensure the feature requirement) - #95787 (reword panic vs result section to remove recoverable vs unrecoverable framing) - #95797 (Remove explicit delimiter token trees from `Delimited`.) - #95804 (rustdoc: Fix empty doc comment with backline ICE) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Dylan DPC 提交于
rustdoc: Fix empty doc comment with backline ICE Fixes #95800. r? ```@notriddle```
-
由 Dylan DPC 提交于
Remove explicit delimiter token trees from `Delimited`. They were introduced by the final commit in #95159 and gave a performance win. But since the introduction of `MatcherLoc` they are no longer needed. This commit reverts that change, making the code a bit simpler. r? `@petrochenkov`
-
由 Dylan DPC 提交于
reword panic vs result section to remove recoverable vs unrecoverable framing Based on feedback from the Error Handling FAQ: https://github.com/rust-lang/project-error-handling/issues/50#issuecomment-1090876982 r? ````@dtolnay````
-
由 Dylan DPC 提交于
[macro_metavar_expr] Add tests to ensure the feature requirement These tests should have been added in the initial implementation they were unintentionally forgotten cc #83527 r? ````@petrochenkov````
-
由 Dylan DPC 提交于
Don't report numeric inference ambiguity when we have previous errors Fixes #95648
-