diff options
| author | Michael Goulet <michael@errs.io> | 2024-01-05 23:41:41 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-05 23:41:41 -0500 |
| commit | d90c702566bdebdec86534fe8d3f8d6f0fbb0132 (patch) | |
| tree | e6808bcfad2169f4f5ac06578a611896466a746f /compiler | |
| parent | bacddd3e5dbb64329a5fc2bddb24c848574dc306 (diff) | |
| parent | 54967d7a680bc72bea2c1ff6f1edc0d7d2ca6d41 (diff) | |
| download | rust-d90c702566bdebdec86534fe8d3f8d6f0fbb0132.tar.gz rust-d90c702566bdebdec86534fe8d3f8d6f0fbb0132.zip | |
Rollup merge of #119216 - weiznich:use_diagnostic_namespace_in_stdlib, r=compiler-errors
Use diagnostic namespace in stdlib This required a minor fix to have the diagnostics shown in third party crates when the `diagnostic_namespace` feature is not enabled. See https://github.com/rust-lang/rust/pull/119216/commits/5d63f5d8d1a72167c1d5242b2e1ed5b7259fd526 for details. I've opted for having a single PR for both changes as it's really not that much code. If it is required it should be easy to split up the change into several PR's. r? `@compiler-errors`
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs index 52f91d282f0..c9e8b30c4c4 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/on_unimplemented.rs @@ -521,7 +521,7 @@ impl<'tcx> OnUnimplementedDirective { pub fn of_item(tcx: TyCtxt<'tcx>, item_def_id: DefId) -> Result<Option<Self>, ErrorGuaranteed> { if let Some(attr) = tcx.get_attr(item_def_id, sym::rustc_on_unimplemented) { return Self::parse_attribute(attr, false, tcx, item_def_id); - } else if tcx.features().diagnostic_namespace { + } else { tcx.get_attrs_by_path(item_def_id, &[sym::diagnostic, sym::on_unimplemented]) .filter_map(|attr| Self::parse_attribute(attr, true, tcx, item_def_id).transpose()) .try_fold(None, |aggr: Option<Self>, directive| { @@ -592,8 +592,6 @@ impl<'tcx> OnUnimplementedDirective { Ok(Some(directive)) } }) - } else { - Ok(None) } } |
