about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-11-15Mark test as panic=abort.Camille GILLOT-24/+10
2022-11-15Flatten aggregates into locals.Camille GILLOT-41/+693
2022-11-15Auto merge of #104054 - RalfJung:byte-provenance, r=oli-obkbors-28/+0
interpret: support for per-byte provenance Also factors the provenance map into its own module. The third commit does the same for the init mask. I can move it in a separate PR if you prefer. Fixes https://github.com/rust-lang/miri/issues/2181 r? `@oli-obk`
2022-11-15Auto merge of #104437 - matthiaskrgr:rollup-n5jdg9v, r=matthiaskrgrbors-0/+428
Rollup of 9 pull requests Successful merges: - #103439 (Show note where the macro failed to match) - #103734 (Adjust stabilization version to 1.65.0 for wasi fds) - #104148 (Visit attributes of trait impl items during AST validation) - #104241 (Move most of unwind's build script to lib.rs) - #104258 (Deduce closure signature from a type alias `impl Trait`'s supertraits) - #104296 (Walk types more carefully in `ProhibitOpaqueTypes` visitor) - #104309 (Slightly improve error message for invalid identifier) - #104316 (Simplify suggestions for errors in generators.) - #104339 (Add `rustc_deny_explicit_impl`) Failed merges: - #103484 (Add `rust` to `let_underscore_lock` example) r? `@ghost` `@rustbot` modify labels: rollup
2022-11-15nll: correctly deal with bivariancelcnr-0/+26
2022-11-15Rollup merge of #104309 - chenyukang:yukang/fix-104088-identifier-error, ↵Matthias Krüger-0/+55
r=davidtwco Slightly improve error message for invalid identifier fixes #104088
2022-11-15Rollup merge of #104296 - compiler-errors:opaque-ty-ffi-normalization-cycle, ↵Matthias Krüger-0/+56
r=lcnr Walk types more carefully in `ProhibitOpaqueTypes` visitor The visitor didn't account for the case where you could have `<TAIT as Trait>::Assoc` normalize to itself, in the case of a `type TAIT = impl Trait` with an unconstrained associated type. That causes the visitor to loop on the same type over and over. Fixes #104291
2022-11-15Rollup merge of #104258 - compiler-errors:tait-closure-deduce, r=oli-obkMatthias Krüger-0/+15
Deduce closure signature from a type alias `impl Trait`'s supertraits r? `@oli-obk` Basically pass the TAIT's bounds through the same method that we're using to deduce a signature from infer var closure bounds. Does this need a new FCP? I see it as a logical extension of #101834, but happy to rfcbot a new one if it does.
2022-11-15Rollup merge of #104148 - fmease:fix-104140, r=petrochenkovMatthias Krüger-0/+23
Visit attributes of trait impl items during AST validation Fixes #104140. This fix might not be backward compatible (in practice) since we now validate more attributes than before. Should I write more tests? `@rustbot` label A-attributes
2022-11-15Rollup merge of #103439 - Nilstrieb:help-me-with-my-macro, r=estebankMatthias Krüger-0/+279
Show note where the macro failed to match When feeding the wrong tokens, it used to fail with a very generic error that wasn't very helpful. This change tries to help by noting where specifically the matching went wrong. ```rust macro_rules! uwu { (a a a b) => {}; } uwu! { a a a c } ``` ```diff error: no rules expected the token `c` --> macros.rs:5:14 | 1 | macro_rules! uwu { | ---------------- when calling this macro ... 4 | uwu! { a a a c } | ^ no rules expected this token in macro call | +note: while trying to match `b` + --> macros.rs:2:12 + | +2 | (a a a b) => {}; + | ^ ```
2022-11-15Auto merge of #101168 - jachris:dataflow-const-prop, r=oli-obkbors-19/+926
Add new MIR constant propagation based on dataflow analysis The current constant propagation in `rustc_mir_transform/src/const_prop.rs` fails to handle many cases that would be expected from a constant propagation optimization. For example: ```rust let x = if true { 0 } else { 0 }; ``` This pull request adds a new constant propagation MIR optimization pass based on the existing dataflow analysis framework. Since most of the analysis is not unique to constant propagation, a generic framework has been extracted. It works on top of the existing framework and could be reused for other optimzations. Closes #80038. Closes #81605. ## Todo ### Essential - [x] [Writes to inactive enum variants](https://github.com/rust-lang/rust/pull/101168#pullrequestreview-1089493974). Resolved by rejecting the registration of places with downcast projections for now. Could be improved by flooding other variants if mutable access to a variant is observed. - [X] Handle [`StatementKind::CopyNonOverlapping`](https://github.com/rust-lang/rust/pull/101168#discussion_r957774914). Resolved by flooding the destination. - [x] Handle `UnsafeCell` / `!Freeze` correctly. - [X] Overflow propagation of `CheckedBinaryOp`: Decided to not propagate if overflow flag is `true` (`false` will still be propagated) - [x] More documentation in general. - [x] Arguments for correctness, documentation of necessary assumptions. - [x] Better performance, or alternatively, require `-Zmir-opt-level=3` for now. ### Extra - [x] Add explicit unreachability, i.e. upgrading the lattice from $\mathbb{P} \to \mathbb{V}$ to $\set{\bot} \cup (\mathbb{P} \to \mathbb{V})$. - [x] Use storage statements to improve precision. - [ ] Consider opening issue for duplicate diagnostics: https://github.com/rust-lang/rust/pull/101168#issuecomment-1276609950 - [ ] Flood moved-from places with $\bot$ (requires some changes for places with tracked projections). - [ ] Add downcast projections back in. - [ ] [Algebraic simplifications](https://github.com/rust-lang/rust/pull/101168#discussion_r957967878) (possibly with a shared API; done by old const prop). - [ ] Propagation through slices / arrays. - [ ] Find other optimizations that are done by old `const_prop.rs`, but not by this one.
2022-11-15`VecDeque::resize` should re-use the buffer in the passed-in elementScott McMurray-0/+56
Today it always copies it for *every* appended element, but one of those clones is avoidable.
2022-11-15return when expr has errorsTakayuki Maeda-0/+38
add ui tests
2022-11-15Auto merge of #104428 - matthiaskrgr:rollup-jo3078i, r=matthiaskrgrbors-0/+109
Rollup of 13 pull requests Successful merges: - #103842 (Adding Fuchsia compiler testing script, docs) - #104354 (Remove leading newlines from `NonZero*` doc examples) - #104372 (Update compiler-builtins) - #104380 (rustdoc: remove unused CSS `code { opacity: 1 }`) - #104381 (Remove dead NoneError diagnostic handling) - #104383 (Remove unused symbols and diagnostic items) - #104391 (Deriving cleanups) - #104403 (Specify language of code comment to generate document) - #104404 (Fix missing minification for static files) - #104413 ([llvm-wrapper] adapt for LLVM API change) - #104415 (rustdoc: fix corner case in search keyboard commands) - #104422 (Fix suggest associated call syntax) - #104426 (Add test for #102154) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-15shift no characters when using raw string literalsTakayuki Maeda-0/+29
remove `find_skips` remove unnecessary variables
2022-11-15Normalize types before looking for opaquesMichael Goulet-0/+56
2022-11-15Use `needs-unwind` instead of ignoring WASM/emscriptenBryan Garza-5/+3
2022-11-15move testcase for tidyyukang-0/+0
2022-11-15fix #104088, Slightly improve error message for invalid identifieryukang-0/+55
2022-11-15move testcase for tidyyukang-0/+0
2022-11-15fix #103381, Detect incorrect chaining of if and if let conditionsyukang-0/+168
2022-11-15Rollup merge of #104426 - aDotInTheVoid:test-102154, r=compiler-errorsMatthias Krüger-0/+13
Add test for #102154 Closes #102154
2022-11-15Rollup merge of #104422 - ↵Matthias Krüger-0/+68
compiler-errors:fix-suggest_associated_call_syntax, r=BoxyUwU Fix suggest associated call syntax Fixes #104412
2022-11-14Add test for #102154Nixon Enraght-Moony-0/+13
2022-11-14rustdoc: remove no-op CSS `.main-header { justify-content }`Michael Howell-0/+17
This rule was added in 152e8889052adaaa6c12652486292be34059713c to push the out-of-band content to the right while allowing it to line wrap when it got too big. The idea was that the justification rule would fill the space between the `<h1>` element and the `<div class="out-of-band">` element. A later commit, 3cb03cb34247383ffb67a017ae70134741e8c4da, flattened the in-band element into the `<h1>`, copying the `flex-grow` rule. This means the `<h1>` element now grows to fill the space, so there's no need to justify-content any more. This commit also adds a test case for this.
2022-11-14respect visibility & stability of inherent associated typesLeón Orell Valerian Liehr-1/+76
2022-11-14rustdoc: add test case for font size in help popoverMichael Howell-0/+2
2022-11-14rustdoc: fix corner case in search keyboard commandsMichael Howell-0/+28
2022-11-14Update src/test/ui/proc-macro/expand-expr.rsclubby789-2/+2
Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
2022-11-14Add regression testMichael Goulet-0/+19
2022-11-14Do autoderef to match impl against rcvrMichael Goulet-0/+49
2022-11-14Show a note where a macro failed to matchNilstrieb-0/+279
This shows a small note on what the macro matcher was currently processing to aid with "no rules expected the token X" errors.
2022-11-14Rollup merge of #104378 - compiler-errors:chalk-up, r=jackh726Matthias Krüger-110/+17
Bump chalk to v0.87 1. Removes `ReEmpty` from chalk 2. Adds support for the `std::marker::Tuple` trait
2022-11-14Rollup merge of #104364 - petrochenkov:docice2, r=GuillaumeGomezMatthias Krüger-0/+14
rustdoc: Resolve doc links in external traits having local impls For external impls it was done in https://github.com/rust-lang/rust/pull/103192 right away, but the local impl case was forgotten. Fixes https://github.com/rust-lang/rust/issues/104145.
2022-11-14Rollup merge of #104294 - compiler-errors:inline-ct-err-in-mir-build, ↵Matthias Krüger-0/+21
r=davidtwco Don't ICE with inline const errors during MIR build Fixes #104277
2022-11-14Rollup merge of #104229 - compiler-errors:overlap-full-path, r=davidtwcoMatthias Krüger-75/+75
Don't print full paths in overlap errors We don't print the full path in other diagnostics -- I don't think it particularly helps with the error message. I also delayed the printing until actually needing to render the error message. r? diagnostics
2022-11-14Rollup merge of #104223 - fmease:recover-fn-ptr-with-generics, r=estebankMatthias Krüger-0/+142
Recover from function pointer types with generic parameter list Give a more helpful error when encountering function pointer types with a generic parameter list like `fn<'a>(&'a str) -> bool` or `fn<T>(T) -> T` and suggest moving lifetime parameters to a `for<>` parameter list. I've added a bunch of extra code to properly handle (unlikely?) corner cases like `for<'a> fn<'b>()` (where there already exists a `for<>` parameter list) correctly suggesting `for<'a, 'b> fn()` (merging the lists). If you deem this useless, I can simplify the code by suggesting nothing at all in this case. I am quite open to suggestions regarding the wording of the diagnostic messages. Fixes #103487. ``@rustbot`` label A-diagnostics r? diagnostics
2022-11-14Fix test/ui/issues/issue-30490.rsAyush Singh-1/+1
Since the empty main is used for `not(unix)`, all the targets that will use this empty main will also need `allow(unused_imports)`. Originally part of https://github.com/rust-lang/rust/pull/100316 Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2022-11-14Fix using `include_bytes` in pattern positionclubby789-1/+7
2022-11-14Bless graphviz testsJannis Christopher Köhl-5/+5
2022-11-13Rollup merge of #104266 - compiler-errors:issue-102430, r=Mark-SimulacrumManish Goregaokar-0/+32
Regression test for coercion of mut-ref to dyn-star Closes #102430
2022-11-13Rollup merge of #104181 - jackh726:known-bug-tests, r=Mark-SimulacrumManish Goregaokar-0/+373
Add a few known-bug tests The labels of these tests should be changed from `S-bug-has-mcve` to `S-bug-has-test` once this is merged. cc: #101518 #99492 #90950 #89196 #104034 #101350 #103705 #103899 I couldn't reproduce the failures in #101962 and #100772 (so either these have started passing, or I didn't repro properly), so leaving those out for now. #102065 was a bit more complicated, since it uses `rustc_private` and I didn't want to mess with that.
2022-11-13Rollup merge of #104105 - davidtwco:split-dwarf-lto, r=michaelwoeristerManish Goregaokar-14/+197
llvm: dwo only emitted when object code emitted Fixes #103932. `CompiledModule` should not think a DWARF object was emitted when a bitcode-only compilation has happened, this can confuse archive file creation (which expects to create an archive containing non-existent dwo files). r? ``````@michaelwoerister``````
2022-11-13Add a few known-bug testsJack Huey-0/+373
2022-11-13Extend GUI test for theme settingsGuillaume Gomez-6/+41
2022-11-13Update GUI testGuillaume Gomez-39/+2
2022-11-13Make rustc build with new chalkMichael Goulet-110/+17
2022-11-13copy doc output files by format r=ozkanonurozkanonur-0/+37
Signed-off-by: ozkanonur <work@onurozkan.dev>
2022-11-13Auto merge of #104370 - matthiaskrgr:rollup-c3b38sm, r=matthiaskrgrbors-0/+12
Rollup of 5 pull requests Successful merges: - #103996 (Add small clarification around using pointers derived from references) - #104315 (Improve spans with `use crate::{self}`) - #104320 (Use `derive_const` and rm manual StructuralEq impl) - #104357 (add is_sized method on Abi and Layout, and use it) - #104365 (Add x tool to triagebot) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-13Rollup merge of #104315 - SparkyPotato:fix-104276, r=cjgillotMatthias Krüger-0/+12
Improve spans with `use crate::{self}` Fixes #104276. The error becomes: ``` error: crate root imports need to be explicitly named: `use crate as name;` --> src/lib.rs.rs:1:13 | 1 | use crate::{self}; | ^^^^ warning: unused import: `self` --> src/lib.rs:1:13 | 1 | use crate::{self}; | ^^^^ | = note: `#[warn(unused_imports)]` on by default ```