@@ -47,7 +47,7 @@ use rustc_middle::{bug, span_bug};
4747use rustc_session:: lint:: builtin:: AMBIGUOUS_ASSOCIATED_ITEMS ;
4848use rustc_span:: edit_distance:: find_best_match_for_name;
4949use rustc_span:: symbol:: { kw, Ident , Symbol } ;
50- use rustc_span:: { sym , Span , DUMMY_SP } ;
50+ use rustc_span:: { Span , DUMMY_SP } ;
5151use rustc_target:: spec:: abi;
5252use rustc_trait_selection:: traits:: wf:: object_region_bounds;
5353use rustc_trait_selection:: traits:: { self , ObligationCtxt } ;
@@ -559,7 +559,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
559559 }
560560 if let ty:: BoundConstness :: Const | ty:: BoundConstness :: ConstIfConst = constness
561561 && generics. has_self
562- && !tcx. has_attr ( def_id, sym :: const_trait )
562+ && !tcx. is_const_trait ( def_id)
563563 {
564564 let reported = tcx. dcx ( ) . emit_err ( crate :: errors:: ConstBoundForNonConstTrait {
565565 span,
@@ -1847,19 +1847,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
18471847 path. segments [ ..path. segments . len ( ) - 2 ] . iter ( ) ,
18481848 GenericsArgsErrExtend :: None ,
18491849 ) ;
1850- // HACK: until we support `<Type as ~const Trait>`, assume all of them are.
1851- let constness = if tcx. has_attr ( tcx. parent ( def_id) , sym:: const_trait) {
1852- ty:: BoundConstness :: ConstIfConst
1853- } else {
1854- ty:: BoundConstness :: NotConst
1855- } ;
18561850 self . lower_qpath (
18571851 span,
18581852 opt_self_ty,
18591853 def_id,
18601854 & path. segments [ path. segments . len ( ) - 2 ] ,
18611855 path. segments . last ( ) . unwrap ( ) ,
1862- constness ,
1856+ ty :: BoundConstness :: NotConst ,
18631857 )
18641858 }
18651859 Res :: PrimTy ( prim_ty) => {
0 commit comments