about summary refs log tree commit diff
path: root/tests/ui/use
AgeCommit message (Collapse)AuthorLines
2025-07-25Mention type that could be `Clone` but isn't in more casesEsteban Küber-0/+8
When encountering a moved value of a type that isn't `Clone` because of unmet obligations, but where all the unmet predicates reference crate-local types, mention them and suggest cloning, as we do in other cases already: ``` error[E0507]: cannot move out of `foo`, a captured variable in an `Fn` closure --> f111.rs:14:25 | 13 | fn do_stuff(foo: Option<Foo>) { | --- captured outer variable 14 | require_fn_trait(|| async { | -- ^^^^^ `foo` is moved here | | | captured by this `Fn` closure 15 | if foo.map_or(false, |f| f.foo()) { | --- | | | variable moved due to use in coroutine | move occurs because `foo` has type `Option<Foo>`, which does not implement the `Copy` trait | note: if `Foo` implemented `Clone`, you could clone the value --> f111.rs:4:1 | 4 | struct Foo; | ^^^^^^^^^^ consider implementing `Clone` for this type ... 15 | if foo.map_or(false, |f| f.foo()) { | --- you could clone this value ```
2025-06-05Use non-2015 edition paths in tests that do not test for their resolutionLukas Wirth-11/+11
2025-05-02resolve: Support imports of associated types and glob imports from traitsVadim Petrochenkov-10/+102
2025-04-10replace `//@ compile-flags: --edition` with `//@ edition`Pietro Albini-1/+1
2025-04-08UI tests: add missing diagnostic kinds where possibleVadim Petrochenkov-4/+4
2025-04-03compiletest: Require `//~` annotations even if `error-pattern` is specifiedVadim Petrochenkov-4/+2
2025-01-21Auto merge of #134299 - RalfJung:remove-start, r=compiler-errorsbors-3/+2
remove support for the (unstable) #[start] attribute As explained by `@Noratrieb:` `#[start]` should be deleted. It's nothing but an accidentally leaked implementation detail that's a not very useful mix between "portable" entrypoint logic and bad abstraction. I think the way the stable user-facing entrypoint should work (and works today on stable) is pretty simple: - `std`-using cross-platform programs should use `fn main()`. the compiler, together with `std`, will then ensure that code ends up at `main` (by having a platform-specific entrypoint that gets directed through `lang_start` in `std` to `main` - but that's just an implementation detail) - `no_std` platform-specific programs should use `#![no_main]` and define their own platform-specific entrypoint symbol with `#[no_mangle]`, like `main`, `_start`, `WinMain` or `my_embedded_platform_wants_to_start_here`. most of them only support a single platform anyways, and need cfg for the different platform's ways of passing arguments or other things *anyways* `#[start]` is in a super weird position of being neither of those two. It tries to pretend that it's cross-platform, but its signature is a total lie. Those arguments are just stubbed out to zero on ~~Windows~~ wasm, for example. It also only handles the platform-specific entrypoints for a few platforms that are supported by `std`, like Windows or Unix-likes. `my_embedded_platform_wants_to_start_here` can't use it, and neither could a libc-less Linux program. So we have an attribute that only works in some cases anyways, that has a signature that's a total lie (and a signature that, as I might want to add, has changed recently, and that I definitely would not be comfortable giving *any* stability guarantees on), and where there's a pretty easy way to get things working without it in the first place. Note that this feature has **not** been RFCed in the first place. *This comment was posted [in May](https://github.com/rust-lang/rust/issues/29633#issuecomment-2088596042) and so far nobody spoke up in that issue with a usecase that would require keeping the attribute.* Closes https://github.com/rust-lang/rust/issues/29633 try-job: x86_64-gnu-nopt try-job: x86_64-msvc-1 try-job: x86_64-msvc-2 try-job: test-various
2025-01-21remove support for the #[start] attributeRalf Jung-3/+2
2025-01-16Implement `use` associated items of traitsFrank King-14/+152
2024-11-26tests: remove `//@ pretty-expanded` usages许杰友 Jieyou Xu (Joe)-1/+0
Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
2024-10-14Suppress import errors for traits that couldve applied in method lookup on errorMichael Goulet-0/+36
2024-05-21Make early lints translatableXiretza-2/+2
2024-02-16[AUTO-GENERATED] Migrate ui tests from `//` to `//@` directives许杰友 Jieyou Xu (Joe)-8/+8
2023-11-24Show number in error message even for one errorNilstrieb-12/+12
Co-authored-by: Adrian <adrian.iosdev@gmail.com>
2023-10-05Add a note to duplicate diagnosticsAlex Macleod-0/+2
2023-08-02Resolve visibility paths as modules not as types.Camille GILLOT-2/+2
2023-07-10Do not set up wrong span for adjustmentsMichael Goulet-1/+1
2023-06-22typoTshepang Mbambo-1/+1
2023-05-16Better diagnostic for `use Self::..`clubby789-1/+1
2023-03-22Rename tests to ensure they don't have overlapping names.Eric Huss-0/+23
Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path.
2023-01-11Move /src/test to /testsAlbert Larsan-0/+845