Rollup of 8 pull requests
Successful merges:
- #72932 (Clarify the behaviour of Pattern when used with methods like str::contains)
- #73066 (Querify whether a type has structural equality (Take 2))
- #73194 (Prefer the associated constants for pattern matching error)
- #73241 (Add/update comments about MinGW late_link_args)
- #73267 (Use the built cargo for cargotest.)
- #73290 (Fix links when pinging notification groups)
- #73302 (Adjusted some doctests in libcore to use `should_panic`.)
- #73308 (pretty/asm.rs should only be tested for x86_64 and not AArch64)
Failed merges:
r? @ghost
Adjusted some doctests in libcore to use `should_panic`.
Fixes#73196 .
I grepped libstd and libcore for all the instances of this pattern that I could find, but its possible that I missed some of course. If anyone knows of any more, please let me know and I will add them to the PR.
Use the built cargo for cargotest.
cargotest was using the beta (bootstrap) cargo. This changes it so that it will use the locally built cargo. This is intended to provide a sort of smoke test to ensure Cargo is functional. This *shouldn't* have any real impact on the CI build time. The cargotest job also happens to run cargo's testsuite, so it should already be building cargo.
Note: This will fail until #73266 is merged.
Querify whether a type has structural equality (Take 2)
Alternative to #72177.
Unlike in #72177, this helper method works for all types, falling back to a query for `TyKind::Adt`s that determines whether the `{Partial,}StructuralEq` traits are implemented.
This is my preferred interface for this method. I think this is better than just documenting that the helper only works for ADTs. If others disagree, we can just merge #72177 with the fixes applied. This has already taken far too long.
Clarify the behaviour of Pattern when used with methods like str::contains
Fixes#45507.
I used the previous work by @Emerentius (thanks !), added a paragraph and checked the links (they work for me but I'm not against someone else checking them too).
Add needs-sanitizer-{address,leak,memory,thread} directive indicating
that test requires target with support for specific sanitizer.
This is an addition to the existing needs-sanitizer-support directive
indicating that test requires a sanitizer runtime library.
These lead to inference regressions (mostly in tests) in code that looks
like:
let socket = std::net::SocketAddrV4::new(std::net::Ipv4Addr::new(127, 0, 0, 1), 8080);
assert_eq!(socket, "127.0.0.1:8080".parse().unwrap());
That compiles as of stable 1.44.0 but fails in beta with:
error[E0284]: type annotations needed
--> src/main.rs:3:41
|
3 | assert_eq!(socket, "127.0.0.1:8080".parse().unwrap());
| ^^^^^ cannot infer type for type parameter `F` declared on the associated function `parse`
|
= note: cannot satisfy `<_ as std::str::FromStr>::Err == _`
help: consider specifying the type argument in the method call
|
3 | assert_eq!(socket, "127.0.0.1:8080".parse::<F>().unwrap());
|
Previously, some doctests were spawning new threads and joining them to
indicate that a particular call should panic; this hurt readability, so
the tests have been adjusted to simply call the method and use the
`should_panic` marker.
This helper method works for all types, falling back to a query for
`TyKind::Adt`s to determine whether the implement the
`{Partial,}StructuralEq` traits.
Allow inference regions when relating consts
As first noticed by @eddyb, `super_relate_consts` doesn't need to check for inference vars since `eval` does it already (and handles lifetimes correctly by erasing them).
Fixes#73050
r? @oli-obk
expand: More precise locations for expansion-time lints
First commit: a macro expansion doesn't have a `NodeId` associated with it, but it has a parent `DefId` which we can use for linting.
The observable effect is that lints associated with macro expansions can now be `allow`ed at finer-grained level than whole crate.
Second commit: each macro definition has a `NodeId` which we can use for linting, unless that macro definition was decoded from other crate.