about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/traits/object_safety.rs
AgeCommit message (Collapse)AuthorLines
2024-09-25Compiler: Rename "object safe" to "dyn compatible"León Orell Valerian Liehr-940/+0
2024-09-22Reformat using the new identifier sorting from rustfmtMichael Goulet-3/+3
2024-09-03Add `warn(unreachable_pub)` to `rustc_trait_selection`.Nicholas Nethercote-5/+5
2024-08-31Rollup merge of #129767 - nnethercote:rm-extern-crate-tracing-4, r=jieyouxuMatthias Krüger-0/+1
Remove `#[macro_use] extern crate tracing`, round 4 Because explicit importing of macros via use items is nicer (more standard and readable) than implicit importing via #[macro_use]. Continuing the work from #124511, #124914, and #125434. After this PR no `rustc_*` crates use `#[macro_use] extern crate tracing` except for `rustc_codegen_gcc` which is a special case and I will do separately. r? ```@jieyouxu```
2024-08-30Remove `#[macro_use] extern crate tracing` from `rustc_trait_selection`.Nicholas Nethercote-0/+1
2024-08-29Stop using ty::GenericPredicates for non-predicates_of queriesMichael Goulet-6/+4
2024-07-29Reformat `use` declarations.Nicholas Nethercote-7/+6
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-15Fix unsoundness when associated types dont actually come from supertraitsMichael Goulet-110/+154
2024-07-15Item bounds can reference self projections and still be object safeMichael Goulet-44/+80
2024-07-07iter_identity is a better nameMichael Goulet-1/+1
2024-07-05Use `ControlFlow` results for visitors that are only looking for a single valueOli Scherer-2/+3
2024-06-27Make queries more explicitMichael Goulet-2/+2
2024-06-24Split out IntoIterator and non-Iterator constructors for ↵Michael Goulet-1/+1
AliasTy/AliasTerm/TraitRef/projection
2024-06-12Stop passing traitref/traitpredicate by refMichael Goulet-1/+1
2024-06-03check_is_object_safe -> is_object_safeMichael Goulet-2/+2
2024-06-03Make WHERE_CLAUSES_OBJECT_SAFETY a regular object safety violationMichael Goulet-78/+3
2024-06-01Deduplicate supertrait_def_ids codeMark Rousskov-2/+3
2024-06-01Increase vtable layout sizeMark Rousskov-53/+60
This improves LLVM's codegen by allowing vtable loads to be hoisted out of loops (as just one example).
2024-05-23Remove `LintDiagnostic::msg`León Orell Valerian Liehr-34/+29
* instead simply set the primary message inside the lint decorator functions * it used to be this way before [#]101986 which introduced `msg` to prevent good path delayed bugs (which no longer exist) from firing under certain circumstances when lints were suppressed / silenced * this is no longer necessary for various reasons I presume * it shaves off complexity and makes further changes easier to implement
2024-05-19Add and use generics.is_empty() and generics.is_own_empty, rather than using ↵Santiago Pastorino-1/+1
generics' attributes
2024-05-17to_opt_poly_X_pred -> as_X_clauseMichael Goulet-1/+1
2024-05-16Make P parameter explicitMichael Goulet-2/+1
2024-05-16Rename ToPredicate for UpcastMichael Goulet-4/+4
2024-05-13split out AliasTy -> AliasTermMichael Goulet-1/+1
2024-05-11Apply nits, uplift ExistentialPredicate tooMichael Goulet-1/+2
2024-05-09Rename Generics::params to Generics::own_paramsMichael Goulet-1/+1
2024-05-02Inline & delete `Ty::new_unit`, since it's just a field accessWaffle Lapkin-1/+1
2024-03-22Split out ImplPolarity and PredicatePolarityMichael Goulet-1/+1
2024-03-22Update local variables and tracing callsLeón Orell Valerian Liehr-3/+2
Most of the tracing calls didn't fully leverage the power of `tracing`. For example, several of them used to hard-code method names / tracing spans as well as variable names. Use `#[instrument]` and `?var` / `%var` (etc.) instead. In my opinion, this is the proper way to migrate them from the old AstConv nomenclature to the new HIR ty lowering one.
2024-03-22Update (doc) commentsLeón Orell Valerian Liehr-2/+3
Several (doc) comments were super outdated or didn't provide enough context. Some doc comments shoved everything in a single paragraph without respecting the fact that the first paragraph should be a single sentence because rustdoc treats these as item descriptions / synopses on module pages.
2024-03-22Rename AstConv to HIR ty loweringLeón Orell Valerian Liehr-1/+1
This includes updating astconv-related items and a few local variables.
2024-03-05Convert `TypeVisitor` and `DefIdVisitor` to use `VisitorResult`Jason Newcomb-3/+3
2024-02-14Use fewer delayed bugs.Nicholas Nethercote-2/+5
For some cases where it's clear that an error has already occurred, e.g.: - there's a comment stating exactly that, or - things like HIR lowering, where we are lowering an error kind The commit also tweaks some comments around delayed bug sites.
2024-02-12Dejargnonize substShoyu Vanilla-3/+3
2024-01-23Rename `TyCtxt::struct_span_lint_hir` as `TyCtxt::node_span_lint`.Nicholas Nethercote-1/+1
2023-12-24Remove `Session` methods that duplicate `DiagCtxt` methods.Nicholas Nethercote-4/+4
Also add some `dcx` methods to types that wrap `TyCtxt`, for easier access.
2023-12-18Rename `Session::span_diagnostic` as `Session::dcx`.Nicholas Nethercote-3/+1
2023-12-15Rollup merge of #119004 - matthiaskrgr:conv, r=compiler-errorsJubilee-1/+1
NFC don't convert types to identical types
2023-12-15NFC don't convert types to identical typesMatthias Krüger-1/+1
2023-12-15Don't pass lint back out of lint decoratorMichael Goulet-1/+0
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-4/+4
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-26don't add redundant help for object safety violationsRyan Mehri-1/+1
2023-11-21Fix `clippy::needless_borrow` in the compilerNilstrieb-1/+1
`x clippy compiler -Aclippy::all -Wclippy::needless_borrow --fix`. Then I had to remove a few unnecessary parens and muts that were exposed now.
2023-11-13update type flagslcnr-1/+1
- `HAS_RE_LATE_BOUND` -> `HAS_RE_BOUND` - `HAS_TY_LATE_BOUND` -> `HAS_TY_BOUND` - `HAS_CT_LATE_BOUND` -> `HAS_CT_BOUND` - `HAS_LATE_BOUND` -> `HAS_BOUND_VARS` - `fn has_late_bound_regions` -> `fn has_bound_regions` - `fnhas_non_region_late_bound` -> `fn has_non_region_bound_vars` - `fn has_late_bound_vars` -> `fn has_bound_vars`
2023-10-30Detect object safety errors when assoc type is missingEsteban Küber-1/+1
When an associated type with GATs isn't specified in a `dyn Trait`, emit an object safety error instead of only complaining about the missing associated type, as it will lead the user down a path of three different errors before letting them know that what they were trying to do is impossible to begin with. Fix #103155.
2023-10-25Rollup merge of #116401 - WaffleLapkin:vtablin''', r=oli-obkMatthias Krüger-37/+47
Return multiple object-safety violation errors and code improvements to the object-safety check See individual commits for more information. Split off of #114260, since it turned out that the main intent of that PR was wrong. r? oli-obk
2023-10-25Return multiple object-safety violation errorsMaybe Waffle-35/+42
2023-10-25Don't allow dead codeMaybe Waffle-1/+0
2023-10-25Add a comment explaining some weird `is_vtable_safe_method` behaviorMaybe Waffle-0/+4
2023-10-13Format all the let chains in compilerMichael Goulet-4/+3