Skip to content

Commit

Permalink
Auto merge of rust-lang#105804 - matthiaskrgr:rollup-iaqlbl3, r=matth…
Browse files Browse the repository at this point in the history
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#105493 (Help rust-analyzer normalize query return types)
 - rust-lang#105710 (Don't bug if we're trying to cast `dyn*` to another type)
 - rust-lang#105711 (bail in `collect_trait_impl_trait_tys` if signatures reference errors)
 - rust-lang#105768 (Detect inherent associated types not having CamelCase)
 - rust-lang#105780 (rustdoc: Don't add "Read more" link if there is no extra content)
 - rust-lang#105802 (Make enum-match.rs test robust against variable name changes)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Dec 17, 2022
2 parents bbb9cfb + 803ce45 commit 998e1a9
Show file tree
Hide file tree
Showing 15 changed files with 269 additions and 15 deletions.
2 changes: 2 additions & 0 deletions compiler/rustc_hir_analysis/src/check/compare_method.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
tcx.fn_sig(impl_m.def_id),
),
);
impl_sig.error_reported()?;
let impl_return_ty = impl_sig.output();

// Normalize the trait signature with liberated bound vars, passing it through
Expand All @@ -419,6 +420,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
)
.fold_with(&mut collector);
let trait_sig = ocx.normalize(&norm_cause, param_env, unnormalized_trait_sig);
trait_sig.error_reported()?;
let trait_return_ty = trait_sig.output();

let wf_tys = FxIndexSet::from_iter(
Expand Down
4 changes: 3 additions & 1 deletion compiler/rustc_hir_typeck/src/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -847,13 +847,15 @@ impl<'a, 'tcx> CastCheck<'tcx> {

(Int(_) | Float, Int(_) | Float) => Ok(CastKind::NumericCast),

(_, DynStar) | (DynStar, _) => {
(_, DynStar) => {
if fcx.tcx.features().dyn_star {
bug!("should be handled by `try_coerce`")
} else {
Err(CastError::IllegalCast)
}
}

(DynStar, _) => Err(CastError::IllegalCast),
}
}

Expand Down
12 changes: 11 additions & 1 deletion compiler/rustc_lint/src/nonstandard_style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,23 @@ impl EarlyLintPass for NonCamelCaseTypes {
return;
}

match it.kind {
match &it.kind {
ast::ItemKind::TyAlias(..)
| ast::ItemKind::Enum(..)
| ast::ItemKind::Struct(..)
| ast::ItemKind::Union(..) => self.check_case(cx, "type", &it.ident),
ast::ItemKind::Trait(..) => self.check_case(cx, "trait", &it.ident),
ast::ItemKind::TraitAlias(..) => self.check_case(cx, "trait alias", &it.ident),

// N.B. This check is only for inherent associated types, so that we don't lint against
// trait impls where we should have warned for the trait definition already.
ast::ItemKind::Impl(box ast::Impl { of_trait: None, items, .. }) => {
for it in items {
if let ast::AssocItemKind::Type(..) = it.kind {
self.check_case(cx, "associated type", &it.ident);
}
}
}
_ => (),
}
}
Expand Down
Loading

0 comments on commit 998e1a9

Please sign in to comment.