- 17 8月, 2023 38 次提交
-
-
由 bors 提交于
avoid transmuting Box when we can just cast raw pointers instead Always better to avoid a transmute, in particular when the layout assumptions it is making are not clearly documented. :)
-
由 bors 提交于
Rollup of 5 pull requests Successful merges: - #112751 (rustdoc: Fixes with --test-run-directory and relative paths.) - #114749 (Update `mpsc::Sender` doc to reflect that it implements `Sync`) - #114876 (Don't ICE in `is_trivially_sized` when encountering late-bound self ty) - #114881 (clarify CStr lack of layout guarnatees) - #114921 (Remove Folyd from librustdoc static files) r? `@ghost` `@rustbot` modify labels: rollup
-
由 Matthias Krüger 提交于
Remove Folyd from librustdoc static files r?`@GuillaumeGomez`
-
由 Matthias Krüger 提交于
clarify CStr lack of layout guarnatees Follow-up to https://github.com/rust-lang/rust/pull/114800 r? `@cuviper`
-
由 Matthias Krüger 提交于
Don't ICE in `is_trivially_sized` when encountering late-bound self ty We can see a bound ty var here: https://github.com/rust-lang/rust/blob/b531630f4255216fce1400c45976e04f1ab35a84/compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs#L13-L34 Fixes #114872
-
由 Matthias Krüger 提交于
Update `mpsc::Sender` doc to reflect that it implements `Sync` Fixes #114722
-
由 Matthias Krüger 提交于
rustdoc: Fixes with --test-run-directory and relative paths. Fixes #112191 Fixes #112210 This fixes some issues with `--test-run-directory` and its interaction with `--runtool` and `--persist-doctests`. Relative directories don't work with `Command::current_dir` very well because it has platform-specific behavior with relative paths. This fixes it by avoiding the use of relative paths. This is needed because cargo is switching to use `--test-run-directory`, and it uses relative paths when interacting with rustdoc/rustc.
-
由 bors 提交于
coverage: Anonymize line numbers in `run-coverage` test snapshots LLVM's coverage reporter always prints line numbers in its coverage reports. For testing purposes this is slightly inconvenient, because it means that adding or removing a line in a test file causes all subsequent lines in the snapshot to change. That makes it harder to see the actually meaningful changes in the re-blessed snapshot. --- This change fixes that by adding another normalization pass that replaces all line numbers in the coverage reports with `LL`, which is similar to what UI tests tell the compiler to do when emitting line numbers in error messages.
-
由 Folyd 提交于
-
由 bors 提交于
Remove conditional use of `Sharded` from query caches `Sharded` is already a zero cost abstraction, so it shouldn't affect the performance of the single thread compiler if LLVM does its job. r? `@cjgillot`
-
由 Zalathar 提交于
This makes the test snapshots less sensitive to lines being added/removed.
-
由 bors 提交于
Only run MaybeInitializedPlaces dataflow once to elaborate drops This pass allows forward dataflow analyses to modify the CFG depending on the dataflow state. This possibility is used for the `MaybeInitializedPlace` analysis in drop elaboration, to skip the dataflow effect of dead unwinds without having to compute dataflow twice.
-
由 bors 提交于
Optimize DroplessArena arena allocation This optimizes `DroplessArena` allocation by always ensuring that it is aligned to `usize` and adding `grow_and_alloc` and `grow_and_alloc_raw`functions which both grow and allocate, reducing code size. <table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.6968s</td><td align="right">1.6887s</td><td align="right"> -0.48%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2552s</td><td align="right">0.2551s</td><td align="right"> -0.03%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9613s</td><td align="right">0.9553s</td><td align="right"> -0.62%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.5402s</td><td align="right">1.5374s</td><td align="right"> -0.18%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">5.9175s</td><td align="right">5.8813s</td><td align="right"> -0.61%</td></tr><tr><td>Total</td><td align="right">10.3710s</td><td align="right">10.3178s</td><td align="right"> -0.51%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9962s</td><td align="right"> -0.38%</td></tr></table>
-
由 bors 提交于
Rollup of 5 pull requests Successful merges: - #113115 (we are migrating to askama) - #114784 (Improve `invalid_reference_casting` lint) - #114822 (Improve code readability by moving fmt args directly into the string) - #114878 (rustc book: make more pleasant to search) - #114899 (Add missing Clone/Debug impls to SMIR Trait related tys) r? `@ghost` `@rustbot` modify labels: rollup
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Camille GILLOT 提交于
-
由 Matthias Krüger 提交于
Add missing Clone/Debug impls to SMIR Trait related tys r? `@compiler-errors`
-
由 Matthias Krüger 提交于
rustc book: make more pleasant to search
-
由 Matthias Krüger 提交于
Improve code readability by moving fmt args directly into the string There are some of occurrences where I also transformed `write!(f, "{}", x)` into `f.write_str(x.as_str())`. r? `@notriddle`
-
由 Matthias Krüger 提交于
Improve `invalid_reference_casting` lint This PR improves the `invalid_reference_casting` lint: - by considering an unlimited number of casts instead only const to mut ptr - by also considering ptr-to-integer and integer-to-ptr casts - by also taking into account [`ptr::cast`](https://doc.rust-lang.org/std/primitive.pointer.html#method.cast), [`ptr::cast`](https://doc.rust-lang.org/std/primitive.pointer.html#method.cast-1) and [`ptr::cast_const`](https://doc.rust-lang.org/std/primitive.pointer.html#method.cast_const) Most of this improvements comes from skimming Github Code Search result for [`&mut \*.*as \*const`](https://github.com/search?q=lang%3Arust+%2F%26mut+%5C*.*as+%5C*const%2F&type=code) r? ``@est31`` (maybe)
-
由 Matthias Krüger 提交于
we are migrating to askama see https://github.com/rust-lang/rust/issues/108868
-
由 bors 提交于
proc_macro: Update docs for `Spacing` Brings the docs more in line with reality
-
由 Santiago Pastorino 提交于
-
- 16 8月, 2023 2 次提交
-
-
由 bors 提交于
Fix argument removal suggestion around macros Fixes #112437. Fixes #113866. Helps with #114255. The issue was that `span.find_ancestor_inside(outer)` could previously return a span with a different expansion context from `outer`. This happens for example for the built-in macro `panic!`, which expands to another macro call of `panic_2021!` or `panic_2015!`. Because the call site of `panic_20xx!` has not associated source code, its span currently points to the call site of `panic!` instead. Something similar also happens items that get desugared in AST->HIR lowering. For example, `for` loops get two spans: One "inner" span that has the `.desugaring_kind()` kind set to `DesugaringKind::ForLoop` and one "outer" span that does not. Similar to the macro situation, both of these spans point to the same source code, but have different expansion contexts. This causes problems, because joining two spans with different expansion contexts will usually[^1] not actually join them together to avoid creating "spaghetti" spans that go from the macro definition to the macro call. For example, in the following snippet `full_span` might not actually contain the `adjusted_start` and `adjusted_end`. This caused the broken suggestion / debug ICE in the linked issues. ```rust let adjusted_start = start.find_ancestor_inside(shared_ancestor); let adjusted_end = end.find_ancestor_inside(shared_ancestor); let full_span = adjusted_start.to(adjusted_end) ``` To fix the issue, this PR introduces a new method, `find_ancestor_inside_same_ctxt`, which combines the functionality of `find_ancestor_inside` and `find_ancestor_in_same_ctxt`: It finds an ancestor span that is contained within the parent *and* has the same syntax context, and is therefore safe to extend. This new method should probably be used everywhere, where the returned span is extended, but for now it is just used for the argument removal suggestion. Additionally, this PR fixes a second issue where the function call itself is inside a macro but the arguments come from outside the macro. The test is added in the first commit to include stderr diff, so this is best reviewed commit by commit. [^1]: If one expansion context is the root context and the other is not.
-
由 Guillaume Gomez 提交于
-