about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2023-04-21Adjust expected result for coverage testAmanieu d'Antras-3/+3
2023-04-16Rename -Zoom=panic to -Zoom=unwindAmanieu d'Antras-1/+1
2023-04-16Remove #[alloc_error_handler] from the compiler and libraryAmanieu d'Antras-385/+4
2023-04-15Remove obsolete test.Camille GILLOT-47/+0
2023-04-15Bless run-make.Camille GILLOT-1/+7
2023-04-15Bless codegen test.Camille GILLOT-3/+0
2023-04-15Only enable ConstProp at mir-opt-level >= 2.Camille GILLOT-48/+0
2023-04-15Auto merge of #109802 - notriddle:notriddle/rustdoc-search-generics-nested, ↵bors-2/+174
r=GuillaumeGomez rustdoc-search: add support for nested generics This change allows `search.js` to parse nested generics (which look `Like<This<Example>>`) and match them. It maintains the existing "bag semantics", so that the order of type parameters is ignored but the number is required to be greater than or equal to what's in the query. For example, a function with the signature `fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error>` will match these queries: * `Read -> Result<Vec<u8>, Error>` * `Read -> Result<Error, Vec>` * `Read -> Result<Vec<u8>>` But it *does not* match `Result<Vec, u8>` or `Result<u8<Vec>>`.
2023-04-14rustdoc-search: add support for nested genericsMichael Howell-2/+174
2023-04-14Auto merge of #110197 - cjgillot:codegen-discr, r=pnkfelixbors-17/+21
Do not attempt to commute comparison and cast to codegen discriminants The general algorithm to compute a discriminant is: ``` relative_tag = tag - niche_start is_niche = relative_tag <= (ule) relative_max discr = if is_niche { cast(relative_tag) + niche_variants.start() } else { untagged_variant } ``` We have an optimization branch which attempts to merge the addition and the subtraction by commuting them with the cast. We currently get this optimization wrong. This PR takes the easiest and safest way: remove the optimization, and let LLVM handle it. (Perf may not agree with that course of action :sweat_smile:) There may be a less invasive solution, but I don't have the necessary knowledge of LLVM semantics to find it. Cranelift has the same optimization, which should be handled similarly. cc `@nikic` and `@bjorn3` if you have a better solution. Fixes https://github.com/rust-lang/rust/issues/110128
2023-04-14Rollup merge of #110244 - kadiwa4:unnecessary_imports, r=JohnTitorMatthias Krüger-1/+1
Remove some unneeded imports / qualified paths Continuation of #105537.
2023-04-14Rollup merge of #108687 - ↵Matthias Krüger-21/+27
compiler-errors:reformulate-point_at_expr_source_of_inferred_type, r=oli-obk Reformulate `point_at_expr_source_of_inferred_type` to be more accurate Be more accurate when deducing where along the several usages of a binding it is constrained to be some type that is incompatible with an expectation. This also renames the method to `note_source_of_type_mismatch_constraint` because I prefer that name, though I guess I can revert that. (Also drive-by rename `note_result_coercion` -> `suggest_coercing_result_via_try_operator`, because it's suggesting, not noting!) This PR is (probably?) best reviewed per commit, but it does regress a bit only to fix it later on, so it could also be reviewed as a whole if that makes the final results more clear. r? `@estebank`
2023-04-14Update codegen test.Camille GILLOT-2/+5
2023-04-14Fortify tests againts mir-opts.Camille GILLOT-15/+16
2023-04-14Rollup merge of #110315 - oli-obk:mor_smir, r=WaffleLapkinYuki Okushi-0/+2
Add a stable MIR way to get the main function This is useful for analysis tools that only analyze the code paths that a specific program actually goes through. Or for code generators built on top of stable MIR.
2023-04-14Rollup merge of #103682 - Swatinem:stable-run-directory, r=GuillaumeGomezYuki Okushi-2/+2
Stabilize rustdoc `--test-run-directory` This should resolve https://github.com/rust-lang/rust/issues/84674
2023-04-14Add a stable MIR way to get the main functionOli Scherer-0/+2
2023-04-14Rollup merge of #110279 - GuillaumeGomez:compiler-macro-derive, r=notriddleMatthias Krüger-4/+23
rustdoc: Correctly handle built-in compiler proc-macros as proc-macro and not macro Part of https://github.com/rust-lang/rust/issues/110111. There were actually one issue split in two parts: * Compiler built-in proc-macro were incorrectly considered as macros and not proc-macros. * Re-exports of compiler built-in proc-macros were considering them as macros. Both issues can be fixed by looking at the `MacroKind` variant instead of just relying on information extracted later on. r? ``@fmease``
2023-04-14Rollup merge of #110276 - nnethercote:rm-BrAnon-Span, r=jackh726Matthias Krüger-4/+4
Remove all but one of the spans in `BoundRegionKind::BrAnon` There are only three places where `BoundRegionKind::BrAnon` uses `Some(span)` instead of `None`. Two of them are easy to remove, which this PR does. r? ```@jackh726```
2023-04-14Rollup merge of #110207 - compiler-errors:new-solver-unpin, r=lcnrMatthias Krüger-4/+28
Assemble `Unpin` candidates specially for generators in new solver Fixes compiler-errors/next-solver-hir-issues#16 r? ``@lcnr``
2023-04-14Rollup merge of #110180 - lcnr:canonicalize, r=compiler-errorsMatthias Krüger-327/+12
don't uniquify regions when canonicalizing uniquifying causes a bunch of issues, most notably it causes `AliasEq(<?x as Trait<'a>>::Assoc, <?x as Trait<'a>>::Assoc)` to result in ambiguity because both `normalizes-to` paths result in ambiguity and substs equate should trivially succeed but doesn't because we uniquified `'a` to two different regions. I originally added uniquification to make it easier to deal with requirement 6 from the dev-guide: https://rustc-dev-guide.rust-lang.org/solve/trait-solving.html#requirements > ### 6. Trait solving must be (free) lifetime agnostic > > Trait solving during codegen should have the same result as during typeck. As we erase > all free regions during codegen we must not rely on them during typeck. A noteworthy example > is special behavior for `'static`. cc https://github.com/rust-lang/rustc-dev-guide/pull/1671 Relying on regions being identical may cause ICE during MIR typeck, but even without this PR we can end up relying on that as type inference vars can resolve to types which contain an identical region. Let's land this and deal with any ICE that crop up as we go. Will look at this issue again before stabilization. r? ```@compiler-errors```
2023-04-14Rollup merge of #109800 - bryangarza:safe-transmute-improved-errors, ↵Matthias Krüger-537/+358
r=compiler-errors Improve safe transmute error reporting This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-04-14Auto merge of #109875 - jyn514:no-fulldeps, r=compiler-errorsbors-11/+13
Move most ui-fulldeps tests to ui/ Same rationale as https://github.com/rust-lang/rust/pull/109770, they don't actually need a stage 2 build. This increases the limit for the UI directory because otherwise it was annoying to be constantly moving files into subdirectories when I fixed a test; https://github.com/rust-lang/rust/pull/109873 makes up for it. cc https://github.com/rust-lang/rust/pull/109770, https://github.com/rust-lang/rust/pull/109874
2023-04-14Add test for uniquifying regionsMichael Goulet-0/+12
2023-04-14Assemble Unpin candidates specially for generators in new solverMichael Goulet-4/+28
2023-04-13Fix tests on wasmJoshua Nelson-4/+6
The `std` test straightforwardly can't work without file descriptors; #99417 tracks moving it out of tests/ui. `issue-13560.rs` requires the target to support dynamic linking. `extern-mod-syntax` is interesting. The original test was added to check if `extern mod` could be parsed correctly and used `extern mod std` and an import: https://github.com/rust-lang/rust/commit/138dc3048af36f0a20f857542c357fe8df563013#diff-73700e1e851b7a37bc92174635dab726124c82e5bfabbbc45b4a3c2e8e14fadd At some point `std::json::Object` was moved out of std to an unstable rustc-only `extras` crate, and rather than just changing the import it got changed to use the unstable crate. When `extras` was removed, people assumed the test was meant to also test rustc_private and changed it to another unstable crate rather than using something in std. This changes the test to remove the `rustc_private` import, to allow it to work properly when cross-compiling.
2023-04-13Move most ui-fulldeps tests to uijyn-0/+0
They pass fine. Only tests that required `extern crate rustc_*` or were marked `ignore-stage1` have been keep in fulldeps.
2023-04-14Remove another use of `BrAnon(Some(_))`.Nicholas Nethercote-2/+2
2023-04-14Remove one use of `BrAnon(Some(_))`.Nicholas Nethercote-2/+2
2023-04-13Improve safe transmute error reportingBryan Garza-537/+358
This patch updates the error reporting when Safe Transmute is not possible between 2 types by including the reason. Also, fix some small bugs that occur when computing the `Answer` for transmutability.
2023-04-13Rollup merge of #110283 - saethlin:check-panics-before-alignment, r=bjorn3Matthias Krüger-0/+17
Only emit alignment checks if we have a panic_impl Fixes https://github.com/rust-lang/rust/issues/109996 r? `@bjorn3` because you commented that this situation could impact you as well
2023-04-13Rollup merge of #110277 - Ezrashaw:combine-assoc-fns-dlint, r=lcnrMatthias Krüger-58/+115
dead-code-lint: de-dup multiple unused assoc functions Fixes #109600 Prior art: #97853
2023-04-13Rollup merge of #110259 - ndrewxie:issue-109964-fix-gitstuff, r=cjgillotMatthias Krüger-6/+54
Added diagnostic for pin! macro in addition to Box::pin if Unpin isn't implemented I made a PR earlier, but accidentally renamed a branch and that deleted the PR... sorry for the duplicate Currently, if an operation on `Pin<T>` is performed that requires `T` to implement `Unpin`, the diagnostic suggestion is to use `Box::pin` ("note: consider using `Box::pin`"). This PR suggests pin! as well, as that's another valid way of pinning a value, and avoids a heap allocation. Appropriate diagnostic suggestions were included to highlight the difference in semantics (local pinning for pin! vs non-local for Box::pin). Fixes #109964
2023-04-13Rollup merge of #110233 - nbdd0121:intrinsic, r=tmiaskoMatthias Krüger-10/+50
Make rust-intrinsic ABI unwindable Fix #104451, fix https://github.com/rust-lang/miri/issues/2839 r? `@RalfJung`
2023-04-13Rollup merge of #110193 - compiler-errors:body-owner-issue, r=WaffleLapkinMatthias Krüger-0/+44
Check for body owner fallibly in error reporting Sometimes the "body id" we use for an obligation cause is not actually a body owner, like when we're doing WF checking on items. Fixes #110157
2023-04-13Rollup merge of #109036 - chenyukang:yukang/fix-testcase, r=jyn514Matthias Krüger-2/+2
Fix diff option conflict in UI test Trivial fix for test case `tests/run-make/rustdoc-verify-output-files`, it's failing on MacOS, the `-u` option specifies the unified context format, while the `-q` option specifies only brief output. These two options are incompatible, since the unified context format produces a more detailed output than the brief output format.
2023-04-13Add test to ensure that compiler built-in proc-macro are considered as suchGuillaume Gomez-4/+23
2023-04-13Only emit alignment checks if we have a panic_implBen Kimock-0/+17
2023-04-14bless the single testEzra Shaw-0/+2
2023-04-13Auto merge of #109989 - ids1024:m68k-asm, r=Amanieubors-0/+83
Add inline assembly support for m68k I believe this should be correct, to the extent I understand the logic around inline assembly. M68k is fairly straightforward here, other than having separate address registers.
2023-04-13impl reviewer feedbackEzra Shaw-6/+22
- remove unused (pun intentional) `continue` - improve wording with assoc items in general
2023-04-13Add regression testGary Guo-0/+39
2023-04-13dead-code-lint: de-dup multiple unused assoc fnsEzra Shaw-55/+40
2023-04-13Rollup merge of #110195 - compiler-errors:issue-110052, r=aliemjayMatthias Krüger-1/+27
Erase lifetimes above `ty::INNERMOST` when probing ambiguous types Turns out that `TyCtxt::replace_escaping_bound_vars_uncached` only erases bound vars exactly at `ty::INNERMOST`, and not everything above. This regresses the suggestions for non-lifetime binders, but oh well, I don't really care about those. Fixes #110052
2023-04-13refactor: emit "unused assoc fn" in lexical orderEzra Shaw-26/+80
with repect to other dead code lints
2023-04-13Auto merge of #109786 - estebank:tweak-add-line-sugg, r=compiler-errorsbors-284/+390
Tweak output for 'add line' suggestion Closes #108174
2023-04-13Auto merge of #109466 - davidlattimore:inline-arg-via-var-debug-info, ↵bors-0/+45
r=wesleywiser Preserve argument indexes when inlining MIR We store argument indexes on VarDebugInfo. Unlike the previous method of relying on the variable index to know whether a variable is an argument, this survives MIR inlining. We also no longer check if var.source_info.scope is the outermost scope. When a function gets inlined, the arguments to the inner function will no longer be in the outermost scope. What we care about though is whether they were in the outermost scope prior to inlining, which we know by whether we assigned an argument index. Fixes #83217 I considered using `Option<NonZeroU16>` instead of `Option<u16>` to store the index. I didn't because `TypeFoldable` isn't implemented for `NonZeroU16` and because it looks like due to padding, it currently wouldn't make any difference. But I indexed from 1 anyway because (a) it'll make it easier if later it becomes worthwhile to use a `NonZeroU16` and because the arguments were previously indexed from 1, so it made for a smaller change. This is my first PR on rust-lang/rust, so apologies if I've gotten anything not quite right.
2023-04-12Add inline assembly support for m68kIan Douglas Scott-0/+83
2023-04-12More accurate argument blames, add some commentsMichael Goulet-3/+11
2023-04-12Properly note source of arg mismatchMichael Goulet-1/+10