- 06 9月, 2021 5 次提交
-
-
由 bors 提交于
Avoid invoking the hir_crate query to traverse the HIR Walking the HIR tree is done using the `hir_crate` query. However, this is unnecessary, since `hir_owner(CRATE_DEF_ID)` provides the same information. Since depending on `hir_crate` forces dependents to always be executed, this leads to unnecessary work. By splitting HIR and attributes visits, we can avoid an edge to `hir_crate` when trying to visit the HIR tree.
-
由 bors 提交于
Stop allocating vtable entries for non-object-safe methods Current a vtable entry is allocated for all associated fns, even if the method is not object-safe: https://godbolt.org/z/h7vx6f35T As a result, each vtable for `Iterator`' currently consumes 74 `usize`s. This PR stops allocating vtable entries for those methods, reducing vtable size of each `Iterator` vtable to 7 `usize`s. Note that this PR introduces will cause more invocations of `is_vtable_safe_method`. So a perf run might be needed. If result isn't favorable then we might need to query-ify `is_vtable_safe_method`.
-
由 Gary Guo 提交于
-
由 Gary Guo 提交于
-
由 bors 提交于
Provide `layout_of` automatically (given tcx + param_env + error handling). After #88337, there's no longer any uses of `LayoutOf` within `rustc_target` itself, so I realized I could move the trait to `rustc_middle::ty::layout` and redesign it a bit. This is similar to #88338 (and supersedes it), but at no ergonomic loss, since there's no funky `C: LayoutOf<Ty = Ty>` -> `Ty: TyAbiInterface<C>` generic `impl` chain, and each `LayoutOf` still corresponds to one `impl` (of `LayoutOfHelpers`) for the specific context. After this PR, this is what's needed to get `trait LayoutOf` (with the `layout_of` method) implemented on some context type: * `TyCtxt`, via `HasTyCtxt` * `ParamEnv`, via `HasParamEnv` * a way to transform `LayoutError`s into the desired error type * an error type of `!` can be paired with having `cx.layout_of(...)` return `TyAndLayout` *without* `Result<...>` around it, such as used by codegen * this is done through a new `LayoutOfHelpers` trait (and so is specifying the type of `cx.layout_of(...)`) When going through this path (and not bypassing it with a manual `impl` of `LayoutOf`), the end result is that only the error case can be customized, the query itself and the success paths are guaranteed to be uniform. (**EDIT**: just noticed that because of the supertrait relationship, you cannot actually implement `LayoutOf` yourself, the blanket `impl` fully covers all possible context types that could ever implement it) Part of the motivation for this shape of API is that I've been working on querifying `FnAbi::of_*`, and what I want/need to introduce for that looks a lot like the setup in this PR - in particular, it's harder to express the `FnAbi` methods in `rustc_target`, since they're much more tied to `rustc` concepts. r? `@nagisa` cc `@oli-obk` `@bjorn3`
-
- 05 9月, 2021 13 次提交
-
-
由 bors 提交于
rustdoc: Clean up handling of lifetime bounds Previously, rustdoc recorded lifetime bounds by rendering them into the name of the lifetime parameter. Now, it leaves the name as the actual name and instead records lifetime bounds in an `outlives` list, similar to how type parameter bounds are recorded. Also, higher-ranked lifetimes cannot currently have bounds, so I simplified the code to reflect that. r? `@GuillaumeGomez`
-
由 bors 提交于
Rollup of 4 pull requests Successful merges: - #88257 (Provide more context on incorrect inner attribute) - #88432 (Fix a typo in raw_vec) - #88511 (x.py clippy: don't run with --all-targets by default) - #88657 (Fix 2021 `dyn` suggestion that used code as label) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Mara Bos 提交于
Fix 2021 `dyn` suggestion that used code as label The arguments to `span_suggestion` were in the wrong order, so the error looked like this: error[E0783]: trait objects without an explicit `dyn` are deprecated --> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5 | 10 | Foo::hi(123); | ^^^ help: <dyn Foo>: `use `dyn`` Now the error looks like this, as expected: error[E0783]: trait objects without an explicit `dyn` are deprecated --> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5 | 10 | Foo::hi(123); | ^^^ help: use `dyn`: `<dyn Foo>` This issue was only present in the 2021 error; the 2018 lint was correct. r? `@m-ou-se`
-
由 Mara Bos 提交于
x.py clippy: don't run with --all-targets by default this caused a lot of noise because benchmarks and tests were also checked before: `./x.py clippy |& wc -l` `74026` with change: `./x.py clippy |& wc -l` `43269` Zulip thread: https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/x.2Epy.20check.20default.20targets r? `@jyn514` or `@Mark-Simulacrum`
-
由 Mara Bos 提交于
Fix a typo in raw_vec
-
由 Mara Bos 提交于
Provide more context on incorrect inner attribute Suggest changing an inner attribute into an outer attribute if followed by an item.
-
由 bors 提交于
Update LLVM submodule This merges upstream `release/13.x` changes to our fork. In particular, this fixes #85580.
-
由 bors 提交于
Move add_rlib and add_native_library to cg_ssa This deduplicates logic between codegen backends. cc `@antoyo` and `@khyperia` for cg_gcc and rust-gpu.
-
由 bors 提交于
Add links in docs for some primitive types This pull request adds additional links in existing documentation of some of the primitive types. Where items are linked only once, I have used the `[link](destination)` format. For items in `std`, I have linked directly to the HTML, since although the primitives are in `core`, they are not displayed on `core` documentation. I was unsure of what length I should keep lines of documentation to, so I tried to keep them within reason. Additionally, I have avoided excessively linking to keywords like `self` when they are not relevant to the documentation. I can add these links if it would be an improvement. I hope this can improve Rust. Please let me know if there's anything I did wrong!
-
由 Noah Lev 提交于
The arguments to `span_suggestion` were in the wrong order, so the error looked like this: error[E0783]: trait objects without an explicit `dyn` are deprecated --> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5 | 10 | Foo::hi(123); | ^^^ help: <dyn Foo>: `use `dyn`` Now the error looks like this, as expected: error[E0783]: trait objects without an explicit `dyn` are deprecated --> src/test/ui/editions/dyn-trait-sugg-2021.rs:10:5 | 10 | Foo::hi(123); | ^^^ help: use `dyn`: `<dyn Foo>` This issue was only present in the 2021 error; the 2018 lint was correct.
-
由 bors 提交于
Simplify lifetimes_from_impl_trait_bounds Part of https://github.com/rust-lang/rust/pull/87234 r? `@petrochenkov`
-
由 bors 提交于
Make sure FileCheck is copied in the LLVM output directory The tool, which is needed by parts of our test suite, is built as part of LLVM but is *not* copied to the directory containing the output LLVM binaries. This adds a flag to ensure the binary is copied. This shouldn't add any extra built time, as the flag just installs extra binaries that were already compiled. This is not strictly needed for the test suite to work (as it also checks `build/$target/llvm/build/bin` for the binary), but it allows deleting the `build/$TARGET/llvm/build` directory (which also contains the intermediary build artifacts) without affecting the test suite, saving disk space.
-
由 bors 提交于
rustdoc: Box `GenericArg::Const` to reduce enum size This should reduce the amount of memory allocated in the common cases where the `GenericArg` is a lifetime or type.
-
- 04 9月, 2021 16 次提交
-
-
由 bors 提交于
Include debug info for the allocator shim Issue Details: In some cases it is necessary to generate an "allocator shim" to forward various Rust allocation functions (e.g., `__rust_alloc`) to an underlying function (e.g., `malloc`). However, since this allocator shim is a manually created LLVM module it is not processed via the normal module processing code and so no debug info is generated for it (if debugging info is enabled). Fix Details: * Modify the `debuginfo` code to allow creating debug info for a module without a `CodegenCx` (since it is difficult, and expensive, to create one just to emit some debug info). * After creating the allocator shim add in basic debug info.
-
由 bors 提交于
fix(rustc_lint): better detect when parens are necessary Fixes #88519
-
由 bors 提交于
CrateLocator refactorings This makes the `CrateLocator` a lot cleaner IMHO and much more self-contained. The last commit removes `extra_filename` from the crate metadata. This is an **insta-stable** change as it allows a crate like `libfoo-abc.rlib` to be used as dependency and then be renamed as `libfoo-bcd.rlib` while still being found as indirect dependency. This may reduce performance when there are a lot of versions of the same crate available as the extra filename won't be used to do an early rejection of crates before trying to load metadata, but it makes the logic to find the right filename a lot cleaner.
-
由 bors 提交于
Bump version to 1.57 r? `@Mark-Simulacrum`
-
由 Mark Rousskov 提交于
-
由 bors 提交于
Detect bare blocks with type ascription that were meant to be a `struct` literal Address part of #34255. Potential improvement: silence the other knock down errors in `issue-34255-1.rs`.
-
由 patrick-gu 提交于
-
由 patrick-gu 提交于
-
由 patrick-gu 提交于
-
由 bors 提交于
Add regression test for a spurious import This PR adds a test that verifies that the bug described in the linked issue does not creep back into the code. In essence it checks that compiling some specific code (that uses 128 bit multiplication) with a specific set of compiler options does not lead to a spurious import of a panic function. I noticed that other wasm tests use `# only-wasm32-bare` in their `Makefile`. This will skip the test for me. I did not find out how to run this test locally. Maybe someone can help. closes #78744 r? `@jyn514`
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Noah Lev 提交于
-
由 bors 提交于
Fix drop handling for `if let` expressions MIR lowering for `if let` expressions is now more complicated now that `if let` exists in HIR. This PR adds a scope for the variables bound in an `if let` expression and then uses an approach similar to how we handle loops to ensure that we reliably drop the correct variables. Closes #88307 cc `@flip1995` `@richkadel` `@c410-f3r`
-
由 Matthew Jasper 提交于
-
由 bors 提交于
sunos systems add sanitizer supported.
-
- 03 9月, 2021 6 次提交
-
-
由 bors 提交于
Move global analyses from lowering to resolution Split off https://github.com/rust-lang/rust/pull/87234 r? `@petrochenkov`
-
由 Esteban Kuber 提交于
Address part of #34255. Potential improvement: silence the other knock down errors in `issue-34255-1.rs`.
-
由 bors 提交于
Rollup of 7 pull requests Successful merges: - #88202 (Add an example for deriving PartialOrd on enums) - #88483 (Fix LLVM libunwind build for non-musl targets) - #88507 (Add test case for using `slice::fill` with MaybeUninit) - #88557 (small const generics cleanup) - #88579 (remove redundant / misplaced sentence from docs) - #88610 (Update outdated docs of array::IntoIter::new.) - #88613 (Update primitive docs for rust 2021.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Mara Bos 提交于
Update primitive docs for rust 2021. Fixes https://github.com/rust-lang/rust/issues/87701
-
由 Mara Bos 提交于
Update outdated docs of array::IntoIter::new.
-
由 Mara Bos 提交于
remove redundant / misplaced sentence from docs Removes sentence that seems to have drifted down into the examples section. Luckily, someone already added an explanation of what happens with packed structs back into the initial section of the doc entry and this wayward sentence can likely just be deleted.
-