| author | bors <bors@rust-lang.org> 2024-10-28 07:14:11 UTC |
| committer | bors <bors@rust-lang.org> 2024-10-28 07:14:11 UTC |
| log | 66701c42263042f7120385725606edeb987ad4f1 |
| tree | 96dfa9e60522906eb23e41080cc1d6b54f6ed896 |
| parent | 6929a48275547ef2aae72b85b5b5d8e4acbb5067 |
| parent | 3e3feac7c3c6e3561b7a452e3764810f2edd1c33 |
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: rollup66 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>( |
| 611 | 611 | Err(terr) => { |
| 612 | 612 | let mut diag = struct_span_code_err!( |
| 613 | 613 | tcx.dcx(), |
| 614 | cause.span(), | |
| 614 | cause.span, | |
| 615 | 615 | E0053, |
| 616 | 616 | "method `{}` has an incompatible return type for trait", |
| 617 | 617 | trait_m.name |
| ... | ... | @@ -1169,7 +1169,7 @@ fn extract_spans_for_error_reporting<'tcx>( |
| 1169 | 1169 | TypeError::ArgumentMutability(i) | TypeError::ArgumentSorts(ExpectedFound { .. }, i) => { |
| 1170 | 1170 | (impl_args.nth(i).unwrap(), trait_args.and_then(|mut args| args.nth(i))) |
| 1171 | 1171 | } |
| 1172 | _ => (cause.span(), tcx.hir().span_if_local(trait_m.def_id)), | |
| 1172 | _ => (cause.span, tcx.hir().span_if_local(trait_m.def_id)), | |
| 1173 | 1173 | } |
| 1174 | 1174 | } |
| 1175 | 1175 |
compiler/rustc_hir_analysis/src/check/mod.rs+1-1| ... | ... | @@ -612,7 +612,7 @@ pub fn check_function_signature<'tcx>( |
| 612 | 612 | match err { |
| 613 | 613 | TypeError::ArgumentMutability(i) |
| 614 | 614 | | TypeError::ArgumentSorts(ExpectedFound { .. }, i) => args.nth(i).unwrap(), |
| 615 | _ => cause.span(), | |
| 615 | _ => cause.span, | |
| 616 | 616 | } |
| 617 | 617 | } |
| 618 | 618 |
compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs-7| ... | ... | @@ -168,13 +168,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 168 | 168 | match hir_bound { |
| 169 | 169 | hir::GenericBound::Trait(poly_trait_ref) => { |
| 170 | 170 | 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 | }; | |
| 178 | 171 | let polarity = match polarity { |
| 179 | 172 | rustc_ast::BoundPolarity::Positive => ty::PredicatePolarity::Positive, |
| 180 | 173 | 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> + '_ { |
| 50 | 50 | } = self.lower_poly_trait_ref( |
| 51 | 51 | &trait_bound.trait_ref, |
| 52 | 52 | trait_bound.span, |
| 53 | None, | |
| 53 | hir::BoundConstness::Never, | |
| 54 | 54 | ty::PredicatePolarity::Positive, |
| 55 | 55 | dummy_self, |
| 56 | 56 | &mut bounds, |
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs+8-8| ... | ... | @@ -658,7 +658,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 658 | 658 | &self, |
| 659 | 659 | trait_ref: &hir::TraitRef<'tcx>, |
| 660 | 660 | span: Span, |
| 661 | constness: Option<ty::BoundConstness>, | |
| 661 | constness: hir::BoundConstness, | |
| 662 | 662 | polarity: ty::PredicatePolarity, |
| 663 | 663 | self_ty: Ty<'tcx>, |
| 664 | 664 | bounds: &mut Bounds<'tcx>, |
| ... | ... | @@ -681,11 +681,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 681 | 681 | Some(self_ty), |
| 682 | 682 | ); |
| 683 | 683 | |
| 684 | if let Some(constness) = constness | |
| 684 | if let hir::BoundConstness::Always(span) | hir::BoundConstness::Maybe(span) = constness | |
| 685 | 685 | && !self.tcx().is_const_trait(trait_def_id) |
| 686 | 686 | { |
| 687 | 687 | self.dcx().emit_err(crate::errors::ConstBoundForNonConstTrait { |
| 688 | span: trait_ref.path.span, | |
| 688 | span, | |
| 689 | 689 | modifier: constness.as_str(), |
| 690 | 690 | }); |
| 691 | 691 | } |
| ... | ... | @@ -708,7 +708,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 708 | 708 | bounds.push_trait_bound(tcx, poly_trait_ref, span, polarity); |
| 709 | 709 | |
| 710 | 710 | match constness { |
| 711 | Some(ty::BoundConstness::Const) => { | |
| 711 | hir::BoundConstness::Always(span) => { | |
| 712 | 712 | if polarity == ty::PredicatePolarity::Positive { |
| 713 | 713 | bounds.push_const_bound( |
| 714 | 714 | tcx, |
| ... | ... | @@ -718,13 +718,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 718 | 718 | ); |
| 719 | 719 | } |
| 720 | 720 | } |
| 721 | Some(ty::BoundConstness::ConstIfConst) => { | |
| 721 | hir::BoundConstness::Maybe(_) => { | |
| 722 | 722 | // We don't emit a const bound here, since that would mean that we |
| 723 | 723 | // unconditionally need to prove a `HostEffect` predicate, even when |
| 724 | 724 | // the predicates are being instantiated in a non-const context. This |
| 725 | 725 | // is instead handled in the `const_conditions` query. |
| 726 | 726 | } |
| 727 | None => {} | |
| 727 | hir::BoundConstness::Never => {} | |
| 728 | 728 | } |
| 729 | 729 | } |
| 730 | 730 | // On the flip side, when filtering `ConstIfConst` bounds, we only need to convert |
| ... | ... | @@ -734,12 +734,12 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 734 | 734 | // here because we only call this on self bounds, and deal with the recursive case |
| 735 | 735 | // in `lower_assoc_item_constraint`. |
| 736 | 736 | PredicateFilter::ConstIfConst | PredicateFilter::SelfConstIfConst => match constness { |
| 737 | Some(ty::BoundConstness::ConstIfConst) => { | |
| 737 | hir::BoundConstness::Maybe(span) => { | |
| 738 | 738 | if polarity == ty::PredicatePolarity::Positive { |
| 739 | 739 | bounds.push_const_bound(tcx, poly_trait_ref, ty::HostPolarity::Maybe, span); |
| 740 | 740 | } |
| 741 | 741 | } |
| 742 | None | Some(ty::BoundConstness::Const) => {} | |
| 742 | hir::BoundConstness::Always(_) | hir::BoundConstness::Never => {} | |
| 743 | 743 | }, |
| 744 | 744 | } |
| 745 | 745 |
compiler/rustc_hir_typeck/src/_match.rs+7-9| ... | ... | @@ -94,14 +94,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 94 | 94 | (None, arm.body.span) |
| 95 | 95 | }; |
| 96 | 96 | |
| 97 | let (span, code) = match prior_arm { | |
| 97 | let code = match prior_arm { | |
| 98 | 98 | // The reason for the first arm to fail is not that the match arms diverge, |
| 99 | 99 | // 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)) => { | |
| 105 | 102 | ObligationCauseCode::MatchExpressionArm(Box::new(MatchExpressionArmCause { |
| 106 | 103 | arm_block_id, |
| 107 | 104 | arm_span, |
| ... | ... | @@ -110,13 +107,14 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 110 | 107 | prior_arm_ty, |
| 111 | 108 | prior_arm_span, |
| 112 | 109 | scrut_span: scrut.span, |
| 110 | expr_span: expr.span, | |
| 113 | 111 | source: match_src, |
| 114 | 112 | prior_non_diverging_arms: prior_non_diverging_arms.clone(), |
| 115 | 113 | tail_defines_return_position_impl_trait, |
| 116 | })), | |
| 117 | ), | |
| 114 | })) | |
| 115 | } | |
| 118 | 116 | }; |
| 119 | let cause = self.cause(span, code); | |
| 117 | let cause = self.cause(arm_span, code); | |
| 120 | 118 | |
| 121 | 119 | // This is the moral equivalent of `coercion.coerce(self, cause, arm.body, arm_ty)`. |
| 122 | 120 | // 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> { |
| 2027 | 2027 | } |
| 2028 | 2028 | Err(_) => { |
| 2029 | 2029 | span_bug!( |
| 2030 | cause.span(), | |
| 2030 | cause.span, | |
| 2031 | 2031 | "subtyping remaining fields of type changing FRU failed: {target_ty} != {fru_ty}: {}::{}", |
| 2032 | 2032 | variant.name, |
| 2033 | 2033 | ident.name, |
compiler/rustc_hir_typeck/src/method/confirm.rs+1-1| ... | ... | @@ -550,7 +550,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> { |
| 550 | 550 | // This has/will have errored in wfcheck, which we cannot depend on from here, as typeck on functions |
| 551 | 551 | // may run before wfcheck if the function is used in const eval. |
| 552 | 552 | self.dcx().span_delayed_bug( |
| 553 | cause.span(), | |
| 553 | cause.span, | |
| 554 | 554 | format!("{self_ty} was a subtype of {method_self_ty} but now is not?"), |
| 555 | 555 | ); |
| 556 | 556 | } |
compiler/rustc_middle/src/traits/mod.rs+8-11| ... | ... | @@ -92,16 +92,6 @@ impl<'tcx> ObligationCause<'tcx> { |
| 92 | 92 | ObligationCause { span, body_id: CRATE_DEF_ID, code: Default::default() } |
| 93 | 93 | } |
| 94 | 94 | |
| 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 | ||
| 105 | 95 | #[inline] |
| 106 | 96 | pub fn code(&self) -> &ObligationCauseCode<'tcx> { |
| 107 | 97 | &self.code |
| ... | ... | @@ -517,10 +507,17 @@ pub struct MatchExpressionArmCause<'tcx> { |
| 517 | 507 | pub prior_arm_block_id: Option<HirId>, |
| 518 | 508 | pub prior_arm_ty: Ty<'tcx>, |
| 519 | 509 | pub prior_arm_span: Span, |
| 510 | /// Span of the scrutinee of the match (the matched value). | |
| 520 | 511 | pub scrut_span: Span, |
| 512 | /// Source of the match, i.e. `match` or a desugaring. | |
| 521 | 513 | 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. | |
| 522 | 519 | 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? | |
| 524 | 521 | pub tail_defines_return_position_impl_trait: Option<LocalDefId>, |
| 525 | 522 | } |
| 526 | 523 |
compiler/rustc_passes/messages.ftl+4| ... | ... | @@ -622,6 +622,10 @@ passes_remove_fields = |
| 622 | 622 | passes_repr_align_function = |
| 623 | 623 | `repr(align)` attributes on functions are unstable |
| 624 | 624 | |
| 625 | passes_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 | ||
| 625 | 629 | passes_repr_conflicting = |
| 626 | 630 | conflicting representation hints |
| 627 | 631 |
compiler/rustc_passes/src/check_attr.rs+43-1| ... | ... | @@ -34,6 +34,7 @@ use rustc_session::lint::builtin::{ |
| 34 | 34 | use rustc_session::parse::feature_err; |
| 35 | 35 | use rustc_span::symbol::{Symbol, kw, sym}; |
| 36 | 36 | use rustc_span::{BytePos, DUMMY_SP, Span}; |
| 37 | use rustc_target::abi::Size; | |
| 37 | 38 | use rustc_target::spec::abi::Abi; |
| 38 | 39 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 39 | 40 | use rustc_trait_selection::infer::{TyCtxtInferExt, ValuePairs}; |
| ... | ... | @@ -1785,7 +1786,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 1785 | 1786 | | Target::Union |
| 1786 | 1787 | | Target::Enum |
| 1787 | 1788 | | Target::Fn |
| 1788 | | Target::Method(_) => continue, | |
| 1789 | | Target::Method(_) => {} | |
| 1789 | 1790 | _ => { |
| 1790 | 1791 | self.dcx().emit_err( |
| 1791 | 1792 | errors::AttrApplication::StructEnumFunctionMethodUnion { |
| ... | ... | @@ -1795,6 +1796,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 1795 | 1796 | ); |
| 1796 | 1797 | } |
| 1797 | 1798 | } |
| 1799 | ||
| 1800 | self.check_align_value(hint); | |
| 1798 | 1801 | } |
| 1799 | 1802 | sym::packed => { |
| 1800 | 1803 | if target != Target::Struct && target != Target::Union { |
| ... | ... | @@ -1892,6 +1895,45 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 1892 | 1895 | } |
| 1893 | 1896 | } |
| 1894 | 1897 | |
| 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 | ||
| 1895 | 1937 | fn check_used(&self, attrs: &[Attribute], target: Target, target_span: Span) { |
| 1896 | 1938 | let mut used_linker_span = None; |
| 1897 | 1939 | let mut used_compiler_span = None; |
compiler/rustc_passes/src/errors.rs+9| ... | ... | @@ -567,6 +567,15 @@ pub(crate) struct ReprConflicting { |
| 567 | 567 | pub hint_spans: Vec<Span>, |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | #[derive(Diagnostic)] | |
| 571 | #[diag(passes_repr_align_greater_than_target_max, code = E0589)] | |
| 572 | #[note] | |
| 573 | pub(crate) struct InvalidReprAlignForTarget { | |
| 574 | #[primary_span] | |
| 575 | pub span: Span, | |
| 576 | pub size: u64, | |
| 577 | } | |
| 578 | ||
| 570 | 579 | #[derive(LintDiagnostic)] |
| 571 | 580 | #[diag(passes_repr_conflicting, code = E0566)] |
| 572 | 581 | pub(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> { |
| 392 | 392 | Some(ty) if expected == ty => { |
| 393 | 393 | let source_map = self.tcx.sess.source_map(); |
| 394 | 394 | err.span_suggestion( |
| 395 | source_map.end_point(cause.span()), | |
| 395 | source_map.end_point(cause.span), | |
| 396 | 396 | "try removing this `?`", |
| 397 | 397 | "", |
| 398 | 398 | Applicability::MachineApplicable, |
| ... | ... | @@ -412,6 +412,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 412 | 412 | source, |
| 413 | 413 | ref prior_non_diverging_arms, |
| 414 | 414 | scrut_span, |
| 415 | expr_span, | |
| 415 | 416 | .. |
| 416 | 417 | }) => match source { |
| 417 | 418 | hir::MatchSource::TryDesugar(scrut_hir_id) => { |
| ... | ... | @@ -430,7 +431,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 430 | 431 | Some(ty) if expected == ty => { |
| 431 | 432 | let source_map = self.tcx.sess.source_map(); |
| 432 | 433 | err.span_suggestion( |
| 433 | source_map.end_point(cause.span()), | |
| 434 | source_map.end_point(cause.span), | |
| 434 | 435 | "try removing this `?`", |
| 435 | 436 | "", |
| 436 | 437 | Applicability::MachineApplicable, |
| ... | ... | @@ -460,12 +461,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 460 | 461 | format!("this and all prior arms are found to be of type `{t}`"), |
| 461 | 462 | ); |
| 462 | 463 | } |
| 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) { | |
| 464 | 465 | // Cover just `match` and the scrutinee expression, not |
| 465 | 466 | // 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) | |
| 467 | 468 | } else { |
| 468 | cause.span | |
| 469 | expr_span | |
| 469 | 470 | }; |
| 470 | 471 | let msg = "`match` arms have incompatible types"; |
| 471 | 472 | err.span_label(outer, msg); |
| ... | ... | @@ -1148,7 +1149,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 1148 | 1149 | terr: TypeError<'tcx>, |
| 1149 | 1150 | prefer_label: bool, |
| 1150 | 1151 | ) { |
| 1151 | let span = cause.span(); | |
| 1152 | let span = cause.span; | |
| 1152 | 1153 | |
| 1153 | 1154 | // For some types of errors, expected-found does not make |
| 1154 | 1155 | // sense, so just ignore the values we were given. |
| ... | ... | @@ -1642,7 +1643,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 1642 | 1643 | terr: TypeError<'tcx>, |
| 1643 | 1644 | ) -> Vec<TypeErrorAdditionalDiags> { |
| 1644 | 1645 | let mut suggestions = Vec::new(); |
| 1645 | let span = trace.cause.span(); | |
| 1646 | let span = trace.cause.span; | |
| 1646 | 1647 | let values = self.resolve_vars_if_possible(trace.values); |
| 1647 | 1648 | if let Some((expected, found)) = values.ty() { |
| 1648 | 1649 | match (expected.kind(), found.kind()) { |
| ... | ... | @@ -1792,7 +1793,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 1792 | 1793 | ) -> Diag<'a> { |
| 1793 | 1794 | debug!("report_and_explain_type_error(trace={:?}, terr={:?})", trace, terr); |
| 1794 | 1795 | |
| 1795 | let span = trace.cause.span(); | |
| 1796 | let span = trace.cause.span; | |
| 1796 | 1797 | let failure_code = trace.cause.as_failure_code_diag( |
| 1797 | 1798 | terr, |
| 1798 | 1799 | 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> { |
| 237 | 237 | expected_args: GenericArgsRef<'tcx>, |
| 238 | 238 | actual_args: GenericArgsRef<'tcx>, |
| 239 | 239 | ) -> Diag<'tcx> { |
| 240 | let span = cause.span(); | |
| 240 | let span = cause.span; | |
| 241 | 241 | |
| 242 | 242 | let (leading_ellipsis, satisfy_span, where_span, dup_span, def_id) = |
| 243 | 243 | 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> { |
| 1835 | 1835 | if impl_trait_ref.references_error() { |
| 1836 | 1836 | return false; |
| 1837 | 1837 | } |
| 1838 | let self_ty = impl_trait_ref.self_ty().to_string(); | |
| 1838 | 1839 | err.highlighted_help(vec![ |
| 1839 | 1840 | StringPart::normal(format!( |
| 1840 | 1841 | "the trait `{}` ", |
| ... | ... | @@ -1842,16 +1843,24 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 1842 | 1843 | )), |
| 1843 | 1844 | StringPart::highlighted("is"), |
| 1844 | 1845 | 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 | }, | |
| 1846 | 1851 | StringPart::normal("`"), |
| 1847 | 1852 | ]); |
| 1848 | 1853 | |
| 1849 | 1854 | if let [TypeError::Sorts(exp_found)] = &terrs[..] { |
| 1850 | 1855 | 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 | ]); | |
| 1855 | 1864 | } |
| 1856 | 1865 | |
| 1857 | 1866 | true |
| ... | ... | @@ -2160,6 +2169,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2160 | 2169 | // First, attempt to add note to this error with an async-await-specific |
| 2161 | 2170 | // message, and fall back to regular note otherwise. |
| 2162 | 2171 | if !self.maybe_note_obligation_cause_for_async_await(err, obligation) { |
| 2172 | let mut long_ty_file = None; | |
| 2163 | 2173 | self.note_obligation_cause_code( |
| 2164 | 2174 | obligation.cause.body_id, |
| 2165 | 2175 | err, |
| ... | ... | @@ -2168,7 +2178,15 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2168 | 2178 | obligation.cause.code(), |
| 2169 | 2179 | &mut vec![], |
| 2170 | 2180 | &mut Default::default(), |
| 2181 | &mut long_ty_file, | |
| 2171 | 2182 | ); |
| 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 | } | |
| 2172 | 2190 | self.suggest_unsized_bound_if_applicable(err, obligation); |
| 2173 | 2191 | if let Some(span) = err.span.primary_span() |
| 2174 | 2192 | && 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> { |
| 305 | 305 | if let ObligationCauseCode::WhereClause(..) |
| 306 | 306 | | ObligationCauseCode::WhereClauseInExpr(..) = code |
| 307 | 307 | { |
| 308 | let mut long_ty_file = None; | |
| 308 | 309 | self.note_obligation_cause_code( |
| 309 | 310 | error.obligation.cause.body_id, |
| 310 | 311 | &mut diag, |
| ... | ... | @@ -313,7 +314,17 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 313 | 314 | code, |
| 314 | 315 | &mut vec![], |
| 315 | 316 | &mut Default::default(), |
| 317 | &mut long_ty_file, | |
| 316 | 318 | ); |
| 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 | } | |
| 317 | 328 | } |
| 318 | 329 | diag.emit() |
| 319 | 330 | } |
compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs+11| ... | ... | @@ -144,6 +144,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 144 | 144 | obligation.cause.span, |
| 145 | 145 | suggest_increasing_limit, |
| 146 | 146 | |err| { |
| 147 | let mut long_ty_file = None; | |
| 147 | 148 | self.note_obligation_cause_code( |
| 148 | 149 | obligation.cause.body_id, |
| 149 | 150 | err, |
| ... | ... | @@ -152,7 +153,17 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 152 | 153 | obligation.cause.code(), |
| 153 | 154 | &mut vec![], |
| 154 | 155 | &mut Default::default(), |
| 156 | &mut long_ty_file, | |
| 155 | 157 | ); |
| 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 | } | |
| 156 | 167 | }, |
| 157 | 168 | ); |
| 158 | 169 | } |
compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs+18-20| ... | ... | @@ -3,6 +3,7 @@ |
| 3 | 3 | use std::assert_matches::debug_assert_matches; |
| 4 | 4 | use std::borrow::Cow; |
| 5 | 5 | use std::iter; |
| 6 | use std::path::PathBuf; | |
| 6 | 7 | |
| 7 | 8 | use itertools::{EitherOrBoth, Itertools}; |
| 8 | 9 | use rustc_data_structures::fx::FxHashSet; |
| ... | ... | @@ -2703,6 +2704,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2703 | 2704 | // Add a note for the item obligation that remains - normally a note pointing to the |
| 2704 | 2705 | // bound that introduced the obligation (e.g. `T: Send`). |
| 2705 | 2706 | debug!(?next_code); |
| 2707 | let mut long_ty_file = None; | |
| 2706 | 2708 | self.note_obligation_cause_code( |
| 2707 | 2709 | obligation.cause.body_id, |
| 2708 | 2710 | err, |
| ... | ... | @@ -2711,6 +2713,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2711 | 2713 | next_code.unwrap(), |
| 2712 | 2714 | &mut Vec::new(), |
| 2713 | 2715 | &mut Default::default(), |
| 2716 | &mut long_ty_file, | |
| 2714 | 2717 | ); |
| 2715 | 2718 | } |
| 2716 | 2719 | |
| ... | ... | @@ -2723,11 +2726,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2723 | 2726 | cause_code: &ObligationCauseCode<'tcx>, |
| 2724 | 2727 | obligated_types: &mut Vec<Ty<'tcx>>, |
| 2725 | 2728 | seen_requirements: &mut FxHashSet<DefId>, |
| 2729 | long_ty_file: &mut Option<PathBuf>, | |
| 2726 | 2730 | ) where |
| 2727 | 2731 | T: Upcast<TyCtxt<'tcx>, ty::Predicate<'tcx>>, |
| 2728 | 2732 | { |
| 2729 | let mut long_ty_file = None; | |
| 2730 | ||
| 2731 | 2733 | let tcx = self.tcx; |
| 2732 | 2734 | let predicate = predicate.upcast(tcx); |
| 2733 | 2735 | let suggest_remove_deref = |err: &mut Diag<'_, G>, expr: &hir::Expr<'_>| { |
| ... | ... | @@ -2957,9 +2959,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2957 | 2959 | } |
| 2958 | 2960 | ObligationCauseCode::Coercion { source, target } => { |
| 2959 | 2961 | 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); | |
| 2961 | 2963 | 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); | |
| 2963 | 2965 | err.note(with_forced_trimmed_paths!(format!( |
| 2964 | 2966 | "required for the cast from `{source}` to `{target}`", |
| 2965 | 2967 | ))); |
| ... | ... | @@ -3249,7 +3251,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3249 | 3251 | }; |
| 3250 | 3252 | |
| 3251 | 3253 | 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); | |
| 3253 | 3255 | let msg = format!("required because it appears within the type `{ty_str}`"); |
| 3254 | 3256 | match ty.kind() { |
| 3255 | 3257 | ty::Adt(def, _) => match tcx.opt_item_ident(def.did()) { |
| ... | ... | @@ -3327,6 +3329,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3327 | 3329 | &data.parent_code, |
| 3328 | 3330 | obligated_types, |
| 3329 | 3331 | seen_requirements, |
| 3332 | long_ty_file, | |
| 3330 | 3333 | ) |
| 3331 | 3334 | }); |
| 3332 | 3335 | } else { |
| ... | ... | @@ -3339,6 +3342,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3339 | 3342 | cause_code.peel_derives(), |
| 3340 | 3343 | obligated_types, |
| 3341 | 3344 | seen_requirements, |
| 3345 | long_ty_file, | |
| 3342 | 3346 | ) |
| 3343 | 3347 | }); |
| 3344 | 3348 | } |
| ... | ... | @@ -3347,8 +3351,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3347 | 3351 | let mut parent_trait_pred = |
| 3348 | 3352 | self.resolve_vars_if_possible(data.derived.parent_trait_pred); |
| 3349 | 3353 | 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); | |
| 3352 | 3356 | let trait_name = parent_trait_pred.print_modifiers_and_trait_path().to_string(); |
| 3353 | 3357 | let msg = format!("required for `{self_ty_str}` to implement `{trait_name}`"); |
| 3354 | 3358 | let mut is_auto_trait = false; |
| ... | ... | @@ -3444,10 +3448,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3444 | 3448 | count, |
| 3445 | 3449 | pluralize!(count) |
| 3446 | 3450 | )); |
| 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); | |
| 3451 | 3453 | err.note(format!( |
| 3452 | 3454 | "required for `{self_ty}` to implement `{}`", |
| 3453 | 3455 | parent_trait_pred.print_modifiers_and_trait_path() |
| ... | ... | @@ -3463,6 +3465,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3463 | 3465 | &data.parent_code, |
| 3464 | 3466 | obligated_types, |
| 3465 | 3467 | seen_requirements, |
| 3468 | long_ty_file, | |
| 3466 | 3469 | ) |
| 3467 | 3470 | }); |
| 3468 | 3471 | } |
| ... | ... | @@ -3479,6 +3482,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3479 | 3482 | &data.parent_code, |
| 3480 | 3483 | obligated_types, |
| 3481 | 3484 | seen_requirements, |
| 3485 | long_ty_file, | |
| 3482 | 3486 | ) |
| 3483 | 3487 | }); |
| 3484 | 3488 | } |
| ... | ... | @@ -3493,6 +3497,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3493 | 3497 | nested, |
| 3494 | 3498 | obligated_types, |
| 3495 | 3499 | seen_requirements, |
| 3500 | long_ty_file, | |
| 3496 | 3501 | ) |
| 3497 | 3502 | }); |
| 3498 | 3503 | let mut multispan = MultiSpan::from(span); |
| ... | ... | @@ -3523,6 +3528,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3523 | 3528 | parent_code, |
| 3524 | 3529 | obligated_types, |
| 3525 | 3530 | seen_requirements, |
| 3531 | long_ty_file, | |
| 3526 | 3532 | ) |
| 3527 | 3533 | }); |
| 3528 | 3534 | } |
| ... | ... | @@ -3562,7 +3568,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3562 | 3568 | } |
| 3563 | 3569 | ObligationCauseCode::OpaqueReturnType(expr_info) => { |
| 3564 | 3570 | 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); | |
| 3566 | 3572 | let expr = self.infcx.tcx.hir().expect_expr(hir_id); |
| 3567 | 3573 | err.span_label( |
| 3568 | 3574 | expr.span, |
| ... | ... | @@ -3574,14 +3580,6 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3574 | 3580 | } |
| 3575 | 3581 | } |
| 3576 | 3582 | } |
| 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 | } | |
| 3585 | 3583 | } |
| 3586 | 3584 | |
| 3587 | 3585 | #[instrument( |
compiler/rustc_trait_selection/src/traits/project.rs+2-2| ... | ... | @@ -1180,7 +1180,7 @@ fn assemble_candidates_from_impls<'cx, 'tcx>( |
| 1180 | 1180 | selcx.tcx(), |
| 1181 | 1181 | selcx.tcx().require_lang_item( |
| 1182 | 1182 | LangItem::Sized, |
| 1183 | Some(obligation.cause.span()), | |
| 1183 | Some(obligation.cause.span), | |
| 1184 | 1184 | ), |
| 1185 | 1185 | [self_ty], |
| 1186 | 1186 | ), |
| ... | ... | @@ -1600,7 +1600,7 @@ fn confirm_builtin_candidate<'cx, 'tcx>( |
| 1600 | 1600 | // exist. Instead, `Pointee<Metadata = ()>` should be a supertrait of `Sized`. |
| 1601 | 1601 | let sized_predicate = ty::TraitRef::new( |
| 1602 | 1602 | tcx, |
| 1603 | tcx.require_lang_item(LangItem::Sized, Some(obligation.cause.span())), | |
| 1603 | tcx.require_lang_item(LangItem::Sized, Some(obligation.cause.span)), | |
| 1604 | 1604 | [self_ty], |
| 1605 | 1605 | ); |
| 1606 | 1606 | 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> { |
| 90 | 90 | assert!(!self.intercrate); |
| 91 | 91 | let c_pred = |
| 92 | 92 | 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) | |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 |
library/core/src/char/methods.rs+2-1| ... | ... | @@ -320,8 +320,9 @@ impl char { |
| 320 | 320 | /// '1'.is_digit(37); |
| 321 | 321 | /// ``` |
| 322 | 322 | #[stable(feature = "rust1", since = "1.0.0")] |
| 323 | #[rustc_const_unstable(feature = "const_char_is_digit", issue = "132241")] | |
| 323 | 324 | #[inline] |
| 324 | pub fn is_digit(self, radix: u32) -> bool { | |
| 325 | pub const fn is_digit(self, radix: u32) -> bool { | |
| 325 | 326 | self.to_digit(radix).is_some() |
| 326 | 327 | } |
| 327 | 328 |
src/tools/compiletest/src/runtest/run_make.rs+1| ... | ... | @@ -329,6 +329,7 @@ impl TestCx<'_> { |
| 329 | 329 | .arg(format!("run_make_support={}", &support_lib_path.to_string_lossy())) |
| 330 | 330 | .arg("--edition=2021") |
| 331 | 331 | .arg(&self.testpaths.file.join("rmake.rs")) |
| 332 | .arg("-Cprefer-dynamic") | |
| 332 | 333 | // Provide necessary library search paths for rustc. |
| 333 | 334 | .env(dylib_env_var(), &env::join_paths(host_dylib_search_paths).unwrap()); |
| 334 | 335 |
src/tools/run-make-support/Cargo.toml+3| ... | ... | @@ -13,3 +13,6 @@ gimli = "0.31.0" |
| 13 | 13 | build_helper = { path = "../build_helper" } |
| 14 | 14 | serde_json = "1.0" |
| 15 | 15 | libc = "0.2" |
| 16 | ||
| 17 | [lib] | |
| 18 | crate-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). | |
| 2 | go-to: "file://" + |DOC_PATH| + "/test_docs/fields/struct.Struct.html" | |
| 3 | store-position: ("#structfield\.a", {"y": a_y}) | |
| 4 | store-position: ("#structfield\.b", {"y": b_y}) | |
| 5 | assert: |a_y| < |b_y| | |
| 1 | // This test checks that fields are displayed as expected (one by line) and they are surrounded | |
| 2 | // by margins. | |
| 6 | 3 | |
| 7 | go-to: "file://" + |DOC_PATH| + "/test_docs/fields/union.Union.html" | |
| 8 | store-position: ("#structfield\.a", {"y": a_y}) | |
| 9 | store-position: ("#structfield\.b", {"y": b_y}) | |
| 10 | assert: |a_y| < |b_y| | |
| 4 | define-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 | ||
| 23 | call-function: ("check-fields", { | |
| 24 | "path": "struct.Struct.html", | |
| 25 | "selector_1": "#structfield\.a", | |
| 26 | "selector_2": "#structfield\.b", | |
| 27 | }) | |
| 28 | ||
| 29 | call-function: ("check-fields", { | |
| 30 | "path": "union.Union.html", | |
| 31 | "selector_1": "#structfield\.a", | |
| 32 | "selector_2": "#structfield\.b", | |
| 33 | }) | |
| 11 | 34 | |
| 12 | 35 | go-to: "file://" + |DOC_PATH| + "/test_docs/fields/enum.Enum.html" |
| 13 | 36 | store-position: ("#variant\.A\.field\.a", {"y": a_y}) |
| ... | ... | @@ -16,3 +39,11 @@ assert: |a_y| < |b_y| |
| 16 | 39 | store-position: ("#variant\.B\.field\.a", {"y": a_y}) |
| 17 | 40 | store-position: ("#variant\.B\.field\.b", {"y": b_y}) |
| 18 | 41 | assert: |a_y| < |b_y| |
| 42 | ||
| 43 | // Check the margins. | |
| 44 | assert-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`). | |
| 2 | 3 | go-to: "file://" + |DOC_PATH| + "/test_docs/struct.StructWithPublicUndocumentedFields.html" |
| 3 | 4 | |
| 4 | 5 | store-property: ("//*[@id='structfield.first']", {"offsetTop": first_top}) |
tests/ui/consts/const-block-const-bound.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn f<T: ~const Destruct>(x: T) {} |
| 5 | | ^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn f<T: ~const Destruct>(x: T) {} |
| 11 | | ^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/consts/fn_trait_refs.stderr+46-46| ... | ... | @@ -11,168 +11,168 @@ LL | #![feature(const_cmp)] |
| 11 | 11 | | ^^^^^^^^^ |
| 12 | 12 | |
| 13 | 13 | error: `~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 | |
| 15 | 15 | | |
| 16 | 16 | LL | T: ~const Fn<()> + ~const Destruct, |
| 17 | | ^^^^^^ | |
| 17 | | ^^^^^^ | |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | T: ~const Fn<()> + ~const Destruct, |
| 23 | | ^^^^^^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | |
| 25 | 25 | error: `~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 | |
| 27 | 27 | | |
| 28 | 28 | LL | T: ~const Fn<()> + ~const Destruct, |
| 29 | | ^^^^^^ | |
| 29 | | ^^^^^^ | |
| 30 | 30 | | |
| 31 | 31 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 32 | 32 | |
| 33 | 33 | error: `~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 | |
| 35 | 35 | | |
| 36 | 36 | LL | T: ~const Fn<()> + ~const Destruct, |
| 37 | | ^^^^^^ | |
| 37 | | ^^^^^^ | |
| 38 | 38 | | |
| 39 | 39 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 40 | 40 | |
| 41 | 41 | error: `~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 | |
| 43 | 43 | | |
| 44 | 44 | LL | T: ~const Fn<()> + ~const Destruct, |
| 45 | | ^^^^^^^^ | |
| 45 | | ^^^^^^ | |
| 46 | 46 | | |
| 47 | 47 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 48 | 48 | |
| 49 | 49 | error: `~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 | |
| 51 | 51 | | |
| 52 | 52 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 53 | | ^^^^^^^^^ | |
| 53 | | ^^^^^^ | |
| 54 | 54 | |
| 55 | 55 | error: `~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 | |
| 57 | 57 | | |
| 58 | 58 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 59 | | ^^^^^^^^ | |
| 59 | | ^^^^^^ | |
| 60 | 60 | |
| 61 | 61 | error: `~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 | |
| 63 | 63 | | |
| 64 | 64 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 65 | | ^^^^^^^^^ | |
| 65 | | ^^^^^^ | |
| 66 | 66 | | |
| 67 | 67 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 68 | 68 | |
| 69 | 69 | error: `~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 | |
| 71 | 71 | | |
| 72 | 72 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 73 | | ^^^^^^^^^ | |
| 73 | | ^^^^^^ | |
| 74 | 74 | | |
| 75 | 75 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 76 | 76 | |
| 77 | 77 | error: `~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 | |
| 79 | 79 | | |
| 80 | 80 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 81 | | ^^^^^^^^ | |
| 81 | | ^^^^^^ | |
| 82 | 82 | | |
| 83 | 83 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 84 | 84 | |
| 85 | 85 | error: `~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 | |
| 87 | 87 | | |
| 88 | 88 | LL | T: ~const FnOnce<()>, |
| 89 | | ^^^^^^^^^^ | |
| 89 | | ^^^^^^ | |
| 90 | 90 | |
| 91 | 91 | error: `~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 | |
| 93 | 93 | | |
| 94 | 94 | LL | T: ~const FnOnce<()>, |
| 95 | | ^^^^^^^^^^ | |
| 95 | | ^^^^^^ | |
| 96 | 96 | | |
| 97 | 97 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 98 | 98 | |
| 99 | 99 | error: `~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 | |
| 101 | 101 | | |
| 102 | 102 | LL | T: ~const FnOnce<()>, |
| 103 | | ^^^^^^^^^^ | |
| 103 | | ^^^^^^ | |
| 104 | 104 | | |
| 105 | 105 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 106 | 106 | |
| 107 | 107 | error: `~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 | |
| 109 | 109 | | |
| 110 | 110 | LL | T: ~const Fn<()> + ~const Destruct, |
| 111 | | ^^^^^^ | |
| 111 | | ^^^^^^ | |
| 112 | 112 | |
| 113 | 113 | error: `~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 | |
| 115 | 115 | | |
| 116 | 116 | LL | T: ~const Fn<()> + ~const Destruct, |
| 117 | | ^^^^^^^^ | |
| 117 | | ^^^^^^ | |
| 118 | 118 | |
| 119 | 119 | error: `~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 | |
| 121 | 121 | | |
| 122 | 122 | LL | T: ~const Fn<()> + ~const Destruct, |
| 123 | | ^^^^^^ | |
| 123 | | ^^^^^^ | |
| 124 | 124 | | |
| 125 | 125 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 126 | 126 | |
| 127 | 127 | error: `~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 | |
| 129 | 129 | | |
| 130 | 130 | LL | T: ~const Fn<()> + ~const Destruct, |
| 131 | | ^^^^^^ | |
| 131 | | ^^^^^^ | |
| 132 | 132 | | |
| 133 | 133 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 134 | 134 | |
| 135 | 135 | error: `~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 | |
| 137 | 137 | | |
| 138 | 138 | LL | T: ~const Fn<()> + ~const Destruct, |
| 139 | | ^^^^^^^^ | |
| 139 | | ^^^^^^ | |
| 140 | 140 | | |
| 141 | 141 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 142 | 142 | |
| 143 | 143 | error: `~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 | |
| 145 | 145 | | |
| 146 | 146 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 147 | | ^^^^^^^^^ | |
| 147 | | ^^^^^^ | |
| 148 | 148 | |
| 149 | 149 | error: `~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 | |
| 151 | 151 | | |
| 152 | 152 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 153 | | ^^^^^^^^ | |
| 153 | | ^^^^^^ | |
| 154 | 154 | |
| 155 | 155 | error: `~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 | |
| 157 | 157 | | |
| 158 | 158 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 159 | | ^^^^^^^^^ | |
| 159 | | ^^^^^^ | |
| 160 | 160 | | |
| 161 | 161 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 162 | 162 | |
| 163 | 163 | error: `~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 | |
| 165 | 165 | | |
| 166 | 166 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 167 | | ^^^^^^^^^ | |
| 167 | | ^^^^^^ | |
| 168 | 168 | | |
| 169 | 169 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 170 | 170 | |
| 171 | 171 | error: `~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 | |
| 173 | 173 | | |
| 174 | 174 | LL | T: ~const FnMut<()> + ~const Destruct, |
| 175 | | ^^^^^^^^ | |
| 175 | | ^^^^^^ | |
| 176 | 176 | | |
| 177 | 177 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 178 | 178 |
tests/ui/consts/unstable-const-fn-in-libcore.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T { |
| 5 | | ^^^^^^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn unwrap_or_else<F: ~const FnOnce() -> T>(self, f: F) -> T { |
| 11 | | ^^^^^^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
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 | ||
| 5 | trait Foo<T>: Bar<T> {} | |
| 6 | ||
| 7 | trait Bar<T> {} | |
| 8 | ||
| 9 | struct Struct; | |
| 10 | ||
| 11 | impl<T, K> Foo<K> for T where T: Bar<K> | |
| 12 | {} | |
| 13 | ||
| 14 | impl<'a> Bar<()> for Struct {} | |
| 15 | ||
| 16 | fn foo() -> impl Foo<i32> { | |
| 17 | Struct | |
| 18 | } | |
| 19 | ||
| 20 | fn 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 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { |
| 5 | | ^^^^^^^^^^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { |
| 11 | | ^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | |
| 13 | 13 | error: `~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 | |
| 15 | 15 | | |
| 16 | 16 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { |
| 17 | | ^^^^^^^^^^^^^^^^^ | |
| 17 | | ^^^^^^ | |
| 18 | 18 | | |
| 19 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 20 | 20 | |
| 21 | 21 | error: `~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 | |
| 23 | 23 | | |
| 24 | 24 | LL | const fn with_positive<F: for<'a> ~const Fn(&'a Alias<'a>) + ~const Destruct>(fun: F) { |
| 25 | | ^^^^^^^^ | |
| 25 | | ^^^^^^ | |
| 26 | 26 | | |
| 27 | 27 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 28 | 28 |
tests/ui/repr/repr_align_greater_usize.msp430.stderr created+19| ... | ... | @@ -0,0 +1,19 @@ |
| 1 | error[E0589]: alignment must not be greater than `isize::MAX` bytes | |
| 2 | --> $DIR/repr_align_greater_usize.rs:21:8 | |
| 3 | | | |
| 4 | LL | #[repr(align(32768))] | |
| 5 | | ^^^^^^^^^^^^ | |
| 6 | | | |
| 7 | = note: `isize::MAX` is 32767 for the current target | |
| 8 | ||
| 9 | error[E0589]: alignment must not be greater than `isize::MAX` bytes | |
| 10 | --> $DIR/repr_align_greater_usize.rs:24:8 | |
| 11 | | | |
| 12 | LL | #[repr(align(65536))] | |
| 13 | | ^^^^^^^^^^^^ | |
| 14 | | | |
| 15 | = note: `isize::MAX` is 32767 for the current target | |
| 16 | ||
| 17 | error: aborting due to 2 previous errors | |
| 18 | ||
| 19 | For 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"] | |
| 16 | trait Sized {} | |
| 17 | ||
| 18 | #[repr(align(16384))] | |
| 19 | struct Kitten; | |
| 20 | ||
| 21 | #[repr(align(32768))] //[msp430]~ ERROR alignment must not be greater than `isize::MAX` | |
| 22 | struct Cat; | |
| 23 | ||
| 24 | #[repr(align(65536))] //[msp430]~ ERROR alignment must not be greater than `isize::MAX` | |
| 25 | struct BigCat; |
tests/ui/specialization/const_trait_impl.stderr+12-12| ... | ... | @@ -1,42 +1,42 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | impl<T: ~const Default> const A for T { |
| 5 | | ^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | impl<T: ~const Default + ~const Sup> const A for T { |
| 11 | | ^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | |
| 13 | 13 | error: `~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 | |
| 15 | 15 | | |
| 16 | 16 | LL | impl<T: ~const Default + ~const Sub> const A for T { |
| 17 | | ^^^^^^^ | |
| 17 | | ^^^^^^ | |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | impl<T: ~const Default + ~const Sup> const A for T { |
| 23 | | ^^^^^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | | |
| 25 | 25 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 26 | 26 | |
| 27 | 27 | error: `~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 | |
| 29 | 29 | | |
| 30 | 30 | LL | impl<T: ~const Default> const A for T { |
| 31 | | ^^^^^^^ | |
| 31 | | ^^^^^^ | |
| 32 | 32 | | |
| 33 | 33 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 34 | 34 | |
| 35 | 35 | error: `~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 | |
| 37 | 37 | | |
| 38 | 38 | LL | impl<T: ~const Default + ~const Sub> const A for T { |
| 39 | | ^^^^^^^ | |
| 39 | | ^^^^^^ | |
| 40 | 40 | | |
| 41 | 41 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 42 | 42 |
tests/ui/traits/const-traits/assoc-type.stderr+1-1| ... | ... | @@ -17,7 +17,7 @@ note: required by a bound in `Foo::Bar` |
| 17 | 17 | --> $DIR/assoc-type.rs:32:15 |
| 18 | 18 | | |
| 19 | 19 | LL | type Bar: ~const Add; |
| 20 | | ^^^^^^^^^^ required by this bound in `Foo::Bar` | |
| 20 | | ^^^^^^ required by this bound in `Foo::Bar` | |
| 21 | 21 | |
| 22 | 22 | error: aborting due to 1 previous error; 1 warning emitted |
| 23 | 23 |
tests/ui/traits/const-traits/call-generic-in-impl.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | impl<T: ~const PartialEq> const MyPartialEq for T { |
| 5 | | ^^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | impl<T: ~const PartialEq> const MyPartialEq for T { |
| 11 | | ^^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/traits/const-traits/call-generic-method-chain.stderr+8-8| ... | ... | @@ -17,30 +17,30 @@ LL | impl const PartialEq for S { |
| 17 | 17 | = note: adding a non-const method body in the future would be a breaking change |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool { |
| 23 | | ^^^^^^^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | |
| 25 | 25 | error: `~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 | |
| 27 | 27 | | |
| 28 | 28 | LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool { |
| 29 | | ^^^^^^^^^ | |
| 29 | | ^^^^^^ | |
| 30 | 30 | | |
| 31 | 31 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 32 | 32 | |
| 33 | 33 | error: `~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 | |
| 35 | 35 | | |
| 36 | 36 | LL | const fn equals_self_wrapper<T: ~const PartialEq>(t: &T) -> bool { |
| 37 | | ^^^^^^^^^ | |
| 37 | | ^^^^^^ | |
| 38 | 38 | |
| 39 | 39 | error: `~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 | |
| 41 | 41 | | |
| 42 | 42 | LL | const fn equals_self_wrapper<T: ~const PartialEq>(t: &T) -> bool { |
| 43 | | ^^^^^^^^^ | |
| 43 | | ^^^^^^ | |
| 44 | 44 | | |
| 45 | 45 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 46 | 46 |
tests/ui/traits/const-traits/call-generic-method-dup-bound.stderr+8-8| ... | ... | @@ -17,30 +17,30 @@ LL | impl const PartialEq for S { |
| 17 | 17 | = note: adding a non-const method body in the future would be a breaking change |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool { |
| 23 | | ^^^^^^^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | |
| 25 | 25 | error: `~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 | |
| 27 | 27 | | |
| 28 | 28 | LL | const fn equals_self<T: PartialEq + ~const PartialEq>(t: &T) -> bool { |
| 29 | | ^^^^^^^^^ | |
| 29 | | ^^^^^^ | |
| 30 | 30 | | |
| 31 | 31 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 32 | 32 | |
| 33 | 33 | error: `~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 | |
| 35 | 35 | | |
| 36 | 36 | LL | const fn equals_self2<T: A + ~const PartialEq>(t: &T) -> bool { |
| 37 | | ^^^^^^^^^ | |
| 37 | | ^^^^^^ | |
| 38 | 38 | |
| 39 | 39 | error: `~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 | |
| 41 | 41 | | |
| 42 | 42 | LL | const fn equals_self2<T: A + ~const PartialEq>(t: &T) -> bool { |
| 43 | | ^^^^^^^^^ | |
| 43 | | ^^^^^^ | |
| 44 | 44 | | |
| 45 | 45 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 46 | 46 |
tests/ui/traits/const-traits/call-generic-method-pass.stderr+4-4| ... | ... | @@ -17,16 +17,16 @@ LL | impl const PartialEq for S { |
| 17 | 17 | = note: adding a non-const method body in the future would be a breaking change |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool { |
| 23 | | ^^^^^^^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | |
| 25 | 25 | error: `~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 | |
| 27 | 27 | | |
| 28 | 28 | LL | const fn equals_self<T: ~const PartialEq>(t: &T) -> bool { |
| 29 | | ^^^^^^^^^ | |
| 29 | | ^^^^^^ | |
| 30 | 30 | | |
| 31 | 31 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 32 | 32 |
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 |
| 13 | 13 | = help: use `-Znext-solver` to enable |
| 14 | 14 | |
| 15 | 15 | error: `~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 | |
| 17 | 17 | | |
| 18 | 18 | LL | const fn perform<T: ~const NonConst>() {} |
| 19 | | ^^^^^^^^ | |
| 19 | | ^^^^^^ | |
| 20 | 20 | |
| 21 | 21 | error: `~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 | |
| 23 | 23 | | |
| 24 | 24 | LL | const fn perform<T: ~const NonConst>() {} |
| 25 | | ^^^^^^^^ | |
| 25 | | ^^^^^^ | |
| 26 | 26 | | |
| 27 | 27 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 28 | 28 | |
| 29 | 29 | error: `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 | |
| 31 | 31 | | |
| 32 | 32 | LL | fn operate<T: const NonConst>() {} |
| 33 | | ^^^^^^^^ | |
| 33 | | ^^^^^ | |
| 34 | 34 | |
| 35 | 35 | error: aborting due to 4 previous errors; 1 warning emitted |
| 36 | 36 |
tests/ui/traits/const-traits/const-closure-parse-not-item.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn test() -> impl ~const Fn() { |
| 5 | | ^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn test() -> impl ~const Fn() { |
| 11 | | ^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/traits/const-traits/const-closure-trait-method-fail.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 { |
| 5 | | ^^^^^^^^^^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 { |
| 11 | | ^^^^^^^^^^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/traits/const-traits/const-closure-trait-method.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 { |
| 5 | | ^^^^^^^^^^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn need_const_closure<T: ~const FnOnce(()) -> i32>(x: T) -> i32 { |
| 11 | | ^^^^^^^^^^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/traits/const-traits/const-closures.stderr+16-16| ... | ... | @@ -1,56 +1,56 @@ |
| 1 | 1 | error: `~const` can only be applied to `#[const_trait]` traits |
| 2 | --> $DIR/const-closures.rs:8:19 | |
| 2 | --> $DIR/const-closures.rs:8:12 | |
| 3 | 3 | | |
| 4 | 4 | LL | F: ~const FnOnce() -> u8, |
| 5 | | ^^^^^^^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~const` can only be applied to `#[const_trait]` traits |
| 8 | --> $DIR/const-closures.rs:9:19 | |
| 8 | --> $DIR/const-closures.rs:9:12 | |
| 9 | 9 | | |
| 10 | 10 | LL | F: ~const FnMut() -> u8, |
| 11 | | ^^^^^^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | |
| 13 | 13 | error: `~const` can only be applied to `#[const_trait]` traits |
| 14 | --> $DIR/const-closures.rs:10:19 | |
| 14 | --> $DIR/const-closures.rs:10:12 | |
| 15 | 15 | | |
| 16 | 16 | LL | F: ~const Fn() -> u8, |
| 17 | | ^^^^^^^^^^ | |
| 17 | | ^^^^^^ | |
| 18 | 18 | |
| 19 | 19 | error: `~const` can only be applied to `#[const_trait]` traits |
| 20 | --> $DIR/const-closures.rs:8:19 | |
| 20 | --> $DIR/const-closures.rs:8:12 | |
| 21 | 21 | | |
| 22 | 22 | LL | F: ~const FnOnce() -> u8, |
| 23 | | ^^^^^^^^^^^^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | | |
| 25 | 25 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 26 | 26 | |
| 27 | 27 | error: `~const` can only be applied to `#[const_trait]` traits |
| 28 | --> $DIR/const-closures.rs:9:19 | |
| 28 | --> $DIR/const-closures.rs:9:12 | |
| 29 | 29 | | |
| 30 | 30 | LL | F: ~const FnMut() -> u8, |
| 31 | | ^^^^^^^^^^^^^ | |
| 31 | | ^^^^^^ | |
| 32 | 32 | | |
| 33 | 33 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 34 | 34 | |
| 35 | 35 | error: `~const` can only be applied to `#[const_trait]` traits |
| 36 | --> $DIR/const-closures.rs:10:19 | |
| 36 | --> $DIR/const-closures.rs:10:12 | |
| 37 | 37 | | |
| 38 | 38 | LL | F: ~const Fn() -> u8, |
| 39 | | ^^^^^^^^^^ | |
| 39 | | ^^^^^^ | |
| 40 | 40 | | |
| 41 | 41 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 42 | 42 | |
| 43 | 43 | error: `~const` can only be applied to `#[const_trait]` traits |
| 44 | --> $DIR/const-closures.rs:23:27 | |
| 44 | --> $DIR/const-closures.rs:23:20 | |
| 45 | 45 | | |
| 46 | 46 | LL | const fn answer<F: ~const Fn() -> u8>(f: &F) -> u8 { |
| 47 | | ^^^^^^^^^^ | |
| 47 | | ^^^^^^ | |
| 48 | 48 | |
| 49 | 49 | error: `~const` can only be applied to `#[const_trait]` traits |
| 50 | --> $DIR/const-closures.rs:23:27 | |
| 50 | --> $DIR/const-closures.rs:23:20 | |
| 51 | 51 | | |
| 52 | 52 | LL | const fn answer<F: ~const Fn() -> u8>(f: &F) -> u8 { |
| 53 | | ^^^^^^^^^^ | |
| 53 | | ^^^^^^ | |
| 54 | 54 | | |
| 55 | 55 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 56 | 56 |
tests/ui/traits/const-traits/const-drop-bound.stderr+12-12| ... | ... | @@ -1,42 +1,42 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct { |
| 5 | | ^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn foo<T, E>(res: Result<T, E>) -> Option<T> where E: ~const Destruct { |
| 11 | | ^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 | |
| 15 | 15 | error: `~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 | |
| 17 | 17 | | |
| 18 | 18 | LL | T: ~const Destruct, |
| 19 | | ^^^^^^^^ | |
| 19 | | ^^^^^^ | |
| 20 | 20 | |
| 21 | 21 | error: `~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 | |
| 23 | 23 | | |
| 24 | 24 | LL | E: ~const Destruct, |
| 25 | | ^^^^^^^^ | |
| 25 | | ^^^^^^ | |
| 26 | 26 | |
| 27 | 27 | error: `~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 | |
| 29 | 29 | | |
| 30 | 30 | LL | T: ~const Destruct, |
| 31 | | ^^^^^^^^ | |
| 31 | | ^^^^^^ | |
| 32 | 32 | | |
| 33 | 33 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 34 | 34 | |
| 35 | 35 | error: `~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 | |
| 37 | 37 | | |
| 38 | 38 | LL | E: ~const Destruct, |
| 39 | | ^^^^^^^^ | |
| 39 | | ^^^^^^ | |
| 40 | 40 | | |
| 41 | 41 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 42 | 42 |
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> { |
| 8 | 8 | = note: adding a non-const method body in the future would be a breaking change |
| 9 | 9 | |
| 10 | 10 | error: `~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 | |
| 12 | 12 | | |
| 13 | 13 | LL | const fn check<T: ~const Destruct>(_: T) {} |
| 14 | | ^^^^^^^^ | |
| 14 | | ^^^^^^ | |
| 15 | 15 | |
| 16 | 16 | error: `~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 | |
| 18 | 18 | | |
| 19 | 19 | LL | const fn check<T: ~const Destruct>(_: T) {} |
| 20 | | ^^^^^^^^ | |
| 20 | | ^^^^^^ | |
| 21 | 21 | | |
| 22 | 22 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 23 | 23 |
tests/ui/traits/const-traits/const-drop-fail.precise.stderr+4-4| ... | ... | @@ -8,16 +8,16 @@ LL | impl const Drop for ConstImplWithDropGlue { |
| 8 | 8 | = note: adding a non-const method body in the future would be a breaking change |
| 9 | 9 | |
| 10 | 10 | error: `~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 | |
| 12 | 12 | | |
| 13 | 13 | LL | const fn check<T: ~const Destruct>(_: T) {} |
| 14 | | ^^^^^^^^ | |
| 14 | | ^^^^^^ | |
| 15 | 15 | |
| 16 | 16 | error: `~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 | |
| 18 | 18 | | |
| 19 | 19 | LL | const fn check<T: ~const Destruct>(_: T) {} |
| 20 | | ^^^^^^^^ | |
| 20 | | ^^^^^^ | |
| 21 | 21 | | |
| 22 | 22 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 23 | 23 |
tests/ui/traits/const-traits/const-drop-fail.stock.stderr+4-4| ... | ... | @@ -8,16 +8,16 @@ LL | impl const Drop for ConstImplWithDropGlue { |
| 8 | 8 | = note: adding a non-const method body in the future would be a breaking change |
| 9 | 9 | |
| 10 | 10 | error: `~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 | |
| 12 | 12 | | |
| 13 | 13 | LL | const fn check<T: ~const Destruct>(_: T) {} |
| 14 | | ^^^^^^^^ | |
| 14 | | ^^^^^^ | |
| 15 | 15 | |
| 16 | 16 | error: `~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 | |
| 18 | 18 | | |
| 19 | 19 | LL | const fn check<T: ~const Destruct>(_: T) {} |
| 20 | | ^^^^^^^^ | |
| 20 | | ^^^^^^ | |
| 21 | 21 | | |
| 22 | 22 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 23 | 23 |
tests/ui/traits/const-traits/const-drop.precise.stderr+4-4| ... | ... | @@ -35,16 +35,16 @@ LL | impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> { |
| 35 | 35 | = note: adding a non-const method body in the future would be a breaking change |
| 36 | 36 | |
| 37 | 37 | error: `~const` can only be applied to `#[const_trait]` traits |
| 38 | --> $DIR/const-drop.rs:18:22 | |
| 38 | --> $DIR/const-drop.rs:18:15 | |
| 39 | 39 | | |
| 40 | 40 | LL | const fn a<T: ~const Destruct>(_: T) {} |
| 41 | | ^^^^^^^^ | |
| 41 | | ^^^^^^ | |
| 42 | 42 | |
| 43 | 43 | error: `~const` can only be applied to `#[const_trait]` traits |
| 44 | --> $DIR/const-drop.rs:18:22 | |
| 44 | --> $DIR/const-drop.rs:18:15 | |
| 45 | 45 | | |
| 46 | 46 | LL | const fn a<T: ~const Destruct>(_: T) {} |
| 47 | | ^^^^^^^^ | |
| 47 | | ^^^^^^ | |
| 48 | 48 | | |
| 49 | 49 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 50 | 50 |
tests/ui/traits/const-traits/const-drop.stock.stderr+4-4| ... | ... | @@ -35,16 +35,16 @@ LL | impl<T: SomeTrait> const Drop for ConstDropWithNonconstBound<T> { |
| 35 | 35 | = note: adding a non-const method body in the future would be a breaking change |
| 36 | 36 | |
| 37 | 37 | error: `~const` can only be applied to `#[const_trait]` traits |
| 38 | --> $DIR/const-drop.rs:18:22 | |
| 38 | --> $DIR/const-drop.rs:18:15 | |
| 39 | 39 | | |
| 40 | 40 | LL | const fn a<T: ~const Destruct>(_: T) {} |
| 41 | | ^^^^^^^^ | |
| 41 | | ^^^^^^ | |
| 42 | 42 | |
| 43 | 43 | error: `~const` can only be applied to `#[const_trait]` traits |
| 44 | --> $DIR/const-drop.rs:18:22 | |
| 44 | --> $DIR/const-drop.rs:18:15 | |
| 45 | 45 | | |
| 46 | 46 | LL | const fn a<T: ~const Destruct>(_: T) {} |
| 47 | | ^^^^^^^^ | |
| 47 | | ^^^^^^ | |
| 48 | 48 | | |
| 49 | 49 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 50 | 50 |
tests/ui/traits/const-traits/const_derives/derive-const-with-params.stderr-6| ... | ... | @@ -23,12 +23,6 @@ LL | #[derive_const(PartialEq)] |
| 23 | 23 | = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 24 | 24 | |
| 25 | 25 | error: `~const` can only be applied to `#[const_trait]` traits |
| 26 | --> $DIR/derive-const-with-params.rs:7:16 | |
| 27 | | | |
| 28 | LL | #[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) | |
| 32 | 26 | |
| 33 | 27 | error[E0015]: cannot call non-const operator in constant functions |
| 34 | 28 | --> $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 |
| 23 | 23 | = help: use `-Znext-solver` to enable |
| 24 | 24 | |
| 25 | 25 | error: `~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 | |
| 27 | 27 | | |
| 28 | 28 | LL | const fn test() -> impl ~const Fn() { |
| 29 | | ^^^^ | |
| 29 | | ^^^^^^ | |
| 30 | 30 | |
| 31 | 31 | error: `~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 | |
| 33 | 33 | | |
| 34 | 34 | LL | const fn test() -> impl ~const Fn() { |
| 35 | | ^^^^ | |
| 35 | | ^^^^^^ | |
| 36 | 36 | | |
| 37 | 37 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 38 | 38 |
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 {} |
| 37 | 37 | = note: adding a non-const method body in the future would be a breaking change |
| 38 | 38 | |
| 39 | 39 | error: `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 | |
| 41 | 41 | | |
| 42 | 42 | LL | impl<T> const Foo for T where T: const Specialize {} |
| 43 | | ^^^^^^^^^^ | |
| 43 | | ^^^^^ | |
| 44 | 44 | |
| 45 | 45 | error: specialization impl does not specialize any associated items |
| 46 | 46 | --> $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 |
| 4 | 4 | = help: use `-Znext-solver` to enable |
| 5 | 5 | |
| 6 | 6 | error: `~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 | |
| 8 | 8 | | |
| 9 | 9 | LL | const fn with_positive<F: ~const Fn()>() {} |
| 10 | | ^^^^ | |
| 10 | | ^^^^^^ | |
| 11 | 11 | |
| 12 | 12 | error: `~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 | |
| 14 | 14 | | |
| 15 | 15 | LL | const fn with_positive<F: ~const Fn()>() {} |
| 16 | | ^^^^ | |
| 16 | | ^^^^^^ | |
| 17 | 17 | | |
| 18 | 18 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 19 | 19 |
tests/ui/traits/const-traits/issue-92111.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~const` can only be applied to `#[const_trait]` traits |
| 2 | --> $DIR/issue-92111.rs:20:22 | |
| 2 | --> $DIR/issue-92111.rs:20:15 | |
| 3 | 3 | | |
| 4 | 4 | LL | const fn a<T: ~const Destruct>(t: T) {} |
| 5 | | ^^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~const` can only be applied to `#[const_trait]` traits |
| 8 | --> $DIR/issue-92111.rs:20:22 | |
| 8 | --> $DIR/issue-92111.rs:20:15 | |
| 9 | 9 | | |
| 10 | 10 | LL | const fn a<T: ~const Destruct>(t: T) {} |
| 11 | | ^^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/traits/const-traits/item-bound-entailment-fails.stderr+2-2| ... | ... | @@ -17,7 +17,7 @@ note: required by a bound in `Foo::Assoc` |
| 17 | 17 | --> $DIR/item-bound-entailment-fails.rs:6:20 |
| 18 | 18 | | |
| 19 | 19 | LL | type Assoc<T>: ~const Bar |
| 20 | | ^^^^^^^^^^ required by this bound in `Foo::Assoc` | |
| 20 | | ^^^^^^ required by this bound in `Foo::Assoc` | |
| 21 | 21 | |
| 22 | 22 | error[E0277]: the trait bound `T: ~const Bar` is not satisfied |
| 23 | 23 | --> $DIR/item-bound-entailment-fails.rs:25:21 |
| ... | ... | @@ -29,7 +29,7 @@ note: required by a bound in `Foo::Assoc` |
| 29 | 29 | --> $DIR/item-bound-entailment-fails.rs:6:20 |
| 30 | 30 | | |
| 31 | 31 | LL | type Assoc<T>: ~const Bar |
| 32 | | ^^^^^^^^^^ required by this bound in `Foo::Assoc` | |
| 32 | | ^^^^^^ required by this bound in `Foo::Assoc` | |
| 33 | 33 | |
| 34 | 34 | error: aborting due to 2 previous errors; 1 warning emitted |
| 35 | 35 |
tests/ui/traits/const-traits/non-const-op-in-closure-in-const.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | impl<A, B> const Convert<B> for A where B: ~const From<A> { |
| 5 | | ^^^^^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | impl<A, B> const Convert<B> for A where B: ~const From<A> { |
| 11 | | ^^^^^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/traits/const-traits/predicate-entailment-fails.stderr+6-6| ... | ... | @@ -14,7 +14,7 @@ LL | type Bar<T> where T: ~const Bar; |
| 14 | 14 | | ----------- definition of `Bar` from trait |
| 15 | 15 | ... |
| 16 | 16 | LL | type Bar<T> = () where T: const Bar; |
| 17 | | ^^^^^^^^^ impl has extra requirement `T: const Bar` | |
| 17 | | ^^^^^ impl has extra requirement `T: const Bar` | |
| 18 | 18 | |
| 19 | 19 | error[E0276]: impl has stricter requirements than trait |
| 20 | 20 | --> $DIR/predicate-entailment-fails.rs:18:26 |
| ... | ... | @@ -23,7 +23,7 @@ LL | fn foo<T>() where T: ~const Bar; |
| 23 | 23 | | -------------------------------- definition of `foo` from trait |
| 24 | 24 | ... |
| 25 | 25 | LL | fn foo<T>() where T: const Bar {} |
| 26 | | ^^^^^^^^^ impl has extra requirement `T: const Bar` | |
| 26 | | ^^^^^ impl has extra requirement `T: const Bar` | |
| 27 | 27 | |
| 28 | 28 | error[E0276]: impl has stricter requirements than trait |
| 29 | 29 | --> $DIR/predicate-entailment-fails.rs:29:31 |
| ... | ... | @@ -32,7 +32,7 @@ LL | type Bar<T> where T: Bar; |
| 32 | 32 | | ----------- definition of `Bar` from trait |
| 33 | 33 | ... |
| 34 | 34 | LL | type Bar<T> = () where T: const Bar; |
| 35 | | ^^^^^^^^^ impl has extra requirement `T: const Bar` | |
| 35 | | ^^^^^ impl has extra requirement `T: const Bar` | |
| 36 | 36 | |
| 37 | 37 | error[E0276]: impl has stricter requirements than trait |
| 38 | 38 | --> $DIR/predicate-entailment-fails.rs:32:26 |
| ... | ... | @@ -41,7 +41,7 @@ LL | fn foo<T>() where T: Bar; |
| 41 | 41 | | ------------------------- definition of `foo` from trait |
| 42 | 42 | ... |
| 43 | 43 | LL | fn foo<T>() where T: const Bar {} |
| 44 | | ^^^^^^^^^ impl has extra requirement `T: const Bar` | |
| 44 | | ^^^^^ impl has extra requirement `T: const Bar` | |
| 45 | 45 | |
| 46 | 46 | error[E0276]: impl has stricter requirements than trait |
| 47 | 47 | --> $DIR/predicate-entailment-fails.rs:36:31 |
| ... | ... | @@ -50,7 +50,7 @@ LL | type Bar<T> where T: Bar; |
| 50 | 50 | | ----------- definition of `Bar` from trait |
| 51 | 51 | ... |
| 52 | 52 | LL | type Bar<T> = () where T: ~const Bar; |
| 53 | | ^^^^^^^^^^ impl has extra requirement `T: ~const Bar` | |
| 53 | | ^^^^^^ impl has extra requirement `T: ~const Bar` | |
| 54 | 54 | |
| 55 | 55 | error[E0276]: impl has stricter requirements than trait |
| 56 | 56 | --> $DIR/predicate-entailment-fails.rs:39:26 |
| ... | ... | @@ -59,7 +59,7 @@ LL | fn foo<T>() where T: Bar; |
| 59 | 59 | | ------------------------- definition of `foo` from trait |
| 60 | 60 | ... |
| 61 | 61 | LL | fn foo<T>() where T: ~const Bar {} |
| 62 | | ^^^^^^^^^^ impl has extra requirement `T: ~const Bar` | |
| 62 | | ^^^^^^ impl has extra requirement `T: ~const Bar` | |
| 63 | 63 | |
| 64 | 64 | error: aborting due to 6 previous errors; 1 warning emitted |
| 65 | 65 |
tests/ui/traits/const-traits/super-traits-fail-2.nn.stderr+6-6| ... | ... | @@ -11,24 +11,24 @@ LL | trait Bar: ~const Foo {} |
| 11 | 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | 12 | |
| 13 | 13 | error: `~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 | |
| 15 | 15 | | |
| 16 | 16 | LL | trait Bar: ~const Foo {} |
| 17 | | ^^^ | |
| 17 | | ^^^^^^ | |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | trait Bar: ~const Foo {} |
| 23 | | ^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | | |
| 25 | 25 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 26 | 26 | |
| 27 | 27 | error: `~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 | |
| 29 | 29 | | |
| 30 | 30 | LL | trait Bar: ~const Foo {} |
| 31 | | ^^^ | |
| 31 | | ^^^^^^ | |
| 32 | 32 | | |
| 33 | 33 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 34 | 34 |
tests/ui/traits/const-traits/super-traits-fail-2.ny.stderr+10-10| ... | ... | @@ -1,38 +1,38 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | trait Bar: ~const Foo {} |
| 5 | | ^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | trait Bar: ~const Foo {} |
| 11 | | ^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 | |
| 15 | 15 | error: `~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 | |
| 17 | 17 | | |
| 18 | 18 | LL | trait Bar: ~const Foo {} |
| 19 | | ^^^ | |
| 19 | | ^^^^^^ | |
| 20 | 20 | | |
| 21 | 21 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 22 | 22 | |
| 23 | 23 | error: `~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 | |
| 25 | 25 | | |
| 26 | 26 | LL | trait Bar: ~const Foo {} |
| 27 | | ^^^ | |
| 27 | | ^^^^^^ | |
| 28 | 28 | | |
| 29 | 29 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 30 | 30 | |
| 31 | 31 | error: `~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 | |
| 33 | 33 | | |
| 34 | 34 | LL | trait Bar: ~const Foo {} |
| 35 | | ^^^ | |
| 35 | | ^^^^^^ | |
| 36 | 36 | | |
| 37 | 37 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 38 | 38 |
tests/ui/traits/const-traits/super-traits-fail-3.nn.stderr+10-10| ... | ... | @@ -11,38 +11,38 @@ LL | trait Bar: ~const Foo {} |
| 11 | 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | 12 | |
| 13 | 13 | error: `~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 | |
| 15 | 15 | | |
| 16 | 16 | LL | trait Bar: ~const Foo {} |
| 17 | | ^^^ | |
| 17 | | ^^^^^^ | |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | trait Bar: ~const Foo {} |
| 23 | | ^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | | |
| 25 | 25 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 26 | 26 | |
| 27 | 27 | error: `~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 | |
| 29 | 29 | | |
| 30 | 30 | LL | trait Bar: ~const Foo {} |
| 31 | | ^^^ | |
| 31 | | ^^^^^^ | |
| 32 | 32 | | |
| 33 | 33 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 34 | 34 | |
| 35 | 35 | error: `~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 | |
| 37 | 37 | | |
| 38 | 38 | LL | const fn foo<T: ~const Bar>(x: &T) { |
| 39 | | ^^^ | |
| 39 | | ^^^^^^ | |
| 40 | 40 | |
| 41 | 41 | error: `~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 | |
| 43 | 43 | | |
| 44 | 44 | LL | const fn foo<T: ~const Bar>(x: &T) { |
| 45 | | ^^^ | |
| 45 | | ^^^^^^ | |
| 46 | 46 | | |
| 47 | 47 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 48 | 48 |
tests/ui/traits/const-traits/super-traits-fail-3.ny.stderr+10-10| ... | ... | @@ -1,38 +1,38 @@ |
| 1 | 1 | error: `~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 | |
| 3 | 3 | | |
| 4 | 4 | LL | trait Bar: ~const Foo {} |
| 5 | | ^^^ | |
| 5 | | ^^^^^^ | |
| 6 | 6 | |
| 7 | 7 | error: `~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 | |
| 9 | 9 | | |
| 10 | 10 | LL | trait Bar: ~const Foo {} |
| 11 | | ^^^ | |
| 11 | | ^^^^^^ | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 | |
| 15 | 15 | error: `~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 | |
| 17 | 17 | | |
| 18 | 18 | LL | trait Bar: ~const Foo {} |
| 19 | | ^^^ | |
| 19 | | ^^^^^^ | |
| 20 | 20 | | |
| 21 | 21 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 22 | 22 | |
| 23 | 23 | error: `~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 | |
| 25 | 25 | | |
| 26 | 26 | LL | trait Bar: ~const Foo {} |
| 27 | | ^^^ | |
| 27 | | ^^^^^^ | |
| 28 | 28 | | |
| 29 | 29 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 30 | 30 | |
| 31 | 31 | error: `~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 | |
| 33 | 33 | | |
| 34 | 34 | LL | trait Bar: ~const Foo {} |
| 35 | | ^^^ | |
| 35 | | ^^^^^^ | |
| 36 | 36 | | |
| 37 | 37 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 38 | 38 |
tests/ui/traits/const-traits/super-traits-fail-3.yn.stderr+4-4| ... | ... | @@ -11,16 +11,16 @@ LL | trait Bar: ~const Foo {} |
| 11 | 11 | | ^^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | 12 | |
| 13 | 13 | error: `~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 | |
| 15 | 15 | | |
| 16 | 16 | LL | const fn foo<T: ~const Bar>(x: &T) { |
| 17 | | ^^^ | |
| 17 | | ^^^^^^ | |
| 18 | 18 | |
| 19 | 19 | error: `~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 | |
| 21 | 21 | | |
| 22 | 22 | LL | const fn foo<T: ~const Bar>(x: &T) { |
| 23 | | ^^^ | |
| 23 | | ^^^^^^ | |
| 24 | 24 | | |
| 25 | 25 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 26 | 26 |
tests/ui/traits/const-traits/unsatisfied-const-trait-bound.stderr+1-1| ... | ... | @@ -28,7 +28,7 @@ note: required by a bound in `require` |
| 28 | 28 | --> $DIR/unsatisfied-const-trait-bound.rs:8:15 |
| 29 | 29 | | |
| 30 | 30 | LL | fn require<T: const Trait>() {} |
| 31 | | ^^^^^^^^^^^ required by this bound in `require` | |
| 31 | | ^^^^^ required by this bound in `require` | |
| 32 | 32 | |
| 33 | 33 | error: aborting due to 4 previous errors |
| 34 | 34 |
tests/ui/wf/wf-dyn-incompat-trait-obj-match.rs+2-2| ... | ... | @@ -22,8 +22,8 @@ fn main() { |
| 22 | 22 | Some(()) => &S, |
| 23 | 23 | None => &R, //~ ERROR E0308 |
| 24 | 24 | } |
| 25 | let t: &dyn Trait = match opt() { //~ ERROR E0038 | |
| 25 | let t: &dyn Trait = match opt() { | |
| 26 | 26 | Some(()) => &S, //~ ERROR E0038 |
| 27 | None => &R, | |
| 27 | None => &R, //~ ERROR E0038 | |
| 28 | 28 | }; |
| 29 | 29 | } |
tests/ui/wf/wf-dyn-incompat-trait-obj-match.stderr+3-7| ... | ... | @@ -31,14 +31,10 @@ LL | trait Trait: Sized {} |
| 31 | 31 | = note: required for the cast from `&S` to `&dyn Trait` |
| 32 | 32 | |
| 33 | 33 | error[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 | |
| 35 | 35 | | |
| 36 | LL | let t: &dyn Trait = match opt() { | |
| 37 | | _________________________^ | |
| 38 | LL | | Some(()) => &S, | |
| 39 | LL | | None => &R, | |
| 40 | LL | | }; | |
| 41 | | |_____^ `Trait` cannot be made into an object | |
| 36 | LL | None => &R, | |
| 37 | | ^^ `Trait` cannot be made into an object | |
| 42 | 38 | | |
| 43 | 39 | note: 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> |
| 44 | 40 | --> $DIR/wf-dyn-incompat-trait-obj-match.rs:6:14 |