authorbors <bors@rust-lang.org> 2024-10-28 07:14:11 UTC
committerbors <bors@rust-lang.org> 2024-10-28 07:14:11 UTC
log66701c42263042f7120385725606edeb987ad4f1
tree96dfa9e60522906eb23e41080cc1d6b54f6ed896
parent6929a48275547ef2aae72b85b5b5d8e4acbb5067
parent3e3feac7c3c6e3561b7a452e3764810f2edd1c33

Auto merge of #132251 - jieyouxu:rollup-mtv9mpd, r=jieyouxu

Rollup of 7 pull requests Successful merges: - #131633 (error on alignments greater than `isize::MAX`) - #132086 (Tweak E0277 highlighting and "long type" path printing) - #132220 (Add GUI regression test for doc struct fields margins) - #132225 (Dynamically link run-make support) - #132227 (Pass constness with span into lower_poly_trait_ref) - #132242 (Support `char::is_digit` in const contexts.) - #132243 (Remove `ObligationCause::span()` method) r? `@ghost` `@rustbot` modify labels: rollup

66 files changed, 572 insertions(+), 337 deletions(-)

compiler/rustc_hir_analysis/src/check/compare_impl_item.rs+2-2
......@@ -611,7 +611,7 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>(
611611 Err(terr) => {
612612 let mut diag = struct_span_code_err!(
613613 tcx.dcx(),
614 cause.span(),
614 cause.span,
615615 E0053,
616616 "method `{}` has an incompatible return type for trait",
617617 trait_m.name
......@@ -1169,7 +1169,7 @@ fn extract_spans_for_error_reporting<'tcx>(
11691169 TypeError::ArgumentMutability(i) | TypeError::ArgumentSorts(ExpectedFound { .. }, i) => {
11701170 (impl_args.nth(i).unwrap(), trait_args.and_then(|mut args| args.nth(i)))
11711171 }
1172 _ => (cause.span(), tcx.hir().span_if_local(trait_m.def_id)),
1172 _ => (cause.span, tcx.hir().span_if_local(trait_m.def_id)),
11731173 }
11741174}
11751175
compiler/rustc_hir_analysis/src/check/mod.rs+1-1
......@@ -612,7 +612,7 @@ pub fn check_function_signature<'tcx>(
612612 match err {
613613 TypeError::ArgumentMutability(i)
614614 | TypeError::ArgumentSorts(ExpectedFound { .. }, i) => args.nth(i).unwrap(),
615 _ => cause.span(),
615 _ => cause.span,
616616 }
617617 }
618618
compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs-7
......@@ -168,13 +168,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
168168 match hir_bound {
169169 hir::GenericBound::Trait(poly_trait_ref) => {
170170 let hir::TraitBoundModifiers { constness, polarity } = poly_trait_ref.modifiers;
171 // FIXME: We could pass these directly into `lower_poly_trait_ref`
172 // so that we could use these spans in diagnostics within that function...
173 let constness = match constness {
174 hir::BoundConstness::Never => None,
175 hir::BoundConstness::Always(_) => Some(ty::BoundConstness::Const),
176 hir::BoundConstness::Maybe(_) => Some(ty::BoundConstness::ConstIfConst),
177 };
178171 let polarity = match polarity {
179172 rustc_ast::BoundPolarity::Positive => ty::PredicatePolarity::Positive,
180173 rustc_ast::BoundPolarity::Negative(_) => ty::PredicatePolarity::Negative,
compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs+1-1
......@@ -50,7 +50,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
5050 } = self.lower_poly_trait_ref(
5151 &trait_bound.trait_ref,
5252 trait_bound.span,
53 None,
53 hir::BoundConstness::Never,
5454 ty::PredicatePolarity::Positive,
5555 dummy_self,
5656 &mut bounds,
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs+8-8
......@@ -658,7 +658,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
658658 &self,
659659 trait_ref: &hir::TraitRef<'tcx>,
660660 span: Span,
661 constness: Option<ty::BoundConstness>,
661 constness: hir::BoundConstness,
662662 polarity: ty::PredicatePolarity,
663663 self_ty: Ty<'tcx>,
664664 bounds: &mut Bounds<'tcx>,
......@@ -681,11 +681,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
681681 Some(self_ty),
682682 );
683683
684 if let Some(constness) = constness
684 if let hir::BoundConstness::Always(span) | hir::BoundConstness::Maybe(span) = constness
685685 && !self.tcx().is_const_trait(trait_def_id)
686686 {
687687 self.dcx().emit_err(crate::errors::ConstBoundForNonConstTrait {
688 span: trait_ref.path.span,
688 span,
689689 modifier: constness.as_str(),
690690 });
691691 }
......@@ -708,7 +708,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
708708 bounds.push_trait_bound(tcx, poly_trait_ref, span, polarity);
709709
710710 match constness {
711 Some(ty::BoundConstness::Const) => {
711 hir::BoundConstness::Always(span) => {
712712 if polarity == ty::PredicatePolarity::Positive {
713713 bounds.push_const_bound(
714714 tcx,
......@@ -718,13 +718,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
718718 );
719719 }
720720 }
721 Some(ty::BoundConstness::ConstIfConst) => {
721 hir::BoundConstness::Maybe(_) => {
722722 // We don't emit a const bound here, since that would mean that we
723723 // unconditionally need to prove a `HostEffect` predicate, even when
724724 // the predicates are being instantiated in a non-const context. This
725725 // is instead handled in the `const_conditions` query.
726726 }
727 None => {}
727 hir::BoundConstness::Never => {}
728728 }
729729 }
730730 // On the flip side, when filtering `ConstIfConst` bounds, we only need to convert
......@@ -734,12 +734,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
734734 // here because we only call this on self bounds, and deal with the recursive case
735735 // in `lower_assoc_item_constraint`.
736736 PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => match constness {
737 Some(ty::BoundConstness::ConstIfConst) => {
737 hir::BoundConstness::Maybe(span) => {
738738 if polarity == ty::PredicatePolarity::Positive {
739739 bounds.push_const_bound(tcx, poly_trait_ref, ty::HostPolarity::Maybe, span);
740740 }
741741 }
742 None | Some(ty::BoundConstness::Const) => {}
742 hir::BoundConstness::Always(_) | hir::BoundConstness::Never => {}
743743 },
744744 }
745745
compiler/rustc_hir_typeck/src/_match.rs+7-9
......@@ -94,14 +94,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
9494 (None, arm.body.span)
9595 };
9696
97 let (span, code) = match prior_arm {
97 let code = match prior_arm {
9898 // The reason for the first arm to fail is not that the match arms diverge,
9999 // but rather that there's a prior obligation that doesn't hold.
100 None => {
101 (arm_span, ObligationCauseCode::BlockTailExpression(arm.body.hir_id, match_src))
102 }
103 Some((prior_arm_block_id, prior_arm_ty, prior_arm_span)) => (
104 expr.span,
100 None => ObligationCauseCode::BlockTailExpression(arm.body.hir_id, match_src),
101 Some((prior_arm_block_id, prior_arm_ty, prior_arm_span)) => {
105102 ObligationCauseCode::MatchExpressionArm(Box::new(MatchExpressionArmCause {
106103 arm_block_id,
107104 arm_span,
......@@ -110,13 +107,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
110107 prior_arm_ty,
111108 prior_arm_span,
112109 scrut_span: scrut.span,
110 expr_span: expr.span,
113111 source: match_src,
114112 prior_non_diverging_arms: prior_non_diverging_arms.clone(),
115113 tail_defines_return_position_impl_trait,
116 })),
117 ),
114 }))
115 }
118116 };
119 let cause = self.cause(span, code);
117 let cause = self.cause(arm_span, code);
120118
121119 // This is the moral equivalent of `coercion.coerce(self, cause, arm.body, arm_ty)`.
122120 // We use it this way to be able to expand on the potential error and detect when a
compiler/rustc_hir_typeck/src/expr.rs+1-1
......@@ -2027,7 +2027,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
20272027 }
20282028 Err(_) => {
20292029 span_bug!(
2030 cause.span(),
2030 cause.span,
20312031 "subtyping remaining fields of type changing FRU failed: {target_ty} != {fru_ty}: {}::{}",
20322032 variant.name,
20332033 ident.name,
compiler/rustc_hir_typeck/src/method/confirm.rs+1-1
......@@ -550,7 +550,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
550550 // This has/will have errored in wfcheck, which we cannot depend on from here, as typeck on functions
551551 // may run before wfcheck if the function is used in const eval.
552552 self.dcx().span_delayed_bug(
553 cause.span(),
553 cause.span,
554554 format!("{self_ty} was a subtype of {method_self_ty} but now is not?"),
555555 );
556556 }
compiler/rustc_middle/src/traits/mod.rs+8-11
......@@ -92,16 +92,6 @@ impl<'tcx> ObligationCause<'tcx> {
9292 ObligationCause { span, body_id: CRATE_DEF_ID, code: Default::default() }
9393 }
9494
95 pub fn span(&self) -> Span {
96 match *self.code() {
97 ObligationCauseCode::MatchExpressionArm(box MatchExpressionArmCause {
98 arm_span,
99 ..
100 }) => arm_span,
101 _ => self.span,
102 }
103 }
104
10595 #[inline]
10696 pub fn code(&self) -> &ObligationCauseCode<'tcx> {
10797 &self.code
......@@ -517,10 +507,17 @@ pub struct MatchExpressionArmCause<'tcx> {
517507 pub prior_arm_block_id: Option<HirId>,
518508 pub prior_arm_ty: Ty<'tcx>,
519509 pub prior_arm_span: Span,
510 /// Span of the scrutinee of the match (the matched value).
520511 pub scrut_span: Span,
512 /// Source of the match, i.e. `match` or a desugaring.
521513 pub source: hir::MatchSource,
514 /// Span of the *whole* match expr.
515 pub expr_span: Span,
516 /// Spans of the previous arms except for those that diverge (i.e. evaluate to `!`).
517 ///
518 /// These are used for pointing out errors that may affect several arms.
522519 pub prior_non_diverging_arms: Vec<Span>,
523 // Is the expectation of this match expression an RPIT?
520 /// Is the expectation of this match expression an RPIT?
524521 pub tail_defines_return_position_impl_trait: Option<LocalDefId>,
525522}
526523
compiler/rustc_passes/messages.ftl+4
......@@ -622,6 +622,10 @@ passes_remove_fields =
622622passes_repr_align_function =
623623 `repr(align)` attributes on functions are unstable
624624
625passes_repr_align_greater_than_target_max =
626 alignment must not be greater than `isize::MAX` bytes
627 .note = `isize::MAX` is {$size} for the current target
628
625629passes_repr_conflicting =
626630 conflicting representation hints
627631
compiler/rustc_passes/src/check_attr.rs+43-1
......@@ -34,6 +34,7 @@ use rustc_session::lint::builtin::{
3434use rustc_session::parse::feature_err;
3535use rustc_span::symbol::{Symbol, kw, sym};
3636use rustc_span::{BytePos, DUMMY_SP, Span};
37use rustc_target::abi::Size;
3738use rustc_target::spec::abi::Abi;
3839use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
3940use rustc_trait_selection::infer::{TyCtxtInferExt, ValuePairs};
......@@ -1785,7 +1786,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
17851786 | Target::Union
17861787 | Target::Enum
17871788 | Target::Fn
1788 | Target::Method(_) => continue,
1789 | Target::Method(_) => {}
17891790 _ => {
17901791 self.dcx().emit_err(
17911792 errors::AttrApplication::StructEnumFunctionMethodUnion {
......@@ -1795,6 +1796,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
17951796 );
17961797 }
17971798 }
1799
1800 self.check_align_value(hint);
17981801 }
17991802 sym::packed => {
18001803 if target != Target::Struct && target != Target::Union {
......@@ -1892,6 +1895,45 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
18921895 }
18931896 }
18941897
1898 fn check_align_value(&self, item: &MetaItemInner) {
1899 match item.singleton_lit_list() {
1900 Some((
1901 _,
1902 MetaItemLit {
1903 kind: ast::LitKind::Int(literal, ast::LitIntType::Unsuffixed), ..
1904 },
1905 )) => {
1906 let val = literal.get() as u64;
1907 if val > 2_u64.pow(29) {
1908 // for values greater than 2^29, a different error will be emitted, make sure that happens
1909 self.dcx().span_delayed_bug(
1910 item.span(),
1911 "alignment greater than 2^29 should be errored on elsewhere",
1912 );
1913 } else {
1914 // only do this check when <= 2^29 to prevent duplicate errors:
1915 // alignment greater than 2^29 not supported
1916 // alignment is too large for the current target
1917
1918 let max =
1919 Size::from_bits(self.tcx.sess.target.pointer_width).signed_int_max() as u64;
1920 if val > max {
1921 self.dcx().emit_err(errors::InvalidReprAlignForTarget {
1922 span: item.span(),
1923 size: max,
1924 });
1925 }
1926 }
1927 }
1928
1929 // if the attribute is malformed, singleton_lit_list may not be of the expected type or may be None
1930 // but an error will have already been emitted, so this code should just skip such attributes
1931 Some((_, _)) | None => {
1932 self.dcx().span_delayed_bug(item.span(), "malformed repr(align(N))");
1933 }
1934 }
1935 }
1936
18951937 fn check_used(&self, attrs: &[Attribute], target: Target, target_span: Span) {
18961938 let mut used_linker_span = None;
18971939 let mut used_compiler_span = None;
compiler/rustc_passes/src/errors.rs+9
......@@ -567,6 +567,15 @@ pub(crate) struct ReprConflicting {
567567 pub hint_spans: Vec<Span>,
568568}
569569
570#[derive(Diagnostic)]
571#[diag(passes_repr_align_greater_than_target_max, code = E0589)]
572#[note]
573pub(crate) struct InvalidReprAlignForTarget {
574 #[primary_span]
575 pub span: Span,
576 pub size: u64,
577}
578
570579#[derive(LintDiagnostic)]
571580#[diag(passes_repr_conflicting, code = E0566)]
572581pub(crate) struct ReprConflictingLint;
compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs+9-8
......@@ -392,7 +392,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
392392 Some(ty) if expected == ty => {
393393 let source_map = self.tcx.sess.source_map();
394394 err.span_suggestion(
395 source_map.end_point(cause.span()),
395 source_map.end_point(cause.span),
396396 "try removing this `?`",
397397 "",
398398 Applicability::MachineApplicable,
......@@ -412,6 +412,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
412412 source,
413413 ref prior_non_diverging_arms,
414414 scrut_span,
415 expr_span,
415416 ..
416417 }) => match source {
417418 hir::MatchSource::TryDesugar(scrut_hir_id) => {
......@@ -430,7 +431,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
430431 Some(ty) if expected == ty => {
431432 let source_map = self.tcx.sess.source_map();
432433 err.span_suggestion(
433 source_map.end_point(cause.span()),
434 source_map.end_point(cause.span),
434435 "try removing this `?`",
435436 "",
436437 Applicability::MachineApplicable,
......@@ -460,12 +461,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
460461 format!("this and all prior arms are found to be of type `{t}`"),
461462 );
462463 }
463 let outer = if any_multiline_arm || !source_map.is_multiline(cause.span) {
464 let outer = if any_multiline_arm || !source_map.is_multiline(expr_span) {
464465 // Cover just `match` and the scrutinee expression, not
465466 // the entire match body, to reduce diagram noise.
466 cause.span.shrink_to_lo().to(scrut_span)
467 expr_span.shrink_to_lo().to(scrut_span)
467468 } else {
468 cause.span
469 expr_span
469470 };
470471 let msg = "`match` arms have incompatible types";
471472 err.span_label(outer, msg);
......@@ -1148,7 +1149,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
11481149 terr: TypeError<'tcx>,
11491150 prefer_label: bool,
11501151 ) {
1151 let span = cause.span();
1152 let span = cause.span;
11521153
11531154 // For some types of errors, expected-found does not make
11541155 // sense, so just ignore the values we were given.
......@@ -1642,7 +1643,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
16421643 terr: TypeError<'tcx>,
16431644 ) -> Vec<TypeErrorAdditionalDiags> {
16441645 let mut suggestions = Vec::new();
1645 let span = trace.cause.span();
1646 let span = trace.cause.span;
16461647 let values = self.resolve_vars_if_possible(trace.values);
16471648 if let Some((expected, found)) = values.ty() {
16481649 match (expected.kind(), found.kind()) {
......@@ -1792,7 +1793,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
17921793 ) -> Diag<'a> {
17931794 debug!("report_and_explain_type_error(trace={:?}, terr={:?})", trace, terr);
17941795
1795 let span = trace.cause.span();
1796 let span = trace.cause.span;
17961797 let failure_code = trace.cause.as_failure_code_diag(
17971798 terr,
17981799 span,
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/placeholder_error.rs+1-1
......@@ -237,7 +237,7 @@ impl<'tcx> NiceRegionError<'_, 'tcx> {
237237 expected_args: GenericArgsRef<'tcx>,
238238 actual_args: GenericArgsRef<'tcx>,
239239 ) -> Diag<'tcx> {
240 let span = cause.span();
240 let span = cause.span;
241241
242242 let (leading_ellipsis, satisfy_span, where_span, dup_span, def_id) =
243243 if let ObligationCauseCode::WhereClause(def_id, span)
compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs+23-5
......@@ -1835,6 +1835,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
18351835 if impl_trait_ref.references_error() {
18361836 return false;
18371837 }
1838 let self_ty = impl_trait_ref.self_ty().to_string();
18381839 err.highlighted_help(vec![
18391840 StringPart::normal(format!(
18401841 "the trait `{}` ",
......@@ -1842,16 +1843,24 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
18421843 )),
18431844 StringPart::highlighted("is"),
18441845 StringPart::normal(" implemented for `"),
1845 StringPart::highlighted(impl_trait_ref.self_ty().to_string()),
1846 if let [TypeError::Sorts(_)] = &terrs[..] {
1847 StringPart::normal(self_ty)
1848 } else {
1849 StringPart::highlighted(self_ty)
1850 },
18461851 StringPart::normal("`"),
18471852 ]);
18481853
18491854 if let [TypeError::Sorts(exp_found)] = &terrs[..] {
18501855 let exp_found = self.resolve_vars_if_possible(*exp_found);
1851 err.help(format!(
1852 "for that trait implementation, expected `{}`, found `{}`",
1853 exp_found.expected, exp_found.found
1854 ));
1856 err.highlighted_help(vec![
1857 StringPart::normal("for that trait implementation, "),
1858 StringPart::normal("expected `"),
1859 StringPart::highlighted(exp_found.expected.to_string()),
1860 StringPart::normal("`, found `"),
1861 StringPart::highlighted(exp_found.found.to_string()),
1862 StringPart::normal("`"),
1863 ]);
18551864 }
18561865
18571866 true
......@@ -2160,6 +2169,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
21602169 // First, attempt to add note to this error with an async-await-specific
21612170 // message, and fall back to regular note otherwise.
21622171 if !self.maybe_note_obligation_cause_for_async_await(err, obligation) {
2172 let mut long_ty_file = None;
21632173 self.note_obligation_cause_code(
21642174 obligation.cause.body_id,
21652175 err,
......@@ -2168,7 +2178,15 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
21682178 obligation.cause.code(),
21692179 &mut vec![],
21702180 &mut Default::default(),
2181 &mut long_ty_file,
21712182 );
2183 if let Some(file) = long_ty_file {
2184 err.note(format!(
2185 "the full name for the type has been written to '{}'",
2186 file.display(),
2187 ));
2188 err.note("consider using `--verbose` to print the full type name to the console");
2189 }
21722190 self.suggest_unsized_bound_if_applicable(err, obligation);
21732191 if let Some(span) = err.span.primary_span()
21742192 && let Some(mut diag) =
compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs+11
......@@ -305,6 +305,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
305305 if let ObligationCauseCode::WhereClause(..)
306306 | ObligationCauseCode::WhereClauseInExpr(..) = code
307307 {
308 let mut long_ty_file = None;
308309 self.note_obligation_cause_code(
309310 error.obligation.cause.body_id,
310311 &mut diag,
......@@ -313,7 +314,17 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
313314 code,
314315 &mut vec![],
315316 &mut Default::default(),
317 &mut long_ty_file,
316318 );
319 if let Some(file) = long_ty_file {
320 diag.note(format!(
321 "the full name for the type has been written to '{}'",
322 file.display(),
323 ));
324 diag.note(
325 "consider using `--verbose` to print the full type name to the console",
326 );
327 }
317328 }
318329 diag.emit()
319330 }
compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs+11
......@@ -144,6 +144,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
144144 obligation.cause.span,
145145 suggest_increasing_limit,
146146 |err| {
147 let mut long_ty_file = None;
147148 self.note_obligation_cause_code(
148149 obligation.cause.body_id,
149150 err,
......@@ -152,7 +153,17 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
152153 obligation.cause.code(),
153154 &mut vec![],
154155 &mut Default::default(),
156 &mut long_ty_file,
155157 );
158 if let Some(file) = long_ty_file {
159 err.note(format!(
160 "the full name for the type has been written to '{}'",
161 file.display(),
162 ));
163 err.note(
164 "consider using `--verbose` to print the full type name to the console",
165 );
166 }
156167 },
157168 );
158169 }
compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs+18-20
......@@ -3,6 +3,7 @@
33use std::assert_matches::debug_assert_matches;
44use std::borrow::Cow;
55use std::iter;
6use std::path::PathBuf;
67
78use itertools::{EitherOrBoth, Itertools};
89use rustc_data_structures::fx::FxHashSet;
......@@ -2703,6 +2704,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
27032704 // Add a note for the item obligation that remains - normally a note pointing to the
27042705 // bound that introduced the obligation (e.g. `T: Send`).
27052706 debug!(?next_code);
2707 let mut long_ty_file = None;
27062708 self.note_obligation_cause_code(
27072709 obligation.cause.body_id,
27082710 err,
......@@ -2711,6 +2713,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
27112713 next_code.unwrap(),
27122714 &mut Vec::new(),
27132715 &mut Default::default(),
2716 &mut long_ty_file,
27142717 );
27152718 }
27162719
......@@ -2723,11 +2726,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
27232726 cause_code: &ObligationCauseCode<'tcx>,
27242727 obligated_types: &mut Vec<Ty<'tcx>>,
27252728 seen_requirements: &mut FxHashSet<DefId>,
2729 long_ty_file: &mut Option<PathBuf>,
27262730 ) where
27272731 T: Upcast<TyCtxt<'tcx>, ty::Predicate<'tcx>>,
27282732 {
2729 let mut long_ty_file = None;
2730
27312733 let tcx = self.tcx;
27322734 let predicate = predicate.upcast(tcx);
27332735 let suggest_remove_deref = |err: &mut Diag<'_, G>, expr: &hir::Expr<'_>| {
......@@ -2957,9 +2959,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
29572959 }
29582960 ObligationCauseCode::Coercion { source, target } => {
29592961 let source =
2960 tcx.short_ty_string(self.resolve_vars_if_possible(source), &mut long_ty_file);
2962 tcx.short_ty_string(self.resolve_vars_if_possible(source), long_ty_file);
29612963 let target =
2962 tcx.short_ty_string(self.resolve_vars_if_possible(target), &mut long_ty_file);
2964 tcx.short_ty_string(self.resolve_vars_if_possible(target), long_ty_file);
29632965 err.note(with_forced_trimmed_paths!(format!(
29642966 "required for the cast from `{source}` to `{target}`",
29652967 )));
......@@ -3249,7 +3251,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
32493251 };
32503252
32513253 if !is_upvar_tys_infer_tuple {
3252 let ty_str = tcx.short_ty_string(ty, &mut long_ty_file);
3254 let ty_str = tcx.short_ty_string(ty, long_ty_file);
32533255 let msg = format!("required because it appears within the type `{ty_str}`");
32543256 match ty.kind() {
32553257 ty::Adt(def, _) => match tcx.opt_item_ident(def.did()) {
......@@ -3327,6 +3329,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
33273329 &data.parent_code,
33283330 obligated_types,
33293331 seen_requirements,
3332 long_ty_file,
33303333 )
33313334 });
33323335 } else {
......@@ -3339,6 +3342,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
33393342 cause_code.peel_derives(),
33403343 obligated_types,
33413344 seen_requirements,
3345 long_ty_file,
33423346 )
33433347 });
33443348 }
......@@ -3347,8 +3351,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
33473351 let mut parent_trait_pred =
33483352 self.resolve_vars_if_possible(data.derived.parent_trait_pred);
33493353 let parent_def_id = parent_trait_pred.def_id();
3350 let self_ty_str = tcx
3351 .short_ty_string(parent_trait_pred.skip_binder().self_ty(), &mut long_ty_file);
3354 let self_ty_str =
3355 tcx.short_ty_string(parent_trait_pred.skip_binder().self_ty(), long_ty_file);
33523356 let trait_name = parent_trait_pred.print_modifiers_and_trait_path().to_string();
33533357 let msg = format!("required for `{self_ty_str}` to implement `{trait_name}`");
33543358 let mut is_auto_trait = false;
......@@ -3444,10 +3448,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
34443448 count,
34453449 pluralize!(count)
34463450 ));
3447 let self_ty = tcx.short_ty_string(
3448 parent_trait_pred.skip_binder().self_ty(),
3449 &mut long_ty_file,
3450 );
3451 let self_ty = tcx
3452 .short_ty_string(parent_trait_pred.skip_binder().self_ty(), long_ty_file);
34513453 err.note(format!(
34523454 "required for `{self_ty}` to implement `{}`",
34533455 parent_trait_pred.print_modifiers_and_trait_path()
......@@ -3463,6 +3465,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
34633465 &data.parent_code,
34643466 obligated_types,
34653467 seen_requirements,
3468 long_ty_file,
34663469 )
34673470 });
34683471 }
......@@ -3479,6 +3482,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
34793482 &data.parent_code,
34803483 obligated_types,
34813484 seen_requirements,
3485 long_ty_file,
34823486 )
34833487 });
34843488 }
......@@ -3493,6 +3497,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
34933497 nested,
34943498 obligated_types,
34953499 seen_requirements,
3500 long_ty_file,
34963501 )
34973502 });
34983503 let mut multispan = MultiSpan::from(span);
......@@ -3523,6 +3528,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
35233528 parent_code,
35243529 obligated_types,
35253530 seen_requirements,
3531 long_ty_file,
35263532 )
35273533 });
35283534 }
......@@ -3562,7 +3568,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
35623568 }
35633569 ObligationCauseCode::OpaqueReturnType(expr_info) => {
35643570 if let Some((expr_ty, hir_id)) = expr_info {
3565 let expr_ty = self.tcx.short_ty_string(expr_ty, &mut long_ty_file);
3571 let expr_ty = self.tcx.short_ty_string(expr_ty, long_ty_file);
35663572 let expr = self.infcx.tcx.hir().expect_expr(hir_id);
35673573 err.span_label(
35683574 expr.span,
......@@ -3574,14 +3580,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
35743580 }
35753581 }
35763582 }
3577
3578 if let Some(file) = long_ty_file {
3579 err.note(format!(
3580 "the full name for the type has been written to '{}'",
3581 file.display(),
3582 ));
3583 err.note("consider using `--verbose` to print the full type name to the console");
3584 }
35853583 }
35863584
35873585 #[instrument(
compiler/rustc_trait_selection/src/traits/project.rs+2-2
......@@ -1180,7 +1180,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>(
11801180 selcx.tcx(),
11811181 selcx.tcx().require_lang_item(
11821182 LangItem::Sized,
1183 Some(obligation.cause.span()),
1183 Some(obligation.cause.span),
11841184 ),
11851185 [self_ty],
11861186 ),
......@@ -1600,7 +1600,7 @@ fn confirm_builtin_candidate<'cx, 'tcx>(
16001600 // exist. Instead, `Pointee<Metadata = ()>` should be a supertrait of `Sized`.
16011601 let sized_predicate = ty::TraitRef::new(
16021602 tcx,
1603 tcx.require_lang_item(LangItem::Sized, Some(obligation.cause.span())),
1603 tcx.require_lang_item(LangItem::Sized, Some(obligation.cause.span)),
16041604 [self_ty],
16051605 );
16061606 obligations.push(obligation.with(tcx, sized_predicate));
compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs+1-1
......@@ -90,7 +90,7 @@ impl<'tcx> InferCtxt<'tcx> {
9090 assert!(!self.intercrate);
9191 let c_pred =
9292 self.canonicalize_query(param_env.and(obligation.predicate), &mut _orig_values);
93 self.tcx.at(obligation.cause.span()).evaluate_obligation(c_pred)
93 self.tcx.at(obligation.cause.span).evaluate_obligation(c_pred)
9494 }
9595 }
9696
library/core/src/char/methods.rs+2-1
......@@ -320,8 +320,9 @@ impl char {
320320 /// '1'.is_digit(37);
321321 /// ```
322322 #[stable(feature = "rust1", since = "1.0.0")]
323 #[rustc_const_unstable(feature = "const_char_is_digit", issue = "132241")]
323324 #[inline]
324 pub fn is_digit(self, radix: u32) -> bool {
325 pub const fn is_digit(self, radix: u32) -> bool {
325326 self.to_digit(radix).is_some()
326327 }
327328
src/tools/compiletest/src/runtest/run_make.rs+1
......@@ -329,6 +329,7 @@ impl TestCx<'_> {
329329 .arg(format!("run_make_support={}", &support_lib_path.to_string_lossy()))
330330 .arg("--edition=2021")
331331 .arg(&self.testpaths.file.join("rmake.rs"))
332 .arg("-Cprefer-dynamic")
332333 // Provide necessary library search paths for rustc.
333334 .env(dylib_env_var(), &env::join_paths(host_dylib_search_paths).unwrap());
334335
src/tools/run-make-support/Cargo.toml+3
......@@ -13,3 +13,6 @@ gimli = "0.31.0"
1313build_helper = { path = "../build_helper" }
1414serde_json = "1.0"
1515libc = "0.2"
16
17[lib]
18crate-type = ["lib", "dylib"]
tests/rustdoc-gui/fields.goml+40-9
......@@ -1,13 +1,36 @@
1// This test checks that fields are displayed as expected (one by line).
2go-to: "file://" + |DOC_PATH| + "/test_docs/fields/struct.Struct.html"
3store-position: ("#structfield\.a", {"y": a_y})
4store-position: ("#structfield\.b", {"y": b_y})
5assert: |a_y| < |b_y|
1// This test checks that fields are displayed as expected (one by line) and they are surrounded
2// by margins.
63
7go-to: "file://" + |DOC_PATH| + "/test_docs/fields/union.Union.html"
8store-position: ("#structfield\.a", {"y": a_y})
9store-position: ("#structfield\.b", {"y": b_y})
10assert: |a_y| < |b_y|
4define-function: (
5 "check-fields",
6 [path, selector_1, selector_2],
7 block {
8 go-to: "file://" + |DOC_PATH| + "/test_docs/fields/" + |path|
9 store-position: (|selector_1|, {"y": a_y})
10 store-position: (|selector_2|, {"y": b_y})
11 assert: |a_y| < |b_y|
12
13 // Check the margins.
14 assert-css: (".structfield.section-header", {
15 "margin-top": "9.6px",
16 "margin-bottom": "9.6px",
17 "margin-left": "0px",
18 "margin-right": "0px",
19 }, ALL)
20 }
21)
22
23call-function: ("check-fields", {
24 "path": "struct.Struct.html",
25 "selector_1": "#structfield\.a",
26 "selector_2": "#structfield\.b",
27})
28
29call-function: ("check-fields", {
30 "path": "union.Union.html",
31 "selector_1": "#structfield\.a",
32 "selector_2": "#structfield\.b",
33})
1134
1235go-to: "file://" + |DOC_PATH| + "/test_docs/fields/enum.Enum.html"
1336store-position: ("#variant\.A\.field\.a", {"y": a_y})
......@@ -16,3 +39,11 @@ assert: |a_y| < |b_y|
1639store-position: ("#variant\.B\.field\.a", {"y": a_y})
1740store-position: ("#variant\.B\.field\.b", {"y": b_y})
1841assert: |a_y| < |b_y|
42
43// Check the margins.
44assert-css: (".sub-variant-field .section-header", {
45 "margin-top": "0px",
46 "margin-bottom": "0px",
47 "margin-left": "0px",
48 "margin-right": "0px",
49}, ALL)
tests/rustdoc-gui/struct-fields.goml+2-1
......@@ -1,4 +1,5 @@
1// This test ensures that each field is on its own line (In other words, they have display: block).
1// This test ensures that each field is on its own line (In other words, they have
2// `display: block`).
23go-to: "file://" + |DOC_PATH| + "/test_docs/struct.StructWithPublicUndocumentedFields.html"
34
45store-property: ("//*[@id='structfield.first']", {"offsetTop": first_top})
tests/ui/consts/const-block-const-bound.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/const-block-const-bound.rs:8:22
2 --> $DIR/const-block-const-bound.rs:8:15
33 |
44LL | const fn f<T: ~const Destruct>(x: T) {}
5 | ^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/const-block-const-bound.rs:8:22
8 --> $DIR/const-block-const-bound.rs:8:15
99 |
1010LL | const fn f<T: ~const Destruct>(x: T) {}
11 | ^^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/consts/fn_trait_refs.stderr+46-46
......@@ -11,168 +11,168 @@ LL | #![feature(const_cmp)]
1111 | ^^^^^^^^^
1212
1313error: `~const` can only be applied to `#[const_trait]` traits
14 --> $DIR/fn_trait_refs.rs:13:15
14 --> $DIR/fn_trait_refs.rs:13:8
1515 |
1616LL | T: ~const Fn<()> + ~const Destruct,
17 | ^^^^^^
17 | ^^^^^^
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/fn_trait_refs.rs:13:31
20 --> $DIR/fn_trait_refs.rs:13:24
2121 |
2222LL | T: ~const Fn<()> + ~const Destruct,
23 | ^^^^^^^^
23 | ^^^^^^
2424
2525error: `~const` can only be applied to `#[const_trait]` traits
26 --> $DIR/fn_trait_refs.rs:13:15
26 --> $DIR/fn_trait_refs.rs:13:8
2727 |
2828LL | T: ~const Fn<()> + ~const Destruct,
29 | ^^^^^^
29 | ^^^^^^
3030 |
3131 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3232
3333error: `~const` can only be applied to `#[const_trait]` traits
34 --> $DIR/fn_trait_refs.rs:13:15
34 --> $DIR/fn_trait_refs.rs:13:8
3535 |
3636LL | T: ~const Fn<()> + ~const Destruct,
37 | ^^^^^^
37 | ^^^^^^
3838 |
3939 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4040
4141error: `~const` can only be applied to `#[const_trait]` traits
42 --> $DIR/fn_trait_refs.rs:13:31
42 --> $DIR/fn_trait_refs.rs:13:24
4343 |
4444LL | T: ~const Fn<()> + ~const Destruct,
45 | ^^^^^^^^
45 | ^^^^^^
4646 |
4747 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4848
4949error: `~const` can only be applied to `#[const_trait]` traits
50 --> $DIR/fn_trait_refs.rs:20:15
50 --> $DIR/fn_trait_refs.rs:20:8
5151 |
5252LL | T: ~const FnMut<()> + ~const Destruct,
53 | ^^^^^^^^^
53 | ^^^^^^
5454
5555error: `~const` can only be applied to `#[const_trait]` traits
56 --> $DIR/fn_trait_refs.rs:20:34
56 --> $DIR/fn_trait_refs.rs:20:27
5757 |
5858LL | T: ~const FnMut<()> + ~const Destruct,
59 | ^^^^^^^^
59 | ^^^^^^
6060
6161error: `~const` can only be applied to `#[const_trait]` traits
62 --> $DIR/fn_trait_refs.rs:20:15
62 --> $DIR/fn_trait_refs.rs:20:8
6363 |
6464LL | T: ~const FnMut<()> + ~const Destruct,
65 | ^^^^^^^^^
65 | ^^^^^^
6666 |
6767 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
6868
6969error: `~const` can only be applied to `#[const_trait]` traits
70 --> $DIR/fn_trait_refs.rs:20:15
70 --> $DIR/fn_trait_refs.rs:20:8
7171 |
7272LL | T: ~const FnMut<()> + ~const Destruct,
73 | ^^^^^^^^^
73 | ^^^^^^
7474 |
7575 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
7676
7777error: `~const` can only be applied to `#[const_trait]` traits
78 --> $DIR/fn_trait_refs.rs:20:34
78 --> $DIR/fn_trait_refs.rs:20:27
7979 |
8080LL | T: ~const FnMut<()> + ~const Destruct,
81 | ^^^^^^^^
81 | ^^^^^^
8282 |
8383 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
8484
8585error: `~const` can only be applied to `#[const_trait]` traits
86 --> $DIR/fn_trait_refs.rs:27:15
86 --> $DIR/fn_trait_refs.rs:27:8
8787 |
8888LL | T: ~const FnOnce<()>,
89 | ^^^^^^^^^^
89 | ^^^^^^
9090
9191error: `~const` can only be applied to `#[const_trait]` traits
92 --> $DIR/fn_trait_refs.rs:27:15
92 --> $DIR/fn_trait_refs.rs:27:8
9393 |
9494LL | T: ~const FnOnce<()>,
95 | ^^^^^^^^^^
95 | ^^^^^^
9696 |
9797 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
9898
9999error: `~const` can only be applied to `#[const_trait]` traits
100 --> $DIR/fn_trait_refs.rs:27:15
100 --> $DIR/fn_trait_refs.rs:27:8
101101 |
102102LL | T: ~const FnOnce<()>,
103 | ^^^^^^^^^^
103 | ^^^^^^
104104 |
105105 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
106106
107107error: `~const` can only be applied to `#[const_trait]` traits
108 --> $DIR/fn_trait_refs.rs:34:15
108 --> $DIR/fn_trait_refs.rs:34:8
109109 |
110110LL | T: ~const Fn<()> + ~const Destruct,
111 | ^^^^^^
111 | ^^^^^^
112112
113113error: `~const` can only be applied to `#[const_trait]` traits
114 --> $DIR/fn_trait_refs.rs:34:31
114 --> $DIR/fn_trait_refs.rs:34:24
115115 |
116116LL | T: ~const Fn<()> + ~const Destruct,
117 | ^^^^^^^^
117 | ^^^^^^
118118
119119error: `~const` can only be applied to `#[const_trait]` traits
120 --> $DIR/fn_trait_refs.rs:34:15
120 --> $DIR/fn_trait_refs.rs:34:8
121121 |
122122LL | T: ~const Fn<()> + ~const Destruct,
123 | ^^^^^^
123 | ^^^^^^
124124 |
125125 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
126126
127127error: `~const` can only be applied to `#[const_trait]` traits
128 --> $DIR/fn_trait_refs.rs:34:15
128 --> $DIR/fn_trait_refs.rs:34:8
129129 |
130130LL | T: ~const Fn<()> + ~const Destruct,
131 | ^^^^^^
131 | ^^^^^^
132132 |
133133 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
134134
135135error: `~const` can only be applied to `#[const_trait]` traits
136 --> $DIR/fn_trait_refs.rs:34:31
136 --> $DIR/fn_trait_refs.rs:34:24
137137 |
138138LL | T: ~const Fn<()> + ~const Destruct,
139 | ^^^^^^^^
139 | ^^^^^^
140140 |
141141 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
142142
143143error: `~const` can only be applied to `#[const_trait]` traits
144 --> $DIR/fn_trait_refs.rs:48:15
144 --> $DIR/fn_trait_refs.rs:48:8
145145 |
146146LL | T: ~const FnMut<()> + ~const Destruct,
147 | ^^^^^^^^^
147 | ^^^^^^
148148
149149error: `~const` can only be applied to `#[const_trait]` traits
150 --> $DIR/fn_trait_refs.rs:48:34
150 --> $DIR/fn_trait_refs.rs:48:27
151151 |
152152LL | T: ~const FnMut<()> + ~const Destruct,
153 | ^^^^^^^^
153 | ^^^^^^
154154
155155error: `~const` can only be applied to `#[const_trait]` traits
156 --> $DIR/fn_trait_refs.rs:48:15
156 --> $DIR/fn_trait_refs.rs:48:8
157157 |
158158LL | T: ~const FnMut<()> + ~const Destruct,
159 | ^^^^^^^^^
159 | ^^^^^^
160160 |
161161 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
162162
163163error: `~const` can only be applied to `#[const_trait]` traits
164 --> $DIR/fn_trait_refs.rs:48:15
164 --> $DIR/fn_trait_refs.rs:48:8
165165 |
166166LL | T: ~const FnMut<()> + ~const Destruct,
167 | ^^^^^^^^^
167 | ^^^^^^
168168 |
169169 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
170170
171171error: `~const` can only be applied to `#[const_trait]` traits
172 --> $DIR/fn_trait_refs.rs:48:34
172 --> $DIR/fn_trait_refs.rs:48:27
173173 |
174174LL | T: ~const FnMut<()> + ~const Destruct,
175 | ^^^^^^^^
175 | ^^^^^^
176176 |
177177 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
178178
tests/ui/consts/unstable-const-fn-in-libcore.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/unstable-const-fn-in-libcore.rs:19:39
2 --> $DIR/unstable-const-fn-in-libcore.rs:19:32
33 |
44LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
5 | ^^^^^^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/unstable-const-fn-in-libcore.rs:19:39
8 --> $DIR/unstable-const-fn-in-libcore.rs:19:32
99 |
1010LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T {
11 | ^^^^^^^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/impl-trait/diagnostics/highlight-difference-between-expected-trait-and-found-trait.rs created+20
......@@ -0,0 +1,20 @@
1//@ only-linux
2//@ compile-flags: --error-format=human --color=always
3//@ error-pattern: the trait bound
4
5trait Foo<T>: Bar<T> {}
6
7trait Bar<T> {}
8
9struct Struct;
10
11impl<T, K> Foo<K> for T where T: Bar<K>
12{}
13
14impl<'a> Bar<()> for Struct {}
15
16fn foo() -> impl Foo<i32> {
17 Struct
18}
19
20fn main() {}
tests/ui/impl-trait/diagnostics/highlight-difference-between-expected-trait-and-found-trait.svg created+62
......@@ -0,0 +1,62 @@
1<svg width="1104px" height="344px" xmlns="http://www.w3.org/2000/svg">
2 <style>
3 .fg { fill: #AAAAAA }
4 .bg { background: #000000 }
5 .fg-ansi256-009 { fill: #FF5555 }
6 .fg-ansi256-010 { fill: #55FF55 }
7 .fg-ansi256-012 { fill: #5555FF }
8 .fg-magenta { fill: #AA00AA }
9 .container {
10 padding: 0 10px;
11 line-height: 18px;
12 }
13 .bold { font-weight: bold; }
14 tspan {
15 font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
16 white-space: pre;
17 line-height: 18px;
18 }
19 </style>
20
21 <rect width="100%" height="100%" y="0" rx="4.5" class="bg" />
22
23 <text xml:space="preserve" class="container fg">
24 <tspan x="10px" y="28px"><tspan class="fg-ansi256-009 bold">error[E0277]</tspan><tspan class="bold">: the trait bound `Struct: Foo&lt;i32&gt;` is not satisfied</tspan>
25</tspan>
26 <tspan x="10px" y="46px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--&gt; </tspan><tspan>$DIR/highlight-difference-between-expected-trait-and-found-trait.rs:16:13</tspan>
27</tspan>
28 <tspan x="10px" y="64px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
29</tspan>
30 <tspan x="10px" y="82px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> fn foo() -&gt; impl Foo&lt;i32&gt; {</tspan>
31</tspan>
32 <tspan x="10px" y="100px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">^^^^^^^^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-009 bold">the trait `Bar&lt;i32&gt;` is not implemented for `Struct`, which is required by `Struct: Foo&lt;i32&gt;`</tspan>
33</tspan>
34 <tspan x="10px" y="118px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
35</tspan>
36 <tspan x="10px" y="136px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">help</tspan><tspan>: the trait `Bar&lt;()&gt;` </tspan><tspan class="fg-magenta bold">is</tspan><tspan> implemented for `Struct`</tspan>
37</tspan>
38 <tspan x="10px" y="154px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">= </tspan><tspan class="bold">help</tspan><tspan>: for that trait implementation, expected `</tspan><tspan class="fg-magenta bold">()</tspan><tspan>`, found `</tspan><tspan class="fg-magenta bold">i32</tspan><tspan>`</tspan>
39</tspan>
40 <tspan x="10px" y="172px"><tspan class="fg-ansi256-010 bold">note</tspan><tspan>: required for `Struct` to implement `Foo&lt;i32&gt;`</tspan>
41</tspan>
42 <tspan x="10px" y="190px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--&gt; </tspan><tspan>$DIR/highlight-difference-between-expected-trait-and-found-trait.rs:11:12</tspan>
43</tspan>
44 <tspan x="10px" y="208px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan>
45</tspan>
46 <tspan x="10px" y="226px"><tspan class="fg-ansi256-012 bold">LL</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> impl&lt;T, K&gt; Foo&lt;K&gt; for T where T: Bar&lt;K&gt;</tspan>
47</tspan>
48 <tspan x="10px" y="244px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">|</tspan><tspan> </tspan><tspan class="fg-ansi256-010 bold">^^^^^^</tspan><tspan> </tspan><tspan class="fg-ansi256-010 bold">^</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">------</tspan><tspan> </tspan><tspan class="fg-ansi256-012 bold">unsatisfied trait bound introduced here</tspan>
49</tspan>
50 <tspan x="10px" y="262px">
51</tspan>
52 <tspan x="10px" y="280px"><tspan class="fg-ansi256-009 bold">error</tspan><tspan class="bold">: aborting due to 1 previous error</tspan>
53</tspan>
54 <tspan x="10px" y="298px">
55</tspan>
56 <tspan x="10px" y="316px"><tspan class="bold">For more information about this error, try `rustc --explain E0277`.</tspan>
57</tspan>
58 <tspan x="10px" y="334px">
59</tspan>
60 </text>
61
62</svg>
tests/ui/impl-trait/normalize-tait-in-const.stderr+8-8
......@@ -1,28 +1,28 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/normalize-tait-in-const.rs:26:42
2 --> $DIR/normalize-tait-in-const.rs:26:35
33 |
44LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
5 | ^^^^^^^^^^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/normalize-tait-in-const.rs:26:69
8 --> $DIR/normalize-tait-in-const.rs:26:62
99 |
1010LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
11 | ^^^^^^^^
11 | ^^^^^^
1212
1313error: `~const` can only be applied to `#[const_trait]` traits
14 --> $DIR/normalize-tait-in-const.rs:26:42
14 --> $DIR/normalize-tait-in-const.rs:26:35
1515 |
1616LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
17 | ^^^^^^^^^^^^^^^^^
17 | ^^^^^^
1818 |
1919 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2020
2121error: `~const` can only be applied to `#[const_trait]` traits
22 --> $DIR/normalize-tait-in-const.rs:26:69
22 --> $DIR/normalize-tait-in-const.rs:26:62
2323 |
2424LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) {
25 | ^^^^^^^^
25 | ^^^^^^
2626 |
2727 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2828
tests/ui/repr/repr_align_greater_usize.msp430.stderr created+19
......@@ -0,0 +1,19 @@
1error[E0589]: alignment must not be greater than `isize::MAX` bytes
2 --> $DIR/repr_align_greater_usize.rs:21:8
3 |
4LL | #[repr(align(32768))]
5 | ^^^^^^^^^^^^
6 |
7 = note: `isize::MAX` is 32767 for the current target
8
9error[E0589]: alignment must not be greater than `isize::MAX` bytes
10 --> $DIR/repr_align_greater_usize.rs:24:8
11 |
12LL | #[repr(align(65536))]
13 | ^^^^^^^^^^^^
14 |
15 = note: `isize::MAX` is 32767 for the current target
16
17error: aborting due to 2 previous errors
18
19For more information about this error, try `rustc --explain E0589`.
tests/ui/repr/repr_align_greater_usize.rs created+25
......@@ -0,0 +1,25 @@
1//@ revisions: msp430 aarch32
2//@[msp430] needs-llvm-components: msp430
3//@[msp430] compile-flags: --target=msp430-none-elf
4//@[aarch32] build-pass
5//@[aarch32] needs-llvm-components: arm
6//@[aarch32] compile-flags: --target=thumbv7m-none-eabi
7
8// We should fail to compute alignment for types aligned higher than usize::MAX.
9// We can't handle alignments that require all 32 bits, so this only affects 16-bit.
10
11#![feature(lang_items, no_core)]
12#![no_core]
13#![crate_type = "lib"]
14
15#[lang = "sized"]
16trait Sized {}
17
18#[repr(align(16384))]
19struct Kitten;
20
21#[repr(align(32768))] //[msp430]~ ERROR alignment must not be greater than `isize::MAX`
22struct Cat;
23
24#[repr(align(65536))] //[msp430]~ ERROR alignment must not be greater than `isize::MAX`
25struct BigCat;
tests/ui/specialization/const_trait_impl.stderr+12-12
......@@ -1,42 +1,42 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/const_trait_impl.rs:34:16
2 --> $DIR/const_trait_impl.rs:34:9
33 |
44LL | impl<T: ~const Default> const A for T {
5 | ^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/const_trait_impl.rs:40:16
8 --> $DIR/const_trait_impl.rs:40:9
99 |
1010LL | impl<T: ~const Default + ~const Sup> const A for T {
11 | ^^^^^^^
11 | ^^^^^^
1212
1313error: `~const` can only be applied to `#[const_trait]` traits
14 --> $DIR/const_trait_impl.rs:46:16
14 --> $DIR/const_trait_impl.rs:46:9
1515 |
1616LL | impl<T: ~const Default + ~const Sub> const A for T {
17 | ^^^^^^^
17 | ^^^^^^
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/const_trait_impl.rs:40:16
20 --> $DIR/const_trait_impl.rs:40:9
2121 |
2222LL | impl<T: ~const Default + ~const Sup> const A for T {
23 | ^^^^^^^
23 | ^^^^^^
2424 |
2525 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2626
2727error: `~const` can only be applied to `#[const_trait]` traits
28 --> $DIR/const_trait_impl.rs:34:16
28 --> $DIR/const_trait_impl.rs:34:9
2929 |
3030LL | impl<T: ~const Default> const A for T {
31 | ^^^^^^^
31 | ^^^^^^
3232 |
3333 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3434
3535error: `~const` can only be applied to `#[const_trait]` traits
36 --> $DIR/const_trait_impl.rs:46:16
36 --> $DIR/const_trait_impl.rs:46:9
3737 |
3838LL | impl<T: ~const Default + ~const Sub> const A for T {
39 | ^^^^^^^
39 | ^^^^^^
4040 |
4141 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4242
tests/ui/traits/const-traits/assoc-type.stderr+1-1
......@@ -17,7 +17,7 @@ note: required by a bound in `Foo::Bar`
1717 --> $DIR/assoc-type.rs:32:15
1818 |
1919LL | type Bar: ~const Add;
20 | ^^^^^^^^^^ required by this bound in `Foo::Bar`
20 | ^^^^^^ required by this bound in `Foo::Bar`
2121
2222error: aborting due to 1 previous error; 1 warning emitted
2323
tests/ui/traits/const-traits/call-generic-in-impl.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/call-generic-in-impl.rs:10:16
2 --> $DIR/call-generic-in-impl.rs:10:9
33 |
44LL | impl<T: ~const PartialEq> const MyPartialEq for T {
5 | ^^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/call-generic-in-impl.rs:10:16
8 --> $DIR/call-generic-in-impl.rs:10:9
99 |
1010LL | impl<T: ~const PartialEq> const MyPartialEq for T {
11 | ^^^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/traits/const-traits/call-generic-method-chain.stderr+8-8
......@@ -17,30 +17,30 @@ LL | impl const PartialEq for S {
1717 = note: adding a non-const method body in the future would be a breaking change
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/call-generic-method-chain.rs:20:32
20 --> $DIR/call-generic-method-chain.rs:20:25
2121 |
2222LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
23 | ^^^^^^^^^
23 | ^^^^^^
2424
2525error: `~const` can only be applied to `#[const_trait]` traits
26 --> $DIR/call-generic-method-chain.rs:20:32
26 --> $DIR/call-generic-method-chain.rs:20:25
2727 |
2828LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
29 | ^^^^^^^^^
29 | ^^^^^^
3030 |
3131 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3232
3333error: `~const` can only be applied to `#[const_trait]` traits
34 --> $DIR/call-generic-method-chain.rs:24:40
34 --> $DIR/call-generic-method-chain.rs:24:33
3535 |
3636LL | const fn equals_self_wrapper<T: ~const PartialEq>(t: &T) -> bool {
37 | ^^^^^^^^^
37 | ^^^^^^
3838
3939error: `~const` can only be applied to `#[const_trait]` traits
40 --> $DIR/call-generic-method-chain.rs:24:40
40 --> $DIR/call-generic-method-chain.rs:24:33
4141 |
4242LL | const fn equals_self_wrapper<T: ~const PartialEq>(t: &T) -> bool {
43 | ^^^^^^^^^
43 | ^^^^^^
4444 |
4545 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4646
tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr+8-8
......@@ -17,30 +17,30 @@ LL | impl const PartialEq for S {
1717 = note: adding a non-const method body in the future would be a breaking change
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/call-generic-method-dup-bound.rs:20:44
20 --> $DIR/call-generic-method-dup-bound.rs:20:37
2121 |
2222LL | const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool {
23 | ^^^^^^^^^
23 | ^^^^^^
2424
2525error: `~const` can only be applied to `#[const_trait]` traits
26 --> $DIR/call-generic-method-dup-bound.rs:20:44
26 --> $DIR/call-generic-method-dup-bound.rs:20:37
2727 |
2828LL | const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool {
29 | ^^^^^^^^^
29 | ^^^^^^
3030 |
3131 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3232
3333error: `~const` can only be applied to `#[const_trait]` traits
34 --> $DIR/call-generic-method-dup-bound.rs:27:37
34 --> $DIR/call-generic-method-dup-bound.rs:27:30
3535 |
3636LL | const fn equals_self2<T: A + ~const PartialEq>(t: &T) -> bool {
37 | ^^^^^^^^^
37 | ^^^^^^
3838
3939error: `~const` can only be applied to `#[const_trait]` traits
40 --> $DIR/call-generic-method-dup-bound.rs:27:37
40 --> $DIR/call-generic-method-dup-bound.rs:27:30
4141 |
4242LL | const fn equals_self2<T: A + ~const PartialEq>(t: &T) -> bool {
43 | ^^^^^^^^^
43 | ^^^^^^
4444 |
4545 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4646
tests/ui/traits/const-traits/call-generic-method-pass.stderr+4-4
......@@ -17,16 +17,16 @@ LL | impl const PartialEq for S {
1717 = note: adding a non-const method body in the future would be a breaking change
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/call-generic-method-pass.rs:20:32
20 --> $DIR/call-generic-method-pass.rs:20:25
2121 |
2222LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
23 | ^^^^^^^^^
23 | ^^^^^^
2424
2525error: `~const` can only be applied to `#[const_trait]` traits
26 --> $DIR/call-generic-method-pass.rs:20:32
26 --> $DIR/call-generic-method-pass.rs:20:25
2727 |
2828LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool {
29 | ^^^^^^^^^
29 | ^^^^^^
3030 |
3131 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3232
tests/ui/traits/const-traits/const-bounds-non-const-trait.stderr+6-6
......@@ -13,24 +13,24 @@ error: using `#![feature(effects)]` without enabling next trait solver globally
1313 = help: use `-Znext-solver` to enable
1414
1515error: `~const` can only be applied to `#[const_trait]` traits
16 --> $DIR/const-bounds-non-const-trait.rs:6:28
16 --> $DIR/const-bounds-non-const-trait.rs:6:21
1717 |
1818LL | const fn perform<T: ~const NonConst>() {}
19 | ^^^^^^^^
19 | ^^^^^^
2020
2121error: `~const` can only be applied to `#[const_trait]` traits
22 --> $DIR/const-bounds-non-const-trait.rs:6:28
22 --> $DIR/const-bounds-non-const-trait.rs:6:21
2323 |
2424LL | const fn perform<T: ~const NonConst>() {}
25 | ^^^^^^^^
25 | ^^^^^^
2626 |
2727 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2828
2929error: `const` can only be applied to `#[const_trait]` traits
30 --> $DIR/const-bounds-non-const-trait.rs:10:21
30 --> $DIR/const-bounds-non-const-trait.rs:10:15
3131 |
3232LL | fn operate<T: const NonConst>() {}
33 | ^^^^^^^^
33 | ^^^^^
3434
3535error: aborting due to 4 previous errors; 1 warning emitted
3636
tests/ui/traits/const-traits/const-closure-parse-not-item.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/const-closure-parse-not-item.rs:7:32
2 --> $DIR/const-closure-parse-not-item.rs:7:25
33 |
44LL | const fn test() -> impl ~const Fn() {
5 | ^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/const-closure-parse-not-item.rs:7:32
8 --> $DIR/const-closure-parse-not-item.rs:7:25
99 |
1010LL | const fn test() -> impl ~const Fn() {
11 | ^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/const-closure-trait-method-fail.rs:14:39
2 --> $DIR/const-closure-trait-method-fail.rs:14:32
33 |
44LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 {
5 | ^^^^^^^^^^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/const-closure-trait-method-fail.rs:14:39
8 --> $DIR/const-closure-trait-method-fail.rs:14:32
99 |
1010LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 {
11 | ^^^^^^^^^^^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/traits/const-traits/const-closure-trait-method.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/const-closure-trait-method.rs:14:39
2 --> $DIR/const-closure-trait-method.rs:14:32
33 |
44LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 {
5 | ^^^^^^^^^^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/const-closure-trait-method.rs:14:39
8 --> $DIR/const-closure-trait-method.rs:14:32
99 |
1010LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 {
11 | ^^^^^^^^^^^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/traits/const-traits/const-closures.stderr+16-16
......@@ -1,56 +1,56 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/const-closures.rs:8:19
2 --> $DIR/const-closures.rs:8:12
33 |
44LL | F: ~const FnOnce() -> u8,
5 | ^^^^^^^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/const-closures.rs:9:19
8 --> $DIR/const-closures.rs:9:12
99 |
1010LL | F: ~const FnMut() -> u8,
11 | ^^^^^^^^^^^^^
11 | ^^^^^^
1212
1313error: `~const` can only be applied to `#[const_trait]` traits
14 --> $DIR/const-closures.rs:10:19
14 --> $DIR/const-closures.rs:10:12
1515 |
1616LL | F: ~const Fn() -> u8,
17 | ^^^^^^^^^^
17 | ^^^^^^
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/const-closures.rs:8:19
20 --> $DIR/const-closures.rs:8:12
2121 |
2222LL | F: ~const FnOnce() -> u8,
23 | ^^^^^^^^^^^^^^
23 | ^^^^^^
2424 |
2525 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2626
2727error: `~const` can only be applied to `#[const_trait]` traits
28 --> $DIR/const-closures.rs:9:19
28 --> $DIR/const-closures.rs:9:12
2929 |
3030LL | F: ~const FnMut() -> u8,
31 | ^^^^^^^^^^^^^
31 | ^^^^^^
3232 |
3333 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3434
3535error: `~const` can only be applied to `#[const_trait]` traits
36 --> $DIR/const-closures.rs:10:19
36 --> $DIR/const-closures.rs:10:12
3737 |
3838LL | F: ~const Fn() -> u8,
39 | ^^^^^^^^^^
39 | ^^^^^^
4040 |
4141 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4242
4343error: `~const` can only be applied to `#[const_trait]` traits
44 --> $DIR/const-closures.rs:23:27
44 --> $DIR/const-closures.rs:23:20
4545 |
4646LL | const fn answer<F: ~const Fn() -> u8>(f: &F) -> u8 {
47 | ^^^^^^^^^^
47 | ^^^^^^
4848
4949error: `~const` can only be applied to `#[const_trait]` traits
50 --> $DIR/const-closures.rs:23:27
50 --> $DIR/const-closures.rs:23:20
5151 |
5252LL | const fn answer<F: ~const Fn() -> u8>(f: &F) -> u8 {
53 | ^^^^^^^^^^
53 | ^^^^^^
5454 |
5555 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
5656
tests/ui/traits/const-traits/const-drop-bound.stderr+12-12
......@@ -1,42 +1,42 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/const-drop-bound.rs:9:68
2 --> $DIR/const-drop-bound.rs:9:61
33 |
44LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct {
5 | ^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/const-drop-bound.rs:9:68
8 --> $DIR/const-drop-bound.rs:9:61
99 |
1010LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct {
11 | ^^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
1515error: `~const` can only be applied to `#[const_trait]` traits
16 --> $DIR/const-drop-bound.rs:20:15
16 --> $DIR/const-drop-bound.rs:20:8
1717 |
1818LL | T: ~const Destruct,
19 | ^^^^^^^^
19 | ^^^^^^
2020
2121error: `~const` can only be applied to `#[const_trait]` traits
22 --> $DIR/const-drop-bound.rs:21:15
22 --> $DIR/const-drop-bound.rs:21:8
2323 |
2424LL | E: ~const Destruct,
25 | ^^^^^^^^
25 | ^^^^^^
2626
2727error: `~const` can only be applied to `#[const_trait]` traits
28 --> $DIR/const-drop-bound.rs:20:15
28 --> $DIR/const-drop-bound.rs:20:8
2929 |
3030LL | T: ~const Destruct,
31 | ^^^^^^^^
31 | ^^^^^^
3232 |
3333 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3434
3535error: `~const` can only be applied to `#[const_trait]` traits
36 --> $DIR/const-drop-bound.rs:21:15
36 --> $DIR/const-drop-bound.rs:21:8
3737 |
3838LL | E: ~const Destruct,
39 | ^^^^^^^^
39 | ^^^^^^
4040 |
4141 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4242
tests/ui/traits/const-traits/const-drop-fail-2.stderr+4-4
......@@ -8,16 +8,16 @@ LL | impl<T: ~const A> const Drop for ConstDropImplWithNonConstBounds<T> {
88 = note: adding a non-const method body in the future would be a breaking change
99
1010error: `~const` can only be applied to `#[const_trait]` traits
11 --> $DIR/const-drop-fail-2.rs:20:26
11 --> $DIR/const-drop-fail-2.rs:20:19
1212 |
1313LL | const fn check<T: ~const Destruct>(_: T) {}
14 | ^^^^^^^^
14 | ^^^^^^
1515
1616error: `~const` can only be applied to `#[const_trait]` traits
17 --> $DIR/const-drop-fail-2.rs:20:26
17 --> $DIR/const-drop-fail-2.rs:20:19
1818 |
1919LL | const fn check<T: ~const Destruct>(_: T) {}
20 | ^^^^^^^^
20 | ^^^^^^
2121 |
2222 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2323
tests/ui/traits/const-traits/const-drop-fail.precise.stderr+4-4
......@@ -8,16 +8,16 @@ LL | impl const Drop for ConstImplWithDropGlue {
88 = note: adding a non-const method body in the future would be a breaking change
99
1010error: `~const` can only be applied to `#[const_trait]` traits
11 --> $DIR/const-drop-fail.rs:23:26
11 --> $DIR/const-drop-fail.rs:23:19
1212 |
1313LL | const fn check<T: ~const Destruct>(_: T) {}
14 | ^^^^^^^^
14 | ^^^^^^
1515
1616error: `~const` can only be applied to `#[const_trait]` traits
17 --> $DIR/const-drop-fail.rs:23:26
17 --> $DIR/const-drop-fail.rs:23:19
1818 |
1919LL | const fn check<T: ~const Destruct>(_: T) {}
20 | ^^^^^^^^
20 | ^^^^^^
2121 |
2222 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2323
tests/ui/traits/const-traits/const-drop-fail.stock.stderr+4-4
......@@ -8,16 +8,16 @@ LL | impl const Drop for ConstImplWithDropGlue {
88 = note: adding a non-const method body in the future would be a breaking change
99
1010error: `~const` can only be applied to `#[const_trait]` traits
11 --> $DIR/const-drop-fail.rs:23:26
11 --> $DIR/const-drop-fail.rs:23:19
1212 |
1313LL | const fn check<T: ~const Destruct>(_: T) {}
14 | ^^^^^^^^
14 | ^^^^^^
1515
1616error: `~const` can only be applied to `#[const_trait]` traits
17 --> $DIR/const-drop-fail.rs:23:26
17 --> $DIR/const-drop-fail.rs:23:19
1818 |
1919LL | const fn check<T: ~const Destruct>(_: T) {}
20 | ^^^^^^^^
20 | ^^^^^^
2121 |
2222 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2323
tests/ui/traits/const-traits/const-drop.precise.stderr+4-4
......@@ -35,16 +35,16 @@ LL | impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> {
3535 = note: adding a non-const method body in the future would be a breaking change
3636
3737error: `~const` can only be applied to `#[const_trait]` traits
38 --> $DIR/const-drop.rs:18:22
38 --> $DIR/const-drop.rs:18:15
3939 |
4040LL | const fn a<T: ~const Destruct>(_: T) {}
41 | ^^^^^^^^
41 | ^^^^^^
4242
4343error: `~const` can only be applied to `#[const_trait]` traits
44 --> $DIR/const-drop.rs:18:22
44 --> $DIR/const-drop.rs:18:15
4545 |
4646LL | const fn a<T: ~const Destruct>(_: T) {}
47 | ^^^^^^^^
47 | ^^^^^^
4848 |
4949 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
5050
tests/ui/traits/const-traits/const-drop.stock.stderr+4-4
......@@ -35,16 +35,16 @@ LL | impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> {
3535 = note: adding a non-const method body in the future would be a breaking change
3636
3737error: `~const` can only be applied to `#[const_trait]` traits
38 --> $DIR/const-drop.rs:18:22
38 --> $DIR/const-drop.rs:18:15
3939 |
4040LL | const fn a<T: ~const Destruct>(_: T) {}
41 | ^^^^^^^^
41 | ^^^^^^
4242
4343error: `~const` can only be applied to `#[const_trait]` traits
44 --> $DIR/const-drop.rs:18:22
44 --> $DIR/const-drop.rs:18:15
4545 |
4646LL | const fn a<T: ~const Destruct>(_: T) {}
47 | ^^^^^^^^
47 | ^^^^^^
4848 |
4949 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
5050
tests/ui/traits/const-traits/const_derives/derive-const-with-params.stderr-6
......@@ -23,12 +23,6 @@ LL | #[derive_const(PartialEq)]
2323 = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
2424
2525error: `~const` can only be applied to `#[const_trait]` traits
26 --> $DIR/derive-const-with-params.rs:7:16
27 |
28LL | #[derive_const(PartialEq)]
29 | ^^^^^^^^^
30 |
31 = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
3226
3327error[E0015]: cannot call non-const operator in constant functions
3428 --> $DIR/derive-const-with-params.rs:8:23
tests/ui/traits/const-traits/effects/ice-112822-expected-type-for-param.stderr+4-4
......@@ -23,16 +23,16 @@ error: using `#![feature(effects)]` without enabling next trait solver globally
2323 = help: use `-Znext-solver` to enable
2424
2525error: `~const` can only be applied to `#[const_trait]` traits
26 --> $DIR/ice-112822-expected-type-for-param.rs:3:32
26 --> $DIR/ice-112822-expected-type-for-param.rs:3:25
2727 |
2828LL | const fn test() -> impl ~const Fn() {
29 | ^^^^
29 | ^^^^^^
3030
3131error: `~const` can only be applied to `#[const_trait]` traits
32 --> $DIR/ice-112822-expected-type-for-param.rs:3:32
32 --> $DIR/ice-112822-expected-type-for-param.rs:3:25
3333 |
3434LL | const fn test() -> impl ~const Fn() {
35 | ^^^^
35 | ^^^^^^
3636 |
3737 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3838
tests/ui/traits/const-traits/effects/spec-effectvar-ice.stderr+2-2
......@@ -37,10 +37,10 @@ LL | impl<T> const Foo for T where T: const Specialize {}
3737 = note: adding a non-const method body in the future would be a breaking change
3838
3939error: `const` can only be applied to `#[const_trait]` traits
40 --> $DIR/spec-effectvar-ice.rs:14:40
40 --> $DIR/spec-effectvar-ice.rs:14:34
4141 |
4242LL | impl<T> const Foo for T where T: const Specialize {}
43 | ^^^^^^^^^^
43 | ^^^^^
4444
4545error: specialization impl does not specialize any associated items
4646 --> $DIR/spec-effectvar-ice.rs:14:1
tests/ui/traits/const-traits/ice-123664-unexpected-bound-var.stderr+4-4
......@@ -4,16 +4,16 @@ error: using `#![feature(effects)]` without enabling next trait solver globally
44 = help: use `-Znext-solver` to enable
55
66error: `~const` can only be applied to `#[const_trait]` traits
7 --> $DIR/ice-123664-unexpected-bound-var.rs:4:34
7 --> $DIR/ice-123664-unexpected-bound-var.rs:4:27
88 |
99LL | const fn with_positive<F: ~const Fn()>() {}
10 | ^^^^
10 | ^^^^^^
1111
1212error: `~const` can only be applied to `#[const_trait]` traits
13 --> $DIR/ice-123664-unexpected-bound-var.rs:4:34
13 --> $DIR/ice-123664-unexpected-bound-var.rs:4:27
1414 |
1515LL | const fn with_positive<F: ~const Fn()>() {}
16 | ^^^^
16 | ^^^^^^
1717 |
1818 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1919
tests/ui/traits/const-traits/issue-92111.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/issue-92111.rs:20:22
2 --> $DIR/issue-92111.rs:20:15
33 |
44LL | const fn a<T: ~const Destruct>(t: T) {}
5 | ^^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/issue-92111.rs:20:22
8 --> $DIR/issue-92111.rs:20:15
99 |
1010LL | const fn a<T: ~const Destruct>(t: T) {}
11 | ^^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/traits/const-traits/item-bound-entailment-fails.stderr+2-2
......@@ -17,7 +17,7 @@ note: required by a bound in `Foo::Assoc`
1717 --> $DIR/item-bound-entailment-fails.rs:6:20
1818 |
1919LL | type Assoc<T>: ~const Bar
20 | ^^^^^^^^^^ required by this bound in `Foo::Assoc`
20 | ^^^^^^ required by this bound in `Foo::Assoc`
2121
2222error[E0277]: the trait bound `T: ~const Bar` is not satisfied
2323 --> $DIR/item-bound-entailment-fails.rs:25:21
......@@ -29,7 +29,7 @@ note: required by a bound in `Foo::Assoc`
2929 --> $DIR/item-bound-entailment-fails.rs:6:20
3030 |
3131LL | type Assoc<T>: ~const Bar
32 | ^^^^^^^^^^ required by this bound in `Foo::Assoc`
32 | ^^^^^^ required by this bound in `Foo::Assoc`
3333
3434error: aborting due to 2 previous errors; 1 warning emitted
3535
tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr+4-4
......@@ -1,14 +1,14 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/non-const-op-in-closure-in-const.rs:10:51
2 --> $DIR/non-const-op-in-closure-in-const.rs:10:44
33 |
44LL | impl<A, B> const Convert<B> for A where B: ~const From<A> {
5 | ^^^^^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/non-const-op-in-closure-in-const.rs:10:51
8 --> $DIR/non-const-op-in-closure-in-const.rs:10:44
99 |
1010LL | impl<A, B> const Convert<B> for A where B: ~const From<A> {
11 | ^^^^^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
tests/ui/traits/const-traits/predicate-entailment-fails.stderr+6-6
......@@ -14,7 +14,7 @@ LL | type Bar<T> where T: ~const Bar;
1414 | ----------- definition of `Bar` from trait
1515...
1616LL | type Bar<T> = () where T: const Bar;
17 | ^^^^^^^^^ impl has extra requirement `T: const Bar`
17 | ^^^^^ impl has extra requirement `T: const Bar`
1818
1919error[E0276]: impl has stricter requirements than trait
2020 --> $DIR/predicate-entailment-fails.rs:18:26
......@@ -23,7 +23,7 @@ LL | fn foo<T>() where T: ~const Bar;
2323 | -------------------------------- definition of `foo` from trait
2424...
2525LL | fn foo<T>() where T: const Bar {}
26 | ^^^^^^^^^ impl has extra requirement `T: const Bar`
26 | ^^^^^ impl has extra requirement `T: const Bar`
2727
2828error[E0276]: impl has stricter requirements than trait
2929 --> $DIR/predicate-entailment-fails.rs:29:31
......@@ -32,7 +32,7 @@ LL | type Bar<T> where T: Bar;
3232 | ----------- definition of `Bar` from trait
3333...
3434LL | type Bar<T> = () where T: const Bar;
35 | ^^^^^^^^^ impl has extra requirement `T: const Bar`
35 | ^^^^^ impl has extra requirement `T: const Bar`
3636
3737error[E0276]: impl has stricter requirements than trait
3838 --> $DIR/predicate-entailment-fails.rs:32:26
......@@ -41,7 +41,7 @@ LL | fn foo<T>() where T: Bar;
4141 | ------------------------- definition of `foo` from trait
4242...
4343LL | fn foo<T>() where T: const Bar {}
44 | ^^^^^^^^^ impl has extra requirement `T: const Bar`
44 | ^^^^^ impl has extra requirement `T: const Bar`
4545
4646error[E0276]: impl has stricter requirements than trait
4747 --> $DIR/predicate-entailment-fails.rs:36:31
......@@ -50,7 +50,7 @@ LL | type Bar<T> where T: Bar;
5050 | ----------- definition of `Bar` from trait
5151...
5252LL | type Bar<T> = () where T: ~const Bar;
53 | ^^^^^^^^^^ impl has extra requirement `T: ~const Bar`
53 | ^^^^^^ impl has extra requirement `T: ~const Bar`
5454
5555error[E0276]: impl has stricter requirements than trait
5656 --> $DIR/predicate-entailment-fails.rs:39:26
......@@ -59,7 +59,7 @@ LL | fn foo<T>() where T: Bar;
5959 | ------------------------- definition of `foo` from trait
6060...
6161LL | fn foo<T>() where T: ~const Bar {}
62 | ^^^^^^^^^^ impl has extra requirement `T: ~const Bar`
62 | ^^^^^^ impl has extra requirement `T: ~const Bar`
6363
6464error: aborting due to 6 previous errors; 1 warning emitted
6565
tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr+6-6
......@@ -11,24 +11,24 @@ LL | trait Bar: ~const Foo {}
1111 | ^^^^^^^^^^^^^^^^^^^^^^^^
1212
1313error: `~const` can only be applied to `#[const_trait]` traits
14 --> $DIR/super-traits-fail-2.rs:12:19
14 --> $DIR/super-traits-fail-2.rs:12:12
1515 |
1616LL | trait Bar: ~const Foo {}
17 | ^^^
17 | ^^^^^^
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/super-traits-fail-2.rs:12:19
20 --> $DIR/super-traits-fail-2.rs:12:12
2121 |
2222LL | trait Bar: ~const Foo {}
23 | ^^^
23 | ^^^^^^
2424 |
2525 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2626
2727error: `~const` can only be applied to `#[const_trait]` traits
28 --> $DIR/super-traits-fail-2.rs:12:19
28 --> $DIR/super-traits-fail-2.rs:12:12
2929 |
3030LL | trait Bar: ~const Foo {}
31 | ^^^
31 | ^^^^^^
3232 |
3333 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3434
tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr+10-10
......@@ -1,38 +1,38 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/super-traits-fail-2.rs:12:19
2 --> $DIR/super-traits-fail-2.rs:12:12
33 |
44LL | trait Bar: ~const Foo {}
5 | ^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/super-traits-fail-2.rs:12:19
8 --> $DIR/super-traits-fail-2.rs:12:12
99 |
1010LL | trait Bar: ~const Foo {}
11 | ^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
1515error: `~const` can only be applied to `#[const_trait]` traits
16 --> $DIR/super-traits-fail-2.rs:12:19
16 --> $DIR/super-traits-fail-2.rs:12:12
1717 |
1818LL | trait Bar: ~const Foo {}
19 | ^^^
19 | ^^^^^^
2020 |
2121 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2222
2323error: `~const` can only be applied to `#[const_trait]` traits
24 --> $DIR/super-traits-fail-2.rs:12:19
24 --> $DIR/super-traits-fail-2.rs:12:12
2525 |
2626LL | trait Bar: ~const Foo {}
27 | ^^^
27 | ^^^^^^
2828 |
2929 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3030
3131error: `~const` can only be applied to `#[const_trait]` traits
32 --> $DIR/super-traits-fail-2.rs:12:19
32 --> $DIR/super-traits-fail-2.rs:12:12
3333 |
3434LL | trait Bar: ~const Foo {}
35 | ^^^
35 | ^^^^^^
3636 |
3737 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3838
tests/ui/traits/const-traits/super-traits-fail-3.nn.stderr+10-10
......@@ -11,38 +11,38 @@ LL | trait Bar: ~const Foo {}
1111 | ^^^^^^^^^^^^^^^^^^^^^^^^
1212
1313error: `~const` can only be applied to `#[const_trait]` traits
14 --> $DIR/super-traits-fail-3.rs:14:19
14 --> $DIR/super-traits-fail-3.rs:14:12
1515 |
1616LL | trait Bar: ~const Foo {}
17 | ^^^
17 | ^^^^^^
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/super-traits-fail-3.rs:14:19
20 --> $DIR/super-traits-fail-3.rs:14:12
2121 |
2222LL | trait Bar: ~const Foo {}
23 | ^^^
23 | ^^^^^^
2424 |
2525 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2626
2727error: `~const` can only be applied to `#[const_trait]` traits
28 --> $DIR/super-traits-fail-3.rs:14:19
28 --> $DIR/super-traits-fail-3.rs:14:12
2929 |
3030LL | trait Bar: ~const Foo {}
31 | ^^^
31 | ^^^^^^
3232 |
3333 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3434
3535error: `~const` can only be applied to `#[const_trait]` traits
36 --> $DIR/super-traits-fail-3.rs:22:24
36 --> $DIR/super-traits-fail-3.rs:22:17
3737 |
3838LL | const fn foo<T: ~const Bar>(x: &T) {
39 | ^^^
39 | ^^^^^^
4040
4141error: `~const` can only be applied to `#[const_trait]` traits
42 --> $DIR/super-traits-fail-3.rs:22:24
42 --> $DIR/super-traits-fail-3.rs:22:17
4343 |
4444LL | const fn foo<T: ~const Bar>(x: &T) {
45 | ^^^
45 | ^^^^^^
4646 |
4747 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
4848
tests/ui/traits/const-traits/super-traits-fail-3.ny.stderr+10-10
......@@ -1,38 +1,38 @@
11error: `~const` can only be applied to `#[const_trait]` traits
2 --> $DIR/super-traits-fail-3.rs:14:19
2 --> $DIR/super-traits-fail-3.rs:14:12
33 |
44LL | trait Bar: ~const Foo {}
5 | ^^^
5 | ^^^^^^
66
77error: `~const` can only be applied to `#[const_trait]` traits
8 --> $DIR/super-traits-fail-3.rs:14:19
8 --> $DIR/super-traits-fail-3.rs:14:12
99 |
1010LL | trait Bar: ~const Foo {}
11 | ^^^
11 | ^^^^^^
1212 |
1313 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
1414
1515error: `~const` can only be applied to `#[const_trait]` traits
16 --> $DIR/super-traits-fail-3.rs:14:19
16 --> $DIR/super-traits-fail-3.rs:14:12
1717 |
1818LL | trait Bar: ~const Foo {}
19 | ^^^
19 | ^^^^^^
2020 |
2121 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2222
2323error: `~const` can only be applied to `#[const_trait]` traits
24 --> $DIR/super-traits-fail-3.rs:14:19
24 --> $DIR/super-traits-fail-3.rs:14:12
2525 |
2626LL | trait Bar: ~const Foo {}
27 | ^^^
27 | ^^^^^^
2828 |
2929 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3030
3131error: `~const` can only be applied to `#[const_trait]` traits
32 --> $DIR/super-traits-fail-3.rs:14:19
32 --> $DIR/super-traits-fail-3.rs:14:12
3333 |
3434LL | trait Bar: ~const Foo {}
35 | ^^^
35 | ^^^^^^
3636 |
3737 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
3838
tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr+4-4
......@@ -11,16 +11,16 @@ LL | trait Bar: ~const Foo {}
1111 | ^^^^^^^^^^^^^^^^^^^^^^^^
1212
1313error: `~const` can only be applied to `#[const_trait]` traits
14 --> $DIR/super-traits-fail-3.rs:22:24
14 --> $DIR/super-traits-fail-3.rs:22:17
1515 |
1616LL | const fn foo<T: ~const Bar>(x: &T) {
17 | ^^^
17 | ^^^^^^
1818
1919error: `~const` can only be applied to `#[const_trait]` traits
20 --> $DIR/super-traits-fail-3.rs:22:24
20 --> $DIR/super-traits-fail-3.rs:22:17
2121 |
2222LL | const fn foo<T: ~const Bar>(x: &T) {
23 | ^^^
23 | ^^^^^^
2424 |
2525 = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2626
tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr+1-1
......@@ -28,7 +28,7 @@ note: required by a bound in `require`
2828 --> $DIR/unsatisfied-const-trait-bound.rs:8:15
2929 |
3030LL | fn require<T: const Trait>() {}
31 | ^^^^^^^^^^^ required by this bound in `require`
31 | ^^^^^ required by this bound in `require`
3232
3333error: aborting due to 4 previous errors
3434
tests/ui/wf/wf-dyn-incompat-trait-obj-match.rs+2-2
......@@ -22,8 +22,8 @@ fn main() {
2222 Some(()) => &S,
2323 None => &R, //~ ERROR E0308
2424 }
25 let t: &dyn Trait = match opt() { //~ ERROR E0038
25 let t: &dyn Trait = match opt() {
2626 Some(()) => &S, //~ ERROR E0038
27 None => &R,
27 None => &R, //~ ERROR E0038
2828 };
2929}
tests/ui/wf/wf-dyn-incompat-trait-obj-match.stderr+3-7
......@@ -31,14 +31,10 @@ LL | trait Trait: Sized {}
3131 = note: required for the cast from `&S` to `&dyn Trait`
3232
3333error[E0038]: the trait `Trait` cannot be made into an object
34 --> $DIR/wf-dyn-incompat-trait-obj-match.rs:25:25
34 --> $DIR/wf-dyn-incompat-trait-obj-match.rs:27:17
3535 |
36LL | let t: &dyn Trait = match opt() {
37 | _________________________^
38LL | | Some(()) => &S,
39LL | | None => &R,
40LL | | };
41 | |_____^ `Trait` cannot be made into an object
36LL | None => &R,
37 | ^^ `Trait` cannot be made into an object
4238 |
4339note: for a trait to be "dyn-compatible" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
4440 --> $DIR/wf-dyn-incompat-trait-obj-match.rs:6:14