|
3 | 3 | //! This attribute to tell the compiler about semi built-in std library |
4 | 4 | //! features, such as Fn family of traits. |
5 | 5 | use hir_expand::name::Name; |
6 | | -use intern::{Symbol, sym}; |
| 6 | +use intern::{sym, Symbol}; |
7 | 7 | use rustc_hash::FxHashMap; |
8 | 8 | use triomphe::Arc; |
9 | 9 |
|
10 | 10 | use crate::{ |
11 | | - AdtId, AssocItemId, AttrDefId, Crate, EnumId, EnumVariantId, FunctionId, ImplId, ModuleDefId, |
12 | | - StaticId, StructId, TraitId, TypeAliasId, UnionId, |
13 | 11 | db::DefDatabase, |
14 | 12 | expr_store::path::Path, |
15 | 13 | nameres::{assoc::TraitItems, crate_def_map}, |
| 14 | + AdtId, AssocItemId, AttrDefId, Crate, EnumId, EnumVariantId, FunctionId, ImplId, ModuleDefId, |
| 15 | + StaticId, StructId, TraitId, TypeAliasId, UnionId, |
16 | 16 | }; |
17 | 17 |
|
18 | 18 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -153,7 +153,11 @@ pub fn crate_lang_items(db: &dyn DefDatabase, krate: Crate) -> Option<Box<LangIt |
153 | 153 | } |
154 | 154 | } |
155 | 155 |
|
156 | | - if lang_items.items.is_empty() { None } else { Some(Box::new(lang_items)) } |
| 156 | + if lang_items.items.is_empty() { |
| 157 | + None |
| 158 | + } else { |
| 159 | + Some(Box::new(lang_items)) |
| 160 | + } |
157 | 161 | } |
158 | 162 |
|
159 | 163 | /// Salsa query. Look for a lang item, starting from the specified crate and recursively |
@@ -226,7 +230,11 @@ pub(crate) fn crate_notable_traits(db: &dyn DefDatabase, krate: Crate) -> Option |
226 | 230 | } |
227 | 231 | } |
228 | 232 |
|
229 | | - if traits.is_empty() { None } else { Some(traits.into_iter().collect()) } |
| 233 | + if traits.is_empty() { |
| 234 | + None |
| 235 | + } else { |
| 236 | + Some(traits.into_iter().collect()) |
| 237 | + } |
230 | 238 | } |
231 | 239 |
|
232 | 240 | pub enum GenericRequirement { |
@@ -416,7 +424,7 @@ language_item_table! { |
416 | 424 | PanicCannotUnwind, sym::panic_cannot_unwind, panic_cannot_unwind, Target::Fn, GenericRequirement::Exact(0); |
417 | 425 | PanicNullPointerDereference, sym::panic_null_pointer_dereference, panic_null_pointer_dereference, Target::Fn, GenericRequirement::None; |
418 | 426 | /// libstd panic entry point. Necessary for const eval to be able to catch it |
419 | | - BeginPanic, sym::begin_panic, begin_panic_fn, Target::Fn, GenericRequirement::None; |
| 427 | + BeginPanic, sym::panic_with_payload, begin_panic_fn, Target::Fn, GenericRequirement::None; |
420 | 428 |
|
421 | 429 | // Lang items needed for `format_args!()`. |
422 | 430 | FormatAlignment, sym::format_alignment, format_alignment, Target::Enum, GenericRequirement::None; |
|
0 commit comments