Skip to content

Commit

Permalink
enable default bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryanskiy committed Feb 8, 2024
1 parent 70506d2 commit 3f57f13
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 130 deletions.
4 changes: 1 addition & 3 deletions compiler/rustc_hir_analysis/src/astconv/bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ impl<'tcx> dyn AstConv<'tcx> + '_ {
let tcx = self.tcx();
let trait_id = tcx.lang_items().get(trait_);

if self.check_for_implicit_trait(trait_id, ast_bounds, self_ty_where_predicates)
&& (trait_ == hir::LangItem::Sized || tcx.features().default_auto_traits)
{
if self.check_for_implicit_trait(trait_id, ast_bounds, self_ty_where_predicates) {
// There was no `?Trait` or `!Trait` bound;
// add `Trait` if it's available.
bounds.push_lang_item_trait(tcx, self_ty, trait_, span);
Expand Down
12 changes: 5 additions & 7 deletions compiler/rustc_hir_analysis/src/astconv/object_safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,11 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
}
}
// FIXME: support polarity for trait objects
if tcx.features().default_auto_traits {
hir::lang_items::DEFAULT_TRAITS.iter().for_each(|default_trait| {
if *default_trait != hir::LangItem::Sized {
bounds.push_lang_item_trait(tcx, dummy_self, *default_trait, span);
}
});
}
hir::lang_items::DEFAULT_TRAITS.iter().for_each(|default_trait| {
if *default_trait != hir::LangItem::Sized {
bounds.push_lang_item_trait(tcx, dummy_self, *default_trait, span);
}
});

let mut trait_bounds = vec![];
let mut projection_bounds = vec![];
Expand Down
2 changes: 1 addition & 1 deletion src/tools/tidy/src/ui_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use std::path::{Path, PathBuf};
// #73494.
const ENTRY_LIMIT: usize = 900;
// FIXME: The following limits should be reduced eventually.
const ISSUES_ENTRY_LIMIT: usize = 1819;
const ISSUES_ENTRY_LIMIT: usize = 1816;
const ROOT_ENTRY_LIMIT: usize = 871;

const EXPECTED_TEST_FILE_EXTENSIONS: &[&str] = &[
Expand Down
28 changes: 0 additions & 28 deletions tests/ui/issues/issue-29147-rpass.rs

This file was deleted.

23 changes: 0 additions & 23 deletions tests/ui/issues/issue-29147.rs

This file was deleted.

17 changes: 0 additions & 17 deletions tests/ui/issues/issue-29147.stderr

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 3f57f13

Please sign in to comment.