Skip to content

Commit f624d55

Browse files
Nits
1 parent a9dbf63 commit f624d55

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

compiler/rustc_infer/src/traits/engine.rs

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ impl<'tcx, T: ?Sized + TraitEngine<'tcx>> T {
6464
}
6565
}
6666

67+
#[must_use]
6768
fn select_all_or_error(&mut self, infcx: &InferCtxt<'tcx>) -> Vec<FulfillmentError<'tcx>> {
6869
let errors = self.select_where_possible(infcx);
6970
if !errors.is_empty() {

compiler/rustc_macros/src/extension.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ pub(crate) fn extension(
6868

6969
/// Only keep `#[doc]` attrs.
7070
fn scrub_attrs(attrs: &[Attribute]) -> Vec<Attribute> {
71-
attrs.into_iter().cloned().filter(|attr| attr.path().segments[0].ident == "doc").collect()
71+
attrs
72+
.into_iter()
73+
.cloned()
74+
.filter(|attr| {
75+
let ident = &attr.path().segments[0].ident;
76+
ident == "doc" || ident == "must_use"
77+
})
78+
.collect()
7279
}
7380

7481
/// Scrub arguments so that they're valid for trait signatures.

compiler/rustc_trait_selection/src/traits/query/normalize.rs

+6
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ impl<'cx, 'tcx> At<'cx, 'tcx> {
3737
/// normalizing, but for now should be used only when we actually
3838
/// know that normalization will succeed, since error reporting
3939
/// and other details are still "under development".
40+
///
41+
/// This normalization should *only* be used when the projection does not
42+
/// have possible ambiguity or may not be well-formed.
43+
///
44+
/// After codegen, when lifetimes do not matter, it is preferable to instead
45+
/// use [`TyCtxt::normalize_erasing_regions`], which wraps this procedure.
4046
fn query_normalize<T>(self, value: T) -> Result<Normalized<'tcx, T>, NoSolution>
4147
where
4248
T: TypeFoldable<TyCtxt<'tcx>>,

0 commit comments

Comments
 (0)