about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/entry.rs
AgeCommit message (Collapse)AuthorLines
2023-04-01slighty simplify a few boolean expressions (clippy::nonminimal_bool)Matthias Krüger-1/+1
2023-03-22rustc: Remove unused `Session` argument from some attribute functionsVadim Petrochenkov-4/+5
2023-03-02rustc_middle: Remove trait `DefIdTree`Vadim Petrochenkov-1/+1
This trait was a way to generalize over both `TyCtxt` and `Resolver`, but now `Resolver` has access to `TyCtxt`, so this trait is no longer necessary.
2023-01-16Move compiler input and ouput paths into sessionOli Scherer-1/+1
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-10/+10
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-07migrate entry.rs to translateable diagnosticsNathan Stocks-90/+55
2022-09-24separate definitions and `HIR` ownersTakayuki Maeda-4/+4
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
2022-08-28Support `#[unix_sigpipe = "inherit|sig_dfl|sig_ign"]` on `fn main()`Martin Nordholts-14/+42
This makes it possible to instruct libstd to never touch the signal handler for `SIGPIPE`, which makes programs pipeable by default (e.g. with `./your-program | head -n 1`) without `ErrorKind::BrokenPipe` errors.
2022-07-18avoid `Symbol` to `&str` conversionsTakayuki Maeda-1/+1
2022-06-25rustc_passes: De-duplicate more code with `fn throw_attr_err()`Martin Nordholts-12/+14
So we can re-use the code for other attributes later.
2022-06-22Fixup missing renames from `#[main]` to `#[rustc_main]`Martin Nordholts-5/+5
In fc357039f9 `#[main]` was removed and replaced with `#[rustc_main]`. In some place the rename was forgotten, which makes the current code confusing, because at first glance it seems that `#[main]` is still around. Perform the renames also in these places.
2022-05-14use opt_item_name to pattern match items with namesMiguel Guarniz-2/+2
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13avoid converting to DefId from LocalDefId when using queryMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13replace hir().def_kind for def_kind query in rustc_passesMiguel Guarniz-1/+1
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13optimize find_item to fetch Item only when neededMiguel Guarniz-26/+39
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13remove ItemLikeVisitor impl for EntryContextMiguel Guarniz-23/+8
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-1/+1
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-31/+22
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-03-22use `format-args-capture` and remove unnecessary nested if blocks in some ↵Takayuki Maeda-29/+23
parts of rustc_passes break before the `&&` Update compiler/rustc_passes/src/check_const.rs Co-authored-by: bjorn3 <bjorn3@users.noreply.github.com>
2022-03-05Do not point at whole file missing `fn main`Esteban Kuber-3/+3
Only point at the end of the crate. We could try making it point at the beginning of the crate, but that is confused with `DUMMY_SP`, causing the output to be *worse*. This change will make it so that VSCode will *not* underline the whole file when `main` is missing, so other errors will be visible.
2022-01-15Reduce use of local_def_id_to_hir_id.Camille GILLOT-3/+2
2022-01-15Use LocalDefId in rustc_passes::entry.Camille GILLOT-15/+15
2021-09-29Avoid more invocations of hir_crate query.Camille GILLOT-3/+3
2021-08-01Auto merge of #87449 - matthiaskrgr:clippyy_v2, r=nagisabors-1/+1
more clippy::complexity fixes (also a couple of clippy::perf fixes)
2021-07-25clippy::useless_formatMatthias Krüger-1/+1
2021-07-25Introduce OwnerNode::Crate.Camille GILLOT-1/+1
2021-07-06Make resolutions a query.Camille GILLOT-24/+27
2021-06-09Fix ICE when `main` is declared in an `extern` blockasquared31415-1/+15
2021-06-01Revert "Reduce the amount of untracked state in TyCtxt"Camille Gillot-16/+13
2021-05-30Make resolutions a query.Camille GILLOT-13/+16
2021-05-12Use () for entry_fn.Camille GILLOT-8/+2
2021-04-29Implement RFC 1260 with feature_name `imported_main`.Charles Lew-23/+28
2021-04-16Remove #[main] attribute.Charles Lew-7/+4
2021-03-30Remove hir::CrateItem.Camille GILLOT-1/+1
2021-03-09Remove hir::Item::attrs.Camille GILLOT-6/+8
2021-03-09Remove hir::Crate::attrs.Camille GILLOT-2/+2
2021-02-15Only store a LocalDefId in hir::Item.Camille GILLOT-6/+5
Items are guaranteed to be HIR owner.
2020-11-26Formatting.Camille GILLOT-1/+3
2020-11-26Store ForeignItem in a side table.Camille GILLOT-1/+3
2020-10-04Enforce crate level attributes checksGuillaume Gomez-18/+26
2020-08-30mv compiler to compiler/mark-0/+221