Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 065b242

Browse files
committedJul 26, 2024
Auto merge of rust-lang#128230 - matthiaskrgr:rollup-k3f7rz7, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#121676 (Support ?Trait bounds in supertraits and dyn Trait under a feature gate) - rust-lang#124339 (allow overwriting the output of `rustc --version`) - rust-lang#128223 (Refactor complex conditions in `collect_tokens_trailing_token`) - rust-lang#128224 (Remove unnecessary range replacements) - rust-lang#128226 (Remove redundant option that was just encoding that a slice was empty) - rust-lang#128227 (CI: do not respect custom try jobs for unrolled perf builds) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 2d5a628 + 53f0849 commit 065b242

File tree

42 files changed

+466
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+466
-161
lines changed
 

‎compiler/rustc_lint/src/traits.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,11 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints {
113113

114114
fn check_ty(&mut self, cx: &LateContext<'_>, ty: &'tcx hir::Ty<'tcx>) {
115115
let hir::TyKind::TraitObject(bounds, _lifetime, _syntax) = &ty.kind else { return };
116-
for bound in &bounds[..] {
116+
for (bound, modifier) in &bounds[..] {
117117
let def_id = bound.trait_ref.trait_def_id();
118-
if cx.tcx.lang_items().drop_trait() == def_id {
118+
if cx.tcx.lang_items().drop_trait() == def_id
119+
&& *modifier != hir::TraitBoundModifier::Maybe
120+
{
119121
let Some(def_id) = cx.tcx.get_diagnostic_item(sym::needs_drop) else { return };
120122
cx.emit_span_lint(DYN_DROP, bound.span, DropGlue { tcx: cx.tcx, def_id });
121123
}

‎compiler/rustc_parse/src/parser/attr.rs

-11
Original file line numberDiff line numberDiff line change
@@ -457,14 +457,3 @@ impl<'a> Parser<'a> {
457457
Err(self.dcx().create_err(err))
458458
}
459459
}
460-
461-
/// The attributes are complete if all attributes are either a doc comment or a
462-
/// builtin attribute other than `cfg_attr`.
463-
pub fn is_complete(attrs: &[ast::Attribute]) -> bool {
464-
attrs.iter().all(|attr| {
465-
attr.is_doc_comment()
466-
|| attr.ident().is_some_and(|ident| {
467-
ident.name != sym::cfg_attr && rustc_feature::is_builtin_attr_name(ident.name)
468-
})
469-
})
470-
}
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.