1
Fork 0
Empowering everyone to build reliable and efficient software. Gabriel's commits. https://www.rust-lang.org/
Find a file
Jubilee e2ee9f7318
Rollup merge of #136863 - lcnr:treat-as-rigid, r=compiler-errors
rework rigid alias handling

Necessary for https://github.com/rust-lang/rust/pull/136824 if we treat coinductive cycles as errors as we otherwise don't emit an error for

```rust
trait Overflow {
    type Assoc;
}
impl<T> Overflow for T {
    type Assoc = <T as Overflow>::Assoc;
}
```

The important part is that we only add a `RigidAlias` candidate in cases where the alias is actually supposed to be rigid:
- its trait bound has been proven via a `ParamEnv` or `ItemBound` candidate
- it's one of the special builtin traits which have a blanket impl with a `default` assoc type

This means that we now more explicitly control which aliases should rigid to avoid accidentally accepting cyclic aliases. This requires changes to diagnostics as we no longer enter an explicit `RigidAlias` candidate for `NormalizesTo` goals whose trait bound doesn't hold.

To fix this I've modified the `BestObligation` visitor always ignore `RigidAlias` candidates and to instead manually check these requirements if there are no applicable candidates. I also removed the hack for handling `structurally_normalize_ty` failures. This fixes #134905 as we no longer continue to use the `EvalCtxt` even though a nested goal failed.

r? ``@compiler-errors``
2025-02-13 17:46:07 -08:00
.github Don't install msys2 2025-02-05 14:22:54 +00:00
compiler adjust derive_error 2025-02-13 23:49:09 +01:00
library Auto merge of #134633 - GrigorenkoPV:get_disjoint_mut, r=cuviper 2025-02-13 21:09:31 +00:00
LICENSES
src Auto merge of #136593 - lukas-code:ty-value-perf, r=oli-obk 2025-02-13 15:27:30 +00:00
tests adjust derive_error 2025-02-13 23:49:09 +01:00
.clang-format
.editorconfig Don't apply editorconfig to llvm 2025-02-09 16:21:14 -05:00
.git-blame-ignore-revs Git blame ignore recent formatting commit 2025-02-09 12:00:23 -08:00
.gitattributes
.gitignore
.gitmodules
.ignore
.mailmap
Cargo.lock compiler: remove rustc_target reexport of rustc_abi::HashStableContext 2025-02-11 18:55:48 -08:00
Cargo.toml Remove the rustc-perf-wrapper tool 2025-02-05 15:33:40 +01:00
CODE_OF_CONDUCT.md
config.example.toml Rollup merge of #136858 - safinaskar:parallel-cleanup-2025-02-11-07-54, r=SparrowLii 2025-02-13 03:53:31 -05:00
configure
CONTRIBUTING.md
COPYRIGHT
INSTALL.md
LICENSE-APACHE
license-metadata.json
LICENSE-MIT
README.md
RELEASES.md Rollup merge of #136266 - cyrgani:patch-1, r=Mark-Simulacrum 2025-02-01 01:19:20 +01:00
REUSE.toml
rust-bors.toml
rustfmt.toml
triagebot.toml Rollup merge of #136947 - nnethercote:reinstate-nnethercote, r=nnethercote 2025-02-12 20:10:03 -05:00
x
x.ps1
x.py

This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.

Why Rust?

  • Performance: Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages.

  • Reliability: Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time.

  • Productivity: Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool (Cargo), auto-formatter (rustfmt), linter (Clippy) and editor support (rust-analyzer).

Quick Start

Read "Installation" from The Book.

Installing from Source

If you really want to install from source (though this is not recommended), see INSTALL.md.

Getting Help

See https://www.rust-lang.org/community for a list of chat platforms and forums.

Contributing

See CONTRIBUTING.md.

License

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

Trademark

The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").

If you want to use these names or brands, please read the media guide.

Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.