@@ -47,7 +47,7 @@ use rustc_middle::{bug, span_bug};
47
47
use rustc_session:: lint:: builtin:: AMBIGUOUS_ASSOCIATED_ITEMS ;
48
48
use rustc_span:: edit_distance:: find_best_match_for_name;
49
49
use rustc_span:: symbol:: { kw, Ident , Symbol } ;
50
- use rustc_span:: { sym , Span , DUMMY_SP } ;
50
+ use rustc_span:: { Span , DUMMY_SP } ;
51
51
use rustc_target:: spec:: abi;
52
52
use rustc_trait_selection:: infer:: InferCtxtExt ;
53
53
use rustc_trait_selection:: traits:: wf:: object_region_bounds;
@@ -560,7 +560,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
560
560
}
561
561
if let ty:: BoundConstness :: Const | ty:: BoundConstness :: ConstIfConst = constness
562
562
&& generics. has_self
563
- && !tcx. has_attr ( def_id, sym :: const_trait )
563
+ && !tcx. is_const_trait ( def_id)
564
564
{
565
565
let reported = tcx. dcx ( ) . emit_err ( crate :: errors:: ConstBoundForNonConstTrait {
566
566
span,
@@ -1848,19 +1848,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
1848
1848
path. segments [ ..path. segments . len ( ) - 2 ] . iter ( ) ,
1849
1849
GenericsArgsErrExtend :: None ,
1850
1850
) ;
1851
- // HACK: until we support `<Type as ~const Trait>`, assume all of them are.
1852
- let constness = if tcx. has_attr ( tcx. parent ( def_id) , sym:: const_trait) {
1853
- ty:: BoundConstness :: ConstIfConst
1854
- } else {
1855
- ty:: BoundConstness :: NotConst
1856
- } ;
1857
1851
self . lower_qpath (
1858
1852
span,
1859
1853
opt_self_ty,
1860
1854
def_id,
1861
1855
& path. segments [ path. segments . len ( ) - 2 ] ,
1862
1856
path. segments . last ( ) . unwrap ( ) ,
1863
- constness ,
1857
+ ty :: BoundConstness :: NotConst ,
1864
1858
)
1865
1859
}
1866
1860
Res :: PrimTy ( prim_ty) => {
0 commit comments