rust/compiler/rustc_middle/src
bors 21e6de7eb6 Auto merge of #124187 - compiler-errors:self-ctor, r=petrochenkov
Warn (or error) when `Self` ctor from outer item is referenced in inner nested item

This implements a warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM` when a self constructor from an outer impl is referenced in an inner nested item. This is a proper fix mentioned https://github.com/rust-lang/rust/pull/117246#discussion_r1374648388.

This warning is additionally bumped to a hard error when the self type references generic parameters, since it's almost always going to ICE, and is basically *never* correct to do.

This also reverts part of https://github.com/rust-lang/rust/pull/117246, since I believe this is the proper fix and we shouldn't need the helper functions (`opt_param_at`/`opt_type_param`) any longer, since they shouldn't really ever be used in cases where we don't have this problem.
2024-05-25 01:17:55 +00:00
..
dep_graph Use a dyn Debug trait object instead of a closure. 2024-03-27 10:59:18 +00:00
hir rustc: Use tcx.used_crates(()) more 2024-05-22 18:02:51 +03:00
hooks Remove #[macro_use] extern crate tracing from rustc_middle. 2024-05-23 18:02:40 +10:00
infer Uplift OutlivesPredicate, remove a bunch of unnecessary associated types from Interner 2024-05-21 17:00:45 -04:00
middle Remove #[macro_use] extern crate tracing from rustc_middle. 2024-05-23 18:02:40 +10:00
mir Auto merge of #125434 - nnethercote:rm-more-extern-tracing, r=jackh726 2024-05-23 21:36:54 +00:00
query Improve the doc of query associated_item 2024-05-23 23:50:39 +08:00
thir Track mutability of deref patterns 2024-04-20 15:59:54 +02:00
traits move global cache lookup into fn 2024-05-20 20:40:02 +00:00
ty Auto merge of #124187 - compiler-errors:self-ctor, r=petrochenkov 2024-05-25 01:17:55 +00:00
util Remove #[macro_use] extern crate tracing from rustc_middle. 2024-05-23 18:02:40 +10:00
arena.rs Uplift inspect into rustc_type_ir 2024-05-18 16:21:43 -04:00
error.rs Remove extern crate rustc_macros from rustc_middle. 2024-04-29 11:19:16 +10:00
lib.rs Remove #[macro_use] extern crate tracing from rustc_middle. 2024-05-23 18:02:40 +10:00
lint.rs Remove #[macro_use] extern crate tracing from rustc_middle. 2024-05-23 18:02:40 +10:00
macros.rs Lift Lift 2024-05-10 15:44:03 -04:00
metadata.rs Remove extern crate rustc_macros from rustc_middle. 2024-04-29 11:19:16 +10:00
tests.rs Give an item related to issue 27438 a more meaningful name 2024-04-30 22:27:19 +02:00
thir.rs Remove #[macro_use] extern crate tracing from rustc_middle. 2024-05-23 18:02:40 +10:00
values.rs Rename Unsafe to Safety 2024-05-17 18:33:37 -03:00