about summary refs log tree commit diff
path: root/compiler/rustc_passes/src/check_const.rs
AgeCommit message (Collapse)AuthorLines
2023-03-21Use local key in providersMichael Goulet-3/+1
2023-01-30session: diagnostic migration lint on more fnsDavid Wood-2/+2
Apply the diagnostic migration lint to more functions on `Session`. Signed-off-by: David Wood <david.wood@huawei.com>
2023-01-12Expand format_args!() in rust_ast_lowering.Mara Bos-1/+1
2022-10-07Remove code that was removed in master, and the corresponding diagnosticNathan Stocks-21/+1
2022-10-07migrate check_const.rs to translateable diagnosticsNathan Stocks-4/+29
2022-10-04Merge the `~const` and `impl const` checks and add some explanatory notesOli Scherer-26/+0
2022-09-30Use let chains instead of let elsefee1-dead-1/+1
2022-09-27Fix ICE in const_trait check codeDeadbeef-1/+1
This fixes #102156.
2022-09-16Require `#[const_trait]` for `const` `impl`sDeadbeef-0/+22
2022-08-01Remove trait_of_item query.Camille GILLOT-1/+1
2022-07-13Rename `debugging_opts` to `unstable_opts`Joshua Nelson-1/+1
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`). Rename it to be more clear.
2022-07-07Reword comments and rename HIR visiting methods.Camille GILLOT-1/+1
2022-05-30Remove `#[default..]` and add `#[const_trait]`Deadbeef-62/+0
2022-05-14allocate string only when error will be emittedMiguel Guarniz-2/+7
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13change back to using tcx.hir() visit-item methodMiguel Guarniz-29/+7
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-13replace usage of visit_item_likes_in_modules with hir_module_items queryMiguel Guarniz-2/+20
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-13Remove CheckConstTraitVisitorMiguel Guarniz-68/+54
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-05-10only_local: always check for misuselcnr-4/+6
2022-03-30Spellchecking compiler commentsYuri Astrakhan-1/+1
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-22use `format-args-capture` and remove unnecessary nested if blocks in some ↵Takayuki Maeda-3/+1
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-02-23rustc_errors: let `DiagnosticBuilder::emit` return a "guarantee of emission".Eduard-Mihai Burtescu-1/+3
2022-01-16Replace NestedVisitorMap with NestedFilterCameron Steffen-5/+5
2022-01-07Add query to avoid name comparison in `leaf_def`Matthew Jasper-5/+8
2021-12-15Remove `in_band_lifetimes` for `rustc_passes`Peter Jaszkowiak-4/+4
2021-11-24Allow features like const_try in d_m_b_i_cDeadbeef-0/+6
2021-11-07more clippy fixesMatthias Krüger-3/+3
2021-10-11Use Ancestory to check default fn in const impl instead of comparing identsGary Guo-18/+26
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-7/+2
2021-07-29Add feature gates for `for` and `?` in constsJonas Schievink-4/+5
2021-07-10Applied suggestionsDeadbeef-11/+6
2021-07-10Add #[default_method_body_is_const]Deadbeef-18/+31
2021-07-01Do the check even when the feature is not enabledDeadbeef-3/+6
2021-06-23deny using default function in impl const TraitDeadbeef-0/+59
2021-02-21remove redundant wrapping of return types of allow_internal_unstable() and ↵Matthias Krüger-1/+1
rustc_allow_const_fn_unstable()
2021-02-17replace if-let and while-let with `if let` and `while let`Takayuki Maeda-1/+1
2021-01-21Add loop head span to hirEsteban Küber-1/+1
2021-01-07Reintroduce hir::ExprKind::IfCaio-3/+1
2020-12-06Implement lowering of if-let guards to MIRLeSeulArtichaut-0/+2
2020-11-07Allow making `RUSTC_BOOTSTRAP` conditional on the crate nameJoshua Nelson-2/+1
The main change is that `UnstableOptions::from_environment` now requires an (optional) crate name. If the crate name is unknown (`None`), then the new feature is not available and you still have to use `RUSTC_BOOTSTRAP=1`. In practice this means the feature is only available for `--crate-name`, not for `#![crate_name]`; I'm interested in supporting the second but I'm not sure how. Other major changes: - Added `Session::is_nightly_build()`, which uses the `crate_name` of the session - Added `nightly_options::match_is_nightly_build`, a convenience method for looking up `--crate-name` from CLI arguments. `Session::is_nightly_build()`should be preferred where possible, since it will take into account `#![crate_name]` (I think). - Added `unstable_features` to `rustdoc::RenderOptions` There is a user-facing change here: things like `RUSTC_BOOTSTRAP=0` no longer active nightly features. In practice this shouldn't be a big deal, since `RUSTC_BOOTSTRAP` is the opposite of stable and everyone uses `RUSTC_BOOTSTRAP=1` anyway. - Add tests Check against `Cheat`, not whether nightly features are allowed. Nightly features are always allowed on the nightly channel. - Only call `is_nightly_build()` once within a function - Use booleans consistently for rustc_incremental Sessions can't be passed through threads, so `read_file` couldn't take a session. To be consistent, also take a boolean in `write_file_header`.
2020-10-21switch allow_internal_unstable const fns to rustc_allow_const_fn_unstableFlorian Warzecha-3/+3
2020-08-30mv compiler to compiler/mark-0/+227