diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index 6a86e9af71826..4c7ae87556f76 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -124,6 +124,11 @@ impl StableHash for Path { self.segments.len().stable_hash(hcx, hasher); for segment in &self.segments { segment.ident.stable_hash(hcx, hasher); + if segment.args.is_some() { + // This should never happen, because Path::stable_hash is only used for attributes, + // which never have generic args. Check that to make sure, though. + panic!("Paths with generic args should not appear in incremental state"); + } } } } @@ -4072,7 +4077,7 @@ pub struct TestBinderBody { pub exists: ThinVec, pub constraints: Vec, /// These are not where clauses, but rather predicates within the body to be proven - pub predicates: Vec, + pub predicates: Vec, } #[derive(Clone, Encodable, Decodable, Debug, Walkable)] @@ -4100,6 +4105,9 @@ pub enum TestBinderConstraint { Or { items: ThinVec, }, + Ambiguity { + span: Span, + }, Lifetime { #[visitable(extra = LifetimeCtxt::Bound)] lhs: Lifetime, diff --git a/compiler/rustc_ast_lowering/src/delegation/resolution.rs b/compiler/rustc_ast_lowering/src/delegation/resolution.rs index 7678418c47e56..8e35b05d7e870 100644 --- a/compiler/rustc_ast_lowering/src/delegation/resolution.rs +++ b/compiler/rustc_ast_lowering/src/delegation/resolution.rs @@ -4,7 +4,6 @@ use ast::visit::Visitor; use hir::def::DefKind; use rustc_ast::{self as ast, AssocItemKind, Delegation, DelegationSource, Item, ItemKind, NodeId}; use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; -use rustc_data_structures::steal::Steal; use rustc_hir as hir; use rustc_middle::middle::resolve::{ self as mid_res, AstOwner, DelegationInherentFnKind, TypeRelativeDelegationRes, @@ -53,9 +52,10 @@ pub(crate) fn resolve_type_relative_delegations( // Also record resolutions for cases when signature is resolved but call path is not. mid_res::DelegationResolution::Partial | mid_res::DelegationResolution::PartialCall(_) => { - let Some(r_and_owner) = ast_index.get(def_id).map(Steal::borrow) else { - unreachable!("ast index must contain delegations"); - }; + let r_and_owner = ast_index[def_id] + .as_ref() + .expect("ast index must contain delegations") + .borrow(); let (r, owner) = &*r_and_owner; diff --git a/compiler/rustc_ast_lowering/src/item.rs b/compiler/rustc_ast_lowering/src/item.rs index 9698ab0aedb83..9cea3519cf94e 100644 --- a/compiler/rustc_ast_lowering/src/item.rs +++ b/compiler/rustc_ast_lowering/src/item.rs @@ -2003,7 +2003,6 @@ impl<'hir> LoweringContext<'_, 'hir> { let predicates = self.arena.alloc_from_iter( body.predicates .iter() - .flat_map(|w| &w.predicates) .map(|predicate| self.lower_where_predicate(predicate, &[], &mut dedup_map)), ); hir::TestBinderBody { foralls, exists, constraints, predicates } @@ -2083,6 +2082,9 @@ impl<'hir> LoweringContext<'_, 'hir> { items.iter().map(|item| self.lower_test_binder_constraint(item)), ), }, + TestBinderConstraint::Ambiguity { span } => { + hir::TestBinderConstraint::Ambiguity { span: self.lower_span(*span) } + } TestBinderConstraint::Lifetime { lhs, rhs } => { let lhs = self.lower_lifetime(lhs, LifetimeSource::Other, lhs.ident.into()); let rhs = self.lower_lifetime(rhs, LifetimeSource::OutlivesBound, rhs.ident.into()); diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs index b6d1017665ec6..a99db03007b51 100644 --- a/compiler/rustc_ast_lowering/src/lib.rs +++ b/compiler/rustc_ast_lowering/src/lib.rs @@ -587,7 +587,7 @@ enum TryBlockScope { fn index_ast<'tcx>( tcx: TyCtxt<'tcx>, (): (), -) -> &'tcx IndexSlice>, AstOwner)>> { +) -> &'tcx IndexSlice>, AstOwner)>>> { // Queries that borrow `resolver_for_lowering`. tcx.ensure_done().output_filenames(()); tcx.ensure_done().early_lint_checks(()); @@ -610,20 +610,19 @@ fn index_ast<'tcx>( let index = indexer.index; let resolver = Arc::new(resolver); return tcx.arena.alloc_index_slice_from_iter::( - index.into_iter().map(|owner| Steal::new((Arc::clone(&resolver), owner))), + index.into_iter().map(|owner| owner.map(|o| Steal::new((Arc::clone(&resolver), o)))), ); struct Indexer<'s, 'hir> { owners: &'s NodeMap>, - index: IndexVec, + index: IndexVec>, next_node_id: NodeId, } impl Indexer<'_, '_> { fn insert(&mut self, id: NodeId, node: AstOwner) { let def_id = self.owners[&id].def_id; - self.index.ensure_contains_elem(def_id, || AstOwner::NonOwner); - self.index[def_id] = node; + self.index.insert(def_id, node); } fn make_dummy( @@ -705,7 +704,7 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { tcx.ensure_done().resolve_type_relative_delegations(()); let ast_index = tcx.index_ast(()); - let resolver_and_node = ast_index.get(def_id).map(Steal::steal); + let resolver_and_node = ast_index.get(def_id); let fallback_to_ancestor = || { // The item did not exist in the AST, it was created while lowering another item. @@ -732,10 +731,13 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { }) }; - let Some((resolver, node)) = resolver_and_node else { + let Some(Some(r_and_node)) = resolver_and_node else { // `ast_index` does not contain all definitions, only up-to the highest // `LocalDefId` which has a non-trivial `AstOwner`. Gracefully handle // other definitions, in particular those nested inside this highest definition. + // OR + // The item existed in the AST, but is not a HIR owner. + // Fetch the correct information from its parent. return fallback_to_ancestor(); }; @@ -750,6 +752,8 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { hir::MaybeOwner::Owner(lctx.curr_owner.into_owner_info(tcx, item)) } + let (resolver, node) = r_and_node.steal(); + let item = match &node { // The item existed in the AST. AstOwner::Crate(c) => with_lctx(tcx, &*resolver, CRATE_NODE_ID, |lctx| { @@ -770,9 +774,6 @@ fn lower_to_hir(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::MaybeOwner<'_> { AstOwner::ForeignItem(item) => with_lctx(tcx, &*resolver, item.id, |lctx| { hir::OwnerNode::ForeignItem(lctx.lower_foreign_item(item)) }), - // The item existed in the AST, but is not a HIR owner. - // Fetch the correct information from its parent. - AstOwner::NonOwner => fallback_to_ancestor(), }; tcx.sess.time("drop_ast", || mem::drop(node)); diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index b7c930502978e..928d57065d173 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -2187,9 +2187,8 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> { llfn: &'ll Value, fn_abi: Option<&FnAbi<'tcx, Ty<'tcx>>>, ) -> Option> { - if self.sess().pointer_authentication_functions().is_none() { - return None; - } + let schema = self.sess().pointer_authentication_functions()?; + // Pointer authentication support is currently limited to extern "C" calls; filter out other // ABIs. if fn_abi?.conv != CanonAbi::C { @@ -2207,11 +2206,12 @@ impl<'a, 'll, 'tcx> Builder<'a, 'll, 'tcx> { // bundles. // Once this is resolved, we should analyze each call and skip direct calls. See the // discussion in the rust-lang issue: - let key: u32 = 0; - let discriminator: u64 = 0; Some(llvm::OperandBundleBox::new( "ptrauth", - &[self.const_u32(key), self.const_u64(discriminator)], + &[ + self.const_u32(schema.key as u32), + self.const_u64(schema.constant_discriminator as u64), + ], )) } diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs index ec58c3cb6ad7a..6513cc0542ea5 100644 --- a/compiler/rustc_codegen_llvm/src/consts.rs +++ b/compiler/rustc_codegen_llvm/src/consts.rs @@ -212,7 +212,7 @@ fn check_and_apply_linkage<'ll, 'tcx>( let fn_sig = sig.with(*header); let fn_abi = cx.fn_abi_of_fn_ptr(fn_sig, ty::List::empty()); // Decide if the initializer needs to be signed - if cx.sess().pointer_authentication() + if cx.sess().pointer_authentication_functions().is_some() && matches!(fn_sig.abi(), ExternAbi::C { .. } | ExternAbi::System { .. }) { should_sign = true; @@ -249,13 +249,16 @@ fn check_and_apply_linkage<'ll, 'tcx>( // Sign the function pointer that is used to initialize the global let initializer = if should_sign { - let key: u32 = 0; - let discriminator: u64 = 0; + let schema = cx + .tcx + .sess + .pointer_authentication_functions() + .expect("pointer authentication functions must be available when signing"); const_ptr_auth( cx.const_bitcast(g1, llty), - key, - discriminator, + schema.key as u32, + schema.constant_discriminator as u64, None, /* address_diversity */ ) } else { diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 4f4ed83be06a3..ceb7f38c2a416 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -4556,6 +4556,7 @@ pub struct TestBinderExists<'hir> { pub enum TestBinderConstraint<'hir> { And { items: &'hir [TestBinderConstraint<'hir>] }, Or { items: &'hir [TestBinderConstraint<'hir>] }, + Ambiguity { span: Span }, Lifetime { lhs: &'hir Lifetime, rhs: &'hir Lifetime }, PlaceholderOutlives { lhs: &'hir Ty<'hir>, rhs: &'hir Lifetime }, AliasOutlives { bound_type_constraint: &'hir TestBinderBoundTypeConstraint<'hir> }, diff --git a/compiler/rustc_hir/src/intravisit.rs b/compiler/rustc_hir/src/intravisit.rs index ad96fe492e6e7..b404d1708b85b 100644 --- a/compiler/rustc_hir/src/intravisit.rs +++ b/compiler/rustc_hir/src/intravisit.rs @@ -1644,6 +1644,7 @@ pub fn walk_test_binder_constraint<'v, V: Visitor<'v>>( TestBinderConstraint::Or { items } => { walk_list!(visitor, visit_test_binder_constraint, *items) } + TestBinderConstraint::Ambiguity { span: _ } => {} TestBinderConstraint::Lifetime { lhs, rhs } => { try_visit!(visitor.visit_lifetime(lhs)); try_visit!(visitor.visit_lifetime(rhs)); diff --git a/compiler/rustc_hir_analysis/src/collect.rs b/compiler/rustc_hir_analysis/src/collect.rs index 1cd1fc356ca7d..51a45eb53aa27 100644 --- a/compiler/rustc_hir_analysis/src/collect.rs +++ b/compiler/rustc_hir_analysis/src/collect.rs @@ -448,6 +448,9 @@ impl<'tcx> ItemCtxt<'tcx> { .map(|item| self.lower_test_binder_constraint(item)) .reduce(SolverRegionConstraint::build_or) .unwrap_or(SolverRegionConstraint::new_false()), + rustc_hir::TestBinderConstraint::Ambiguity { span } => { + SolverRegionConstraint::new_ambig(*span) + } hir::TestBinderConstraint::Lifetime { lhs, rhs } => { let span = lhs.ident.span.to(rhs.ident.span); let lhs = self.lowerer().lower_lifetime(lhs, RegionInferReason::RegionPredicate); diff --git a/compiler/rustc_middle/src/arena.rs b/compiler/rustc_middle/src/arena.rs index a423b6bdca5b2..d2e6c4bbe2466 100644 --- a/compiler/rustc_middle/src/arena.rs +++ b/compiler/rustc_middle/src/arena.rs @@ -43,10 +43,10 @@ rustc_arena::declare_arena! { rustc_middle::middle::resolve::ResolverAstLowering<'tcx> >, index_ast: - rustc_data_structures::steal::Steal<( + Option>, rustc_middle::middle::resolve::AstOwner - )>, + )>>, crate_alone: rustc_data_structures::steal::Steal, crate_for_resolver: rustc_data_structures::steal::Steal<(rustc_ast::Crate, rustc_ast::AttrVec)>, resolutions: rustc_middle::middle::resolve::ResolverGlobalCtxt, diff --git a/compiler/rustc_middle/src/middle/resolve.rs b/compiler/rustc_middle/src/middle/resolve.rs index bafb45469a56e..013edbf24739a 100644 --- a/compiler/rustc_middle/src/middle/resolve.rs +++ b/compiler/rustc_middle/src/middle/resolve.rs @@ -332,8 +332,6 @@ pub type DocLinkResMap = FxIndexMap<(Symbol, Namespace), Option>>; /// is as good a place as any for it. #[derive(Debug)] pub enum AstOwner { - /// This definition does not correspond to a HIR owner. - NonOwner, Crate(Box), Item(Box), TraitItem(Box), diff --git a/compiler/rustc_middle/src/queries.rs b/compiler/rustc_middle/src/queries.rs index d9d618519446d..d0429df43d1dd 100644 --- a/compiler/rustc_middle/src/queries.rs +++ b/compiler/rustc_middle/src/queries.rs @@ -206,13 +206,11 @@ rustc_queries! { desc { "getting the resolver for lowering" } } - query index_ast(_: ()) -> &'tcx IndexSlice>, - AstOwner, - )>> { + // There is only a single `ResolverAstLowering` for all owners. + // We want to drop it once the whole HIR has been lowered. + // We rely on reference counting to know when all definitions have been stolen. + // None if the `LocalDefId` is not an owner. + query index_ast(_: ()) -> &'tcx IndexSlice>, AstOwner)>>> { eval_always no_hash desc { "getting the AST for lowering" } diff --git a/compiler/rustc_mir_transform/src/gvn.rs b/compiler/rustc_mir_transform/src/gvn.rs index b5fa022a527e5..e1b1f6f9ff68c 100644 --- a/compiler/rustc_mir_transform/src/gvn.rs +++ b/compiler/rustc_mir_transform/src/gvn.rs @@ -1950,6 +1950,8 @@ fn op_to_prop_const<'tcx>( // Transmuting a constant is just an offset in the allocation. If the alignment of the // allocation is not enough, fallback to copying into a properly aligned value. && alloc.inner().align >= op.layout.align.abi + // If this is a packed field the offset must also be sufficiently aligned. + && offset.bytes().is_multiple_of(op.layout.align.abi.bytes()) { return Some(ConstValue::Indirect { alloc_id, offset }); } diff --git a/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs b/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs index 75c7513758cd0..ea19d36f5d0cf 100644 --- a/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs +++ b/compiler/rustc_next_trait_solver/src/canonical/canonicalizer.rs @@ -13,12 +13,17 @@ use thin_vec::ThinVec; use crate::delegate::SolverDelegate; /// Does this have infer/placeholder/param, free regions or ReErased? +// We're explicitly checking for fresh types and consts to trigger an +// assert if they ever leak into the trait solver. They should never +// exist with the new solver. const NEEDS_CANONICAL: TypeFlags = TypeFlags::from_bits( TypeFlags::HAS_INFER.bits() | TypeFlags::HAS_PLACEHOLDER.bits() | TypeFlags::HAS_PARAM.bits() | TypeFlags::HAS_FREE_REGIONS.bits() - | TypeFlags::HAS_RE_ERASED.bits(), + | TypeFlags::HAS_RE_ERASED.bits() + | TypeFlags::HAS_TY_FRESH.bits() + | TypeFlags::HAS_CT_FRESH.bits(), ) .unwrap(); diff --git a/compiler/rustc_parse/src/parser/generics.rs b/compiler/rustc_parse/src/parser/generics.rs index 5d2aa1bed5b6e..8dc679c3e62ca 100644 --- a/compiler/rustc_parse/src/parser/generics.rs +++ b/compiler/rustc_parse/src/parser/generics.rs @@ -1,6 +1,6 @@ use rustc_ast::{ self as ast, AttrVec, DUMMY_NODE_ID, GenericBounds, GenericParam, GenericParamKind, TyKind, - WhereClause, token, + WhereClause, WherePredicate, token, }; use rustc_errors::{Applicability, Diag, PResult}; use rustc_span::{Ident, Span, kw, sym}; @@ -411,15 +411,15 @@ impl<'a> Parser<'a> { &mut self, struct_: Option<(Ident, Span)>, ) -> PResult<'a, (WhereClause, Option>)> { - let mut where_clause = WhereClause { - has_where_token: false, - predicates: ThinVec::new(), - span: self.prev_token.span.shrink_to_hi(), - }; - let mut tuple_struct_body = None; - if !self.eat_keyword(exp!(Where)) { - return Ok((where_clause, None)); + return Ok(( + WhereClause { + has_where_token: false, + predicates: ThinVec::new(), + span: self.prev_token.span.shrink_to_hi(), + }, + None, + )); } if self.eat_noexpect(&token::Colon) { @@ -435,7 +435,6 @@ impl<'a> Parser<'a> { .emit(); } - where_clause.has_where_token = true; let where_lo = self.prev_token.span; // We are considering adding generics to the `where` keyword as an alternative higher-rank @@ -446,6 +445,24 @@ impl<'a> Parser<'a> { self.dcx().emit_err(diagnostics::WhereOnGenerics { span: generics.span }); } + let (predicates, tuple_struct_body) = + self.parse_where_clause_predicates(struct_, where_lo)?; + let where_clause = WhereClause { + has_where_token: true, + predicates, + span: where_lo.to(self.prev_token.span), + }; + Ok((where_clause, tuple_struct_body)) + } + + pub(super) fn parse_where_clause_predicates( + &mut self, + struct_: Option<(Ident, Span)>, + where_lo: Span, + ) -> PResult<'a, (ThinVec, Option>)> { + let mut predicates = ThinVec::new(); + let mut tuple_struct_body = None; + loop { let where_sp = where_lo.to(self.prev_token.span); let attrs = self.parse_outer_attributes()?; @@ -498,7 +515,7 @@ impl<'a> Parser<'a> { Ok((predicate, Trailing::No, UsePreAttrPos::No)) })?; match predicate { - Some(predicate) => where_clause.predicates.push(predicate), + Some(predicate) => predicates.push(predicate), None => break, } @@ -516,8 +533,7 @@ impl<'a> Parser<'a> { } } - where_clause.span = where_lo.to(self.prev_token.span); - Ok((where_clause, tuple_struct_body)) + Ok((predicates, tuple_struct_body)) } fn parse_ty_where_predicate_kind_or_recover_tuple_struct_body( diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 9fb16bc3fbf27..6d3d79bbe2b5c 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -2718,11 +2718,12 @@ impl<'a> Parser<'a> { let mut constraints = Vec::new(); let mut predicates = Vec::new(); self.parse_delim_comma_seq(exp!(OpenBrace), exp!(CloseBrace), |this| { - if this.check_keyword(exp!(Where)) { - predicates.push(this.parse_where_clause()?); - return Ok(()); - } match this.token.ident() { + Some((Ident { name: sym::predicates, .. }, IdentKind::Normal)) => { + let span = this.token.span; + this.bump(); + predicates.extend(this.parse_where_clause_predicates(None, span)?.0); + } Some((Ident { name: sym::forall, .. }, IdentKind::Normal)) => { foralls.push(this.parse_test_binder_forall()?) } @@ -2791,6 +2792,11 @@ impl<'a> Parser<'a> { .0; Ok(TestBinderConstraint::Or { items }) } + Some((Ident { name: sym::ambiguity, .. }, IdentKind::Normal)) => { + let span = self.token.span; + self.bump(); + Ok(TestBinderConstraint::Ambiguity { span }) + } _ if self.check_keyword(exp!(For)) => { let bound_type_constraint = self.parse_test_binder_bound_type_constraint()?; Ok(TestBinderConstraint::AliasOutlives { bound_type_constraint }) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index fa59c1c54ee89..dfcc8be029afe 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -427,6 +427,7 @@ symbols! { altivec, alu32, always, + ambiguity, amdgpu, amdgpu_dispatch_ptr, analysis, diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs index f8b4ebb5841c7..7adb17d051aa0 100644 --- a/src/bootstrap/src/core/builder/mod.rs +++ b/src/bootstrap/src/core/builder/mod.rs @@ -1120,10 +1120,9 @@ impl<'a> Builder<'a> { Subcommand::Run { .. } => (Kind::Run, &paths[..]), Subcommand::Clean { .. } => (Kind::Clean, &paths[..]), Subcommand::Format { .. } => (Kind::Format, &[][..]), - Subcommand::Setup { profile: ref path } => ( - Kind::Setup, - path.as_ref().map_or([].as_slice(), |path| std::slice::from_ref(path)), - ), + Subcommand::Setup { profile: ref path } => { + (Kind::Setup, path.as_ref().map_or([].as_slice(), std::slice::from_ref)) + } Subcommand::Vendor { .. } => (Kind::Vendor, &paths[..]), Subcommand::Perf { .. } => (Kind::Perf, &paths[..]), }; diff --git a/src/tools/enzyme b/src/tools/enzyme index fa6e20ebd80f0..ede97b5c7b8d1 160000 --- a/src/tools/enzyme +++ b/src/tools/enzyme @@ -1 +1 @@ -Subproject commit fa6e20ebd80f0e28219abaf174d95baf1513ce92 +Subproject commit ede97b5c7b8d1ddacd5383601798a67aaac2077c diff --git a/src/tools/nix-dev-shell/x/default.nix b/src/tools/nix-dev-shell/x/default.nix index 915158080e421..db42d57249ede 100644 --- a/src/tools/nix-dev-shell/x/default.nix +++ b/src/tools/nix-dev-shell/x/default.nix @@ -29,13 +29,12 @@ stdenv.mkDerivation (self: { dontUnpack = true; nativeBuildInputs = [ - rustc makeBinaryWrapper ]; env.PYTHON = python3.interpreter; buildPhase = '' - rustc -Copt-level=3 --crate-name x $src --out-dir $unwrapped/bin + ${rustc}/bin/rustc -Copt-level=3 --crate-name x $src --out-dir $unwrapped/bin ''; installPhase = diff --git a/src/tools/rustc-perf b/src/tools/rustc-perf index 94df17b4a0fba..208d929efe770 160000 --- a/src/tools/rustc-perf +++ b/src/tools/rustc-perf @@ -1 +1 @@ -Subproject commit 94df17b4a0fbafae5e534b6a754a6a6ee7d51708 +Subproject commit 208d929efe770996eb02cd3d2712623ea48b7646 diff --git a/tests/coverage/attr/impl.cov-map b/tests/coverage/attr/impl.cov-map index 0562c291e6c17..b1dea8fb3da45 100644 --- a/tests/coverage/attr/impl.cov-map +++ b/tests/coverage/attr/impl.cov-map @@ -1,30 +1,30 @@ Function name: ::off_on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 0f, 05, 00, 10, 00, 00, 12, 00, 13] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 0e, 05, 00, 10, 00, 00, 12, 00, 13] Number of files: 1 - file 0 => $DIR/impl.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 15, 5) to (start + 0, 16) +- Code(Zero) at (prev + 14, 5) to (start + 0, 16) - Code(Zero) at (prev + 0, 18) to (start + 0, 19) Highest counter ID seen: (none) Function name: ::on_inherit (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 17, 05, 00, 14, 00, 00, 16, 00, 17] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 16, 05, 00, 14, 00, 00, 16, 00, 17] Number of files: 1 - file 0 => $DIR/impl.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 23, 5) to (start + 0, 20) +- Code(Zero) at (prev + 22, 5) to (start + 0, 20) - Code(Zero) at (prev + 0, 22) to (start + 0, 23) Highest counter ID seen: (none) Function name: ::on_on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 1a, 05, 00, 0f, 00, 00, 11, 00, 12] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 19, 05, 00, 0f, 00, 00, 11, 00, 12] Number of files: 1 - file 0 => $DIR/impl.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 26, 5) to (start + 0, 15) +- Code(Zero) at (prev + 25, 5) to (start + 0, 15) - Code(Zero) at (prev + 0, 17) to (start + 0, 18) Highest counter ID seen: (none) diff --git a/tests/coverage/attr/impl.coverage b/tests/coverage/attr/impl.coverage index 670c1c36a96d6..560429fb5fe5d 100644 --- a/tests/coverage/attr/impl.coverage +++ b/tests/coverage/attr/impl.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks, LL| |// and is inherited by any enclosed functions. diff --git a/tests/coverage/attr/impl.rs b/tests/coverage/attr/impl.rs index c720a4cd6b206..d4d784a3502b9 100644 --- a/tests/coverage/attr/impl.rs +++ b/tests/coverage/attr/impl.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Checks that `#[coverage(..)]` can be applied to impl and impl-trait blocks, // and is inherited by any enclosed functions. diff --git a/tests/coverage/attr/module.cov-map b/tests/coverage/attr/module.cov-map index 88f4915bfe8f7..7464ad022d4c2 100644 --- a/tests/coverage/attr/module.cov-map +++ b/tests/coverage/attr/module.cov-map @@ -1,30 +1,30 @@ Function name: module::off::on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 0d, 05, 00, 0c, 00, 00, 0e, 00, 0f] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 0c, 05, 00, 0c, 00, 00, 0e, 00, 0f] Number of files: 1 - file 0 => $DIR/module.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 13, 5) to (start + 0, 12) +- Code(Zero) at (prev + 12, 5) to (start + 0, 12) - Code(Zero) at (prev + 0, 14) to (start + 0, 15) Highest counter ID seen: (none) Function name: module::on::inherit (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 15, 05, 00, 11, 00, 00, 13, 00, 14] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 14, 05, 00, 11, 00, 00, 13, 00, 14] Number of files: 1 - file 0 => $DIR/module.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 21, 5) to (start + 0, 17) +- Code(Zero) at (prev + 20, 5) to (start + 0, 17) - Code(Zero) at (prev + 0, 19) to (start + 0, 20) Highest counter ID seen: (none) Function name: module::on::on (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 18, 05, 00, 0c, 00, 00, 0e, 00, 0f] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 17, 05, 00, 0c, 00, 00, 0e, 00, 0f] Number of files: 1 - file 0 => $DIR/module.rs Number of expressions: 0 Number of file 0 mappings: 2 -- Code(Zero) at (prev + 24, 5) to (start + 0, 12) +- Code(Zero) at (prev + 23, 5) to (start + 0, 12) - Code(Zero) at (prev + 0, 14) to (start + 0, 15) Highest counter ID seen: (none) diff --git a/tests/coverage/attr/module.coverage b/tests/coverage/attr/module.coverage index bba021b9b4766..c1b9f0e35c0b1 100644 --- a/tests/coverage/attr/module.coverage +++ b/tests/coverage/attr/module.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Checks that `#[coverage(..)]` can be applied to modules, and is inherited LL| |// by any enclosed functions. diff --git a/tests/coverage/attr/module.rs b/tests/coverage/attr/module.rs index 1d17ac7d503e4..4bfb1e7729b7d 100644 --- a/tests/coverage/attr/module.rs +++ b/tests/coverage/attr/module.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Checks that `#[coverage(..)]` can be applied to modules, and is inherited // by any enclosed functions. diff --git a/tests/coverage/attr/nested.cov-map b/tests/coverage/attr/nested.cov-map index ae8af35e507de..7afa65a1f3be5 100644 --- a/tests/coverage/attr/nested.cov-map +++ b/tests/coverage/attr/nested.cov-map @@ -1,21 +1,21 @@ Function name: nested::closure_expr -Raw bytes (19): 0x[01, 01, 00, 03, 01, 40, 01, 00, 12, 01, 0b, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 3f, 01, 00, 12, 01, 0b, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/nested.rs Number of expressions: 0 Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 64, 1) to (start + 0, 18) +- Code(Counter(0)) at (prev + 63, 1) to (start + 0, 18) - Code(Counter(0)) at (prev + 11, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: nested::closure_tail -Raw bytes (19): 0x[01, 01, 00, 03, 01, 4f, 01, 00, 12, 01, 11, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 4e, 01, 00, 12, 01, 11, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/nested.rs Number of expressions: 0 Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 79, 1) to (start + 0, 18) +- Code(Counter(0)) at (prev + 78, 1) to (start + 0, 18) - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/attr/nested.coverage b/tests/coverage/attr/nested.coverage index a0bf05a423534..1c5fbcb671e15 100644 --- a/tests/coverage/attr/nested.coverage +++ b/tests/coverage/attr/nested.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute, stmt_expr_attributes)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Demonstrates the interaction between #[coverage(off)] and various kinds of LL| |// nested function. diff --git a/tests/coverage/attr/nested.rs b/tests/coverage/attr/nested.rs index 042fcc5319aee..8213e29b6fcd9 100644 --- a/tests/coverage/attr/nested.rs +++ b/tests/coverage/attr/nested.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute, stmt_expr_attributes)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Demonstrates the interaction between #[coverage(off)] and various kinds of // nested function. diff --git a/tests/coverage/attr/off-on-sandwich.cov-map b/tests/coverage/attr/off-on-sandwich.cov-map index ef31c56fcaa2f..61daef8d15452 100644 --- a/tests/coverage/attr/off-on-sandwich.cov-map +++ b/tests/coverage/attr/off-on-sandwich.cov-map @@ -1,34 +1,34 @@ Function name: off_on_sandwich::dense_a::dense_b -Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 05, 00, 11, 01, 01, 09, 00, 12, 01, 01, 09, 00, 12, 01, 05, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 0f, 05, 00, 11, 01, 01, 09, 00, 12, 01, 01, 09, 00, 12, 01, 05, 05, 00, 06] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 16, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 15, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18) - Code(Counter(0)) at (prev + 5, 5) to (start + 0, 6) Highest counter ID seen: c0 Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c -Raw bytes (24): 0x[01, 01, 00, 04, 01, 22, 09, 00, 16, 01, 01, 0d, 00, 17, 01, 01, 0d, 00, 17, 01, 09, 09, 00, 0a] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 09, 00, 16, 01, 01, 0d, 00, 17, 01, 01, 0d, 00, 17, 01, 09, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 34, 9) to (start + 0, 22) +- Code(Counter(0)) at (prev + 33, 9) to (start + 0, 22) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 23) - Code(Counter(0)) at (prev + 9, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c::sparse_d -Raw bytes (24): 0x[01, 01, 00, 04, 01, 25, 0d, 00, 1a, 01, 01, 11, 00, 1b, 01, 01, 11, 00, 1b, 01, 05, 0d, 00, 0e] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 24, 0d, 00, 1a, 01, 01, 11, 00, 1b, 01, 01, 11, 00, 1b, 01, 05, 0d, 00, 0e] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 37, 13) to (start + 0, 26) +- Code(Counter(0)) at (prev + 36, 13) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 17) to (start + 0, 27) - Code(Counter(0)) at (prev + 1, 17) to (start + 0, 27) - Code(Counter(0)) at (prev + 5, 13) to (start + 0, 14) diff --git a/tests/coverage/attr/off-on-sandwich.coverage b/tests/coverage/attr/off-on-sandwich.coverage index 4fbc388490306..675697906ee76 100644 --- a/tests/coverage/attr/off-on-sandwich.coverage +++ b/tests/coverage/attr/off-on-sandwich.coverage @@ -1,6 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |// Demonstrates the interaction of `#[coverage(off)]` and `#[coverage(on)]` LL| |// in nested functions. diff --git a/tests/coverage/attr/off-on-sandwich.rs b/tests/coverage/attr/off-on-sandwich.rs index 3d914c99b625e..261634e00296a 100644 --- a/tests/coverage/attr/off-on-sandwich.rs +++ b/tests/coverage/attr/off-on-sandwich.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.nesting // Demonstrates the interaction of `#[coverage(off)]` and `#[coverage(on)]` // in nested functions. diff --git a/tests/coverage/attr/trait-impl-inherit.cov-map b/tests/coverage/attr/trait-impl-inherit.cov-map index bf10083dd2909..14c65777b170b 100644 --- a/tests/coverage/attr/trait-impl-inherit.cov-map +++ b/tests/coverage/attr/trait-impl-inherit.cov-map @@ -1,10 +1,10 @@ Function name: ::f -Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 10, 01, 01, 09, 00, 11, 01, 00, 12, 00, 1a, 01, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 05, 00, 10, 01, 01, 09, 00, 11, 01, 00, 12, 00, 1a, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/trait-impl-inherit.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 17, 5) to (start + 0, 16) +- Code(Counter(0)) at (prev + 16, 5) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) diff --git a/tests/coverage/attr/trait-impl-inherit.coverage b/tests/coverage/attr/trait-impl-inherit.coverage index b92d82aefbc8c..a1431ce98340a 100644 --- a/tests/coverage/attr/trait-impl-inherit.coverage +++ b/tests/coverage/attr/trait-impl-inherit.coverage @@ -2,7 +2,6 @@ LL| |// Checks that `#[coverage(..)]` in a trait method is not inherited in an LL| |// implementation. LL| |//@ edition: 2021 - LL| |//@ reference: attributes.coverage.trait-impl-inherit LL| | LL| |trait T { LL| | #[coverage(off)] diff --git a/tests/coverage/attr/trait-impl-inherit.rs b/tests/coverage/attr/trait-impl-inherit.rs index 951fecce90a18..a36f9d0fcbc3d 100644 --- a/tests/coverage/attr/trait-impl-inherit.rs +++ b/tests/coverage/attr/trait-impl-inherit.rs @@ -2,7 +2,6 @@ // Checks that `#[coverage(..)]` in a trait method is not inherited in an // implementation. //@ edition: 2021 -//@ reference: attributes.coverage.trait-impl-inherit trait T { #[coverage(off)] diff --git a/tests/coverage/iffy/no_cov_crate.cov-map b/tests/coverage/iffy/no_cov_crate.cov-map index e447cac4d8da9..235da4a05bba3 100644 --- a/tests/coverage/iffy/no_cov_crate.cov-map +++ b/tests/coverage/iffy/no_cov_crate.cov-map @@ -1,46 +1,46 @@ Function name: no_cov_crate::add_coverage_1 -Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 14, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 22, 1) to (start + 0, 20) +- Code(Counter(0)) at (prev + 20, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: no_cov_crate::add_coverage_2 -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 18, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 26, 1) to (start + 0, 20) +- Code(Counter(0)) at (prev + 24, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) - Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: no_cov_crate::add_coverage_not_called (unused) -Raw bytes (24): 0x[01, 01, 00, 04, 00, 1f, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 26, 00, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 00, 1d, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 26, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 4 -- Code(Zero) at (prev + 31, 1) to (start + 0, 29) +- Code(Zero) at (prev + 29, 1) to (start + 0, 29) - Code(Zero) at (prev + 1, 5) to (start + 0, 13) - Code(Zero) at (prev + 0, 14) to (start + 0, 38) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: (none) Function name: no_cov_crate::main -Raw bytes (54): 0x[01, 01, 00, 0a, 01, 4f, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 02, 05, 00, 1c, 01, 01, 05, 00, 1c, 01, 01, 05, 00, 15, 01, 01, 05, 00, 15, 01, 02, 05, 00, 2b, 01, 01, 05, 00, 1f, 01, 01, 05, 00, 2c, 01, 01, 01, 00, 02] +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 4d, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 02, 05, 00, 1c, 01, 01, 05, 00, 1c, 01, 01, 05, 00, 15, 01, 01, 05, 00, 15, 01, 02, 05, 00, 2b, 01, 01, 05, 00, 1f, 01, 01, 05, 00, 2c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 10 -- Code(Counter(0)) at (prev + 79, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 77, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 19) to (start + 0, 46) - Code(Counter(0)) at (prev + 2, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) @@ -53,12 +53,12 @@ Number of file 0 mappings: 10 Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer -Raw bytes (29): 0x[01, 01, 00, 05, 01, 33, 05, 00, 20, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 23, 01, 0a, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 31, 05, 00, 20, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 23, 01, 0a, 05, 00, 06] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 51, 5) to (start + 0, 32) +- Code(Counter(0)) at (prev + 49, 5) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 35) @@ -66,12 +66,12 @@ Number of file 0 mappings: 5 Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer_both_covered -Raw bytes (29): 0x[01, 01, 00, 05, 01, 41, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 17, 01, 09, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 3f, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 17, 01, 09, 05, 00, 06] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 65, 5) to (start + 0, 45) +- Code(Counter(0)) at (prev + 63, 5) to (start + 0, 45) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) - Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 23) @@ -79,13 +79,13 @@ Number of file 0 mappings: 5 Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer_both_covered::inner -Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 45, 09, 00, 20, 01, 01, 10, 00, 17, 05, 01, 11, 00, 19, 05, 00, 1a, 00, 2e, 02, 02, 11, 00, 19, 02, 00, 1a, 00, 32, 01, 02, 09, 00, 0a] +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 43, 09, 00, 20, 01, 01, 10, 00, 17, 05, 01, 11, 00, 19, 05, 00, 1a, 00, 2e, 02, 02, 11, 00, 19, 02, 00, 1a, 00, 32, 01, 02, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 7 -- Code(Counter(0)) at (prev + 69, 9) to (start + 0, 32) +- Code(Counter(0)) at (prev + 67, 9) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 23) - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25) - Code(Counter(1)) at (prev + 0, 26) to (start + 0, 46) diff --git a/tests/coverage/iffy/no_cov_crate.coverage b/tests/coverage/iffy/no_cov_crate.coverage index 70143c0629a35..ff945ca5f6187 100644 --- a/tests/coverage/iffy/no_cov_crate.coverage +++ b/tests/coverage/iffy/no_cov_crate.coverage @@ -1,7 +1,5 @@ LL| |#![feature(coverage_attribute)] LL| |// Enables `coverage(off)` on the entire crate - LL| |//@ reference: attributes.coverage.intro - LL| |//@ reference: attributes.coverage.nesting LL| | LL| |#[coverage(off)] LL| |fn do_not_add_coverage_1() { diff --git a/tests/coverage/iffy/no_cov_crate.rs b/tests/coverage/iffy/no_cov_crate.rs index 72fd6317a1707..88b80b9d41037 100644 --- a/tests/coverage/iffy/no_cov_crate.rs +++ b/tests/coverage/iffy/no_cov_crate.rs @@ -1,7 +1,5 @@ #![feature(coverage_attribute)] // Enables `coverage(off)` on the entire crate -//@ reference: attributes.coverage.intro -//@ reference: attributes.coverage.nesting #[coverage(off)] fn do_not_add_coverage_1() { diff --git a/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff b/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff new file mode 100644 index 0000000000000..aff552d2a6020 --- /dev/null +++ b/tests/mir-opt/gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff @@ -0,0 +1,19 @@ +- // MIR for `non_scalar_field_of_packed` before GVN ++ // MIR for `non_scalar_field_of_packed` after GVN + + fn non_scalar_field_of_packed() -> (u32, u32) { + let mut _0: (u32, u32); + let mut _1: Outer; + + bb0: { + StorageLive(_1); + _1 = const C; +- _0 = copy ((_1.1: Packed).1: (u32, u32)); ++ _0 = const ConstValue(Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: (u32, u32)); + StorageDead(_1); + return; + } + } ++ ++ ALLOC0 (size: 8, align: 4) { .. } + diff --git a/tests/mir-opt/gvn_non_scalar_field_of_packed.rs b/tests/mir-opt/gvn_non_scalar_field_of_packed.rs new file mode 100644 index 0000000000000..52773f93e834e --- /dev/null +++ b/tests/mir-opt/gvn_non_scalar_field_of_packed.rs @@ -0,0 +1,28 @@ +//@ test-mir-pass: GVN +//@ compile-flags: -Zdump-mir-exclude-alloc-bytes -Zverbose-internals + +// This is a regression test for https://github.com/rust-lang/rust/issues/163782 + +#![crate_type = "lib"] + +#[repr(C, packed)] +#[derive(Clone, Copy)] +pub struct Packed { + pub a: u8, + pub b: (u32, u32), +} + +#[derive(Clone, Copy)] +pub struct Outer { + pub x: u32, + pub p: Packed, +} + +const C: Outer = Outer { x: 7, p: Packed { a: 1, b: (2, 3) } }; + +// EMIT_MIR gvn_non_scalar_field_of_packed.non_scalar_field_of_packed.GVN.diff +pub fn non_scalar_field_of_packed() -> (u32, u32) { + // CHECK-LABEL: fn non_scalar_field_of_packed( + // CHECK: _0 = const ConstValue(Indirect { alloc_id: {{.*}}, offset: Size(0 bytes) }: (u32, u32)); + C.p.b +} diff --git a/tests/ui/abi/invalid-self-parameter-type-56806.next.stderr b/tests/ui/abi/invalid-self-parameter-type-56806.next.stderr new file mode 100644 index 0000000000000..2881d01ba23dc --- /dev/null +++ b/tests/ui/abi/invalid-self-parameter-type-56806.next.stderr @@ -0,0 +1,18 @@ +error[E0391]: cycle detected when checking if trait `Trait` is dyn-compatible + --> $DIR/invalid-self-parameter-type-56806.rs:11:1 + | +LL | pub trait Trait { + | ^^^^^^^^^^^^^^^ + | + = note: ...which requires determining dyn-compatibility of trait `Trait`... + = note: ...which again requires checking if trait `Trait` is dyn-compatible, completing the cycle +note: cycle used when checking that `Trait::dyn_instead_of_self` is well-formed + --> $DIR/invalid-self-parameter-type-56806.rs:12:5 + | +LL | fn dyn_instead_of_self(self: Box); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: for more information, see and + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/tests/ui/abi/invalid-self-parameter-type-56806.stderr b/tests/ui/abi/invalid-self-parameter-type-56806.old.stderr similarity index 91% rename from tests/ui/abi/invalid-self-parameter-type-56806.stderr rename to tests/ui/abi/invalid-self-parameter-type-56806.old.stderr index ac249b8f10880..a034de9c3bcb3 100644 --- a/tests/ui/abi/invalid-self-parameter-type-56806.stderr +++ b/tests/ui/abi/invalid-self-parameter-type-56806.old.stderr @@ -1,5 +1,5 @@ error[E0307]: invalid `self` parameter type: `Box<(dyn Trait + 'static)>` - --> $DIR/invalid-self-parameter-type-56806.rs:3:34 + --> $DIR/invalid-self-parameter-type-56806.rs:12:34 | LL | fn dyn_instead_of_self(self: Box); | ^^^^^^^^^^^^^^ diff --git a/tests/ui/abi/invalid-self-parameter-type-56806.rs b/tests/ui/abi/invalid-self-parameter-type-56806.rs index 60229df300577..ac25489f59b32 100644 --- a/tests/ui/abi/invalid-self-parameter-type-56806.rs +++ b/tests/ui/abi/invalid-self-parameter-type-56806.rs @@ -1,7 +1,17 @@ +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver + // https://github.com/rust-lang/rust/issues/56806 +// +// This results in a query cycle with the new solver. Let's not +// bother with this when stabilizing the new solver. For more context, +// see https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/dyn.20compatibility.20check.20in.20object.20candidate.20causes.20cycle/with/627370998 + pub trait Trait { fn dyn_instead_of_self(self: Box); - //~^ ERROR invalid `self` parameter type + //[old]~^ ERROR: invalid `self` parameter type + //[next]~^^^ ERROR: cycle detected when checking if trait `Trait` is dyn-compatible } pub fn main() {} diff --git a/tests/ui/asm/invalid-const-operand.rs b/tests/ui/asm/invalid-const-operand.rs index 083d4f4e18480..a496687011320 100644 --- a/tests/ui/asm/invalid-const-operand.rs +++ b/tests/ui/asm/invalid-const-operand.rs @@ -2,7 +2,7 @@ //@ needs-asm-support //@ ignore-nvptx64 //@ ignore-spirv -//@ reference: asm.operand-type.supported-operands.const +//@ reference: asm.operand-type.supported-operands-const #![feature(asm_const_ptr)] diff --git a/tests/ui/asm/invalid-sym-operand.rs b/tests/ui/asm/invalid-sym-operand.rs index 48df1918daf0f..4340a5c0a86e4 100644 --- a/tests/ui/asm/invalid-sym-operand.rs +++ b/tests/ui/asm/invalid-sym-operand.rs @@ -1,7 +1,7 @@ //@ needs-asm-support //@ ignore-nvptx64 //@ ignore-spirv -//@ reference: asm.operand-type.supported-operands.sym +//@ reference: asm.operand-type.supported-operands-sym use std::arch::{asm, global_asm}; diff --git a/tests/ui/asm/label-operand.rs b/tests/ui/asm/label-operand.rs index f1be5d7d85609..9f5f6e08b22be 100644 --- a/tests/ui/asm/label-operand.rs +++ b/tests/ui/asm/label-operand.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ reference: asm.operand-type.supported-operands.label +//@ reference: asm.operand-type.supported-operands-label //@ revisions: aarch64 arm arm64ec riscv32 riscv64 x86 x86_64 //@ needs-asm-support //@[aarch64] only-aarch64 diff --git a/tests/ui/asm/non-const.rs b/tests/ui/asm/non-const.rs index 2ee4b9c1d70af..f574a8742eea8 100644 --- a/tests/ui/asm/non-const.rs +++ b/tests/ui/asm/non-const.rs @@ -1,5 +1,5 @@ //@ needs-asm-support -//@ reference: asm.operand-type.supported-operands.const +//@ reference: asm.operand-type.supported-operands-const use std::arch::global_asm; diff --git a/tests/ui/asm/noreturn.rs b/tests/ui/asm/noreturn.rs index 59794275d02bd..b93e7f8c12454 100644 --- a/tests/ui/asm/noreturn.rs +++ b/tests/ui/asm/noreturn.rs @@ -1,6 +1,6 @@ //@ needs-asm-support //@ check-pass -//@ reference: asm.options.supported-options.noreturn +//@ reference: asm.options.supported-options-noreturn #![crate_type = "rlib"] diff --git a/tests/ui/asm/tainting-on-error.rs b/tests/ui/asm/tainting-on-error.rs index aa9f33de3753c..30ddde36a651e 100644 --- a/tests/ui/asm/tainting-on-error.rs +++ b/tests/ui/asm/tainting-on-error.rs @@ -1,5 +1,5 @@ //@ needs-asm-support -//@ reference: asm.operand-type.supported-operands.sym +//@ reference: asm.operand-type.supported-operands-sym use std::arch::asm; diff --git a/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs b/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs index 042deefcbb6e5..6e57c780658da 100644 --- a/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs +++ b/tests/ui/assumptions_on_binders/test-infra-fails-properly.rs @@ -74,4 +74,36 @@ core::test_binder_constraints! { } } +core::test_binder_constraints! { + impl { + forall<'a> where 'a: 'static { + } expect { + ambiguity + //~^ ERROR forall expect clause failed + } + } +} + +core::test_binder_constraints! { + impl { + forall<'a> where 'a: 'static { + //~^ ERROR forall expect clause failed + //~| ERROR unable to satisfy constraints involving placeholders due to unknown implied bounds + ambiguity + } expect { + } + } +} + +core::test_binder_constraints! { + impl { + forall<'a> where 'a: 'static { + //~^ ERROR unable to satisfy constraints involving placeholders due to unknown implied bounds + ambiguity + } expect { + ambiguity + } + } +} + fn main() {} diff --git a/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr b/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr index ab025b0e0b9d6..2236a5d95ca89 100644 --- a/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr +++ b/tests/ui/assumptions_on_binders/test-infra-fails-properly.stderr @@ -78,6 +78,57 @@ error: bound type test binder constraint must be alias (it's a AliasTyOutlivesVi LL | for<> T: 'a | ^ -error: aborting due to 9 previous errors +error: forall expect clause failed + --> $DIR/test-infra-fails-properly.rs:81:13 + | +LL | ambiguity + | ^^^^^^^^^ + | + = note: expected: And( + [ + Ambiguity( + $DIR/test-infra-fails-properly.rs:81:13: 81:22 (#0), + ), + ], + ) + = note: actual: And( + [], + ) + +error: forall expect clause failed + --> $DIR/test-infra-fails-properly.rs:89:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + | +note: constraint from here + --> $DIR/test-infra-fails-properly.rs:89:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + = note: expected: And( + [], + ) + = note: actual: And( + [ + Ambiguity( + $DIR/test-infra-fails-properly.rs:89:9: 89:15 (#0), + ), + ], + ) + +error: unable to satisfy constraints involving placeholders due to unknown implied bounds + --> $DIR/test-infra-fails-properly.rs:89:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + +error: unable to satisfy constraints involving placeholders due to unknown implied bounds + --> $DIR/test-infra-fails-properly.rs:100:9 + | +LL | forall<'a> where 'a: 'static { + | ^^^^^^ + +error: aborting due to 13 previous errors For more information about this error, try `rustc --explain E0658`. diff --git a/tests/ui/assumptions_on_binders/test-infra-works.rs b/tests/ui/assumptions_on_binders/test-infra-works.rs index b36e16a545bb3..f7d2a01d936b6 100644 --- a/tests/ui/assumptions_on_binders/test-infra-works.rs +++ b/tests/ui/assumptions_on_binders/test-infra-works.rs @@ -67,11 +67,11 @@ core::test_binder_constraints! { // `impl` should fail because the constraints asserted in `expect` should fail to prove true. Might // be https://github.com/rust-lang/project-assumptions-on-binders/issues/26 // -// `where` syntax goes through the full clause destructuring and register_obligation pipeline +// `predicates` syntax goes through the full clause destructuring and register_obligation pipeline core::test_binder_constraints! { impl { forall<'a> { - where T::Assoc: 'a + predicates T::Assoc: 'a } expect { or { for<'b> T::Assoc: 'b, diff --git a/tests/ui/async-await/inference_var_self_argument.next.stderr b/tests/ui/async-await/inference_var_self_argument.next.stderr new file mode 100644 index 0000000000000..1d321b9f34fde --- /dev/null +++ b/tests/ui/async-await/inference_var_self_argument.next.stderr @@ -0,0 +1,18 @@ +error[E0391]: cycle detected when checking if trait `Foo` is dyn-compatible + --> $DIR/inference_var_self_argument.rs:13:1 + | +LL | trait Foo { + | ^^^^^^^^^ + | + = note: ...which requires determining dyn-compatibility of trait `Foo`... + = note: ...which again requires checking if trait `Foo` is dyn-compatible, completing the cycle +note: cycle used when checking that `Foo::foo` is well-formed + --> $DIR/inference_var_self_argument.rs:15:5 + | +LL | async fn foo(self: &dyn Foo) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: for more information, see and + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/tests/ui/async-await/inference_var_self_argument.stderr b/tests/ui/async-await/inference_var_self_argument.old.stderr similarity index 88% rename from tests/ui/async-await/inference_var_self_argument.stderr rename to tests/ui/async-await/inference_var_self_argument.old.stderr index c4240a095e685..9460138d450a1 100644 --- a/tests/ui/async-await/inference_var_self_argument.stderr +++ b/tests/ui/async-await/inference_var_self_argument.old.stderr @@ -1,5 +1,5 @@ error[E0307]: invalid `self` parameter type: `&dyn Foo` - --> $DIR/inference_var_self_argument.rs:5:24 + --> $DIR/inference_var_self_argument.rs:15:24 | LL | async fn foo(self: &dyn Foo) { | ^^^^^^^^ @@ -8,17 +8,18 @@ LL | async fn foo(self: &dyn Foo) { = help: consider changing to `self`, `&self`, `&mut self`, `self: Box`, `self: Rc`, `self: Arc`, or `self: Pin

` (where P is one of the previous types except `Self`) error[E0038]: the trait `Foo` is not dyn compatible - --> $DIR/inference_var_self_argument.rs:5:33 + --> $DIR/inference_var_self_argument.rs:15:33 | LL | async fn foo(self: &dyn Foo) { | ^ `Foo` is not dyn compatible | note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit - --> $DIR/inference_var_self_argument.rs:5:14 + --> $DIR/inference_var_self_argument.rs:15:14 | LL | trait Foo { | --- this trait is not dyn compatible... +LL | LL | async fn foo(self: &dyn Foo) { | ^^^ ...because method `foo` is `async` = help: consider moving `foo` to another trait diff --git a/tests/ui/async-await/inference_var_self_argument.rs b/tests/ui/async-await/inference_var_self_argument.rs index d03f2b5c50bff..b07303476c4a4 100644 --- a/tests/ui/async-await/inference_var_self_argument.rs +++ b/tests/ui/async-await/inference_var_self_argument.rs @@ -1,10 +1,20 @@ -//! This is a regression test for an ICE. +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver //@ edition: 2021 +// This is a regression test for an ICE. +// +// This results in a query cycle with the new solver. Let's not +// bother with this when stabilizing the new solver. For more context, +// see https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/dyn.20compatibility.20check.20in.20object.20candidate.20causes.20cycle/with/627370998 + + trait Foo { + //[next]~^ ERROR: cycle detected when checking if trait `Foo` is dyn-compatible async fn foo(self: &dyn Foo) { - //~^ ERROR: `Foo` is not dyn compatible - //~| ERROR invalid `self` parameter type: `&dyn Foo` + //[old]~^ ERROR: `Foo` is not dyn compatible + //[old]~| ERROR: invalid `self` parameter type: `&dyn Foo` todo!() } } diff --git a/tests/ui/borrowck/alias-liveness/escaping-bounds.rs b/tests/ui/borrowck/alias-liveness/escaping-bounds.rs index 3f9246f68fcd3..bd819e42a49da 100644 --- a/tests/ui/borrowck/alias-liveness/escaping-bounds.rs +++ b/tests/ui/borrowck/alias-liveness/escaping-bounds.rs @@ -1,3 +1,6 @@ +//@ revisions: current next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver //@ check-pass // Ensure that we don't ICE when an alias that has escaping bound vars is @@ -16,7 +19,7 @@ fn foo<'a, 'b, T: Foo>(_: ::Assoc<'a, 'b>) {} fn test<'b, T: Foo>() { let y: MentionsLifetimeAndType<'_, for<'a> fn(::Assoc<'a, 'b>)> = - MentionsLifetimeAndType(&(), foo); + MentionsLifetimeAndType(&(), foo::); } fn main() {} diff --git a/tests/ui/cfg/cfg-false-use-item.rs b/tests/ui/cfg/cfg-false-use-item.rs index d907e17a0c11d..35b40e3e6a0db 100644 --- a/tests/ui/cfg/cfg-false-use-item.rs +++ b/tests/ui/cfg/cfg-false-use-item.rs @@ -1,8 +1,8 @@ //! Test that use items with cfg(false) are properly filtered out //@ run-pass -//@ reference: cfg.predicate.literal //@ reference: cfg.attr.effect +//@ reference: cfg.predicate-literal pub fn main() { // Make sure that this view item is filtered out because otherwise it would diff --git a/tests/ui/cfg/cfgs-on-items.rs b/tests/ui/cfg/cfgs-on-items.rs index 56f87350fea2c..2a4e16bf75142 100644 --- a/tests/ui/cfg/cfgs-on-items.rs +++ b/tests/ui/cfg/cfgs-on-items.rs @@ -1,8 +1,8 @@ //@ run-pass //@ compile-flags: --cfg fooA --cfg fooB --check-cfg=cfg(fooA,fooB,fooC,bar) -//@ reference: cfg.predicate.all -//@ reference: cfg.predicate.any -//@ reference: cfg.predicate.not +//@ reference: cfg.predicate-all +//@ reference: cfg.predicate-any +//@ reference: cfg.predicate-not // fooA AND !bar #[cfg(all(fooA, not(bar)))] diff --git a/tests/ui/cfg/true-false.rs b/tests/ui/cfg/true-false.rs index b8e0e8968c83e..24f5c35cb90fa 100644 --- a/tests/ui/cfg/true-false.rs +++ b/tests/ui/cfg/true-false.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ reference: cfg.predicate.literal +//@ reference: cfg.predicate-literal #![feature(link_cfg)] diff --git a/tests/ui/const-generics/argument_order.rs b/tests/ui/const-generics/argument_order.rs index f8980c9b54d75..20be10c77cac2 100644 --- a/tests/ui/const-generics/argument_order.rs +++ b/tests/ui/const-generics/argument_order.rs @@ -1,4 +1,4 @@ -//@ reference: items.generics.syntax.decl-order +//@ reference: items.generics.decl-order struct Good { arr: [u8; { N }], diff --git a/tests/ui/const-generics/generic_arg_infer/paren_infer.rs b/tests/ui/const-generics/generic_arg_infer/paren_infer.rs index 869683b705669..1f6158b0559bc 100644 --- a/tests/ui/const-generics/generic_arg_infer/paren_infer.rs +++ b/tests/ui/const-generics/generic_arg_infer/paren_infer.rs @@ -1,5 +1,6 @@ //@ check-pass -//@ reference: items.generics.const.inferred +//@ reference: expr.array.length-restriction +//@ reference: paths.expr.complex-const-params struct Foo; diff --git a/tests/ui/coverage-attr/allowed-positions.rs b/tests/ui/coverage-attr/allowed-positions.rs index cfbc7f5e6c0c7..8168b46a87375 100644 --- a/tests/ui/coverage-attr/allowed-positions.rs +++ b/tests/ui/coverage-attr/allowed-positions.rs @@ -1,6 +1,5 @@ //! Tests where the `#[coverage(..)]` attribute can and cannot be used. -//@ reference: attributes.coverage.allowed-positions #![feature(coverage_attribute)] #![feature(extern_types)] diff --git a/tests/ui/coverage-attr/allowed-positions.stderr b/tests/ui/coverage-attr/allowed-positions.stderr index e3e1e67bf7375..3e585d26e3e40 100644 --- a/tests/ui/coverage-attr/allowed-positions.stderr +++ b/tests/ui/coverage-attr/allowed-positions.stderr @@ -1,5 +1,5 @@ error[E0658]: attributes on expressions are experimental - --> $DIR/allowed-positions.rs:106:25 + --> $DIR/allowed-positions.rs:105:25 | LL | let _closure_expr = #[coverage(off)] || (); | ^^^^^^^^^^^^^^^^ @@ -9,7 +9,7 @@ LL | let _closure_expr = #[coverage(off)] || (); = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error: the `coverage` attribute cannot be used on type aliases - --> $DIR/allowed-positions.rs:14:3 + --> $DIR/allowed-positions.rs:13:3 | LL | #[coverage(off)] | ^^^^^^^^ @@ -17,7 +17,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on traits - --> $DIR/allowed-positions.rs:17:3 + --> $DIR/allowed-positions.rs:16:3 | LL | #[coverage(off)] | ^^^^^^^^ @@ -25,7 +25,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on associated consts - --> $DIR/allowed-positions.rs:19:7 + --> $DIR/allowed-positions.rs:18:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -33,7 +33,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:22:7 + --> $DIR/allowed-positions.rs:21:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -41,7 +41,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on required trait methods - --> $DIR/allowed-positions.rs:25:7 + --> $DIR/allowed-positions.rs:24:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -49,7 +49,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules error: the `coverage` attribute cannot be used on required trait methods - --> $DIR/allowed-positions.rs:31:7 + --> $DIR/allowed-positions.rs:30:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -57,7 +57,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules error: the `coverage` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:39:7 + --> $DIR/allowed-positions.rs:38:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -65,7 +65,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on associated types - --> $DIR/allowed-positions.rs:56:7 + --> $DIR/allowed-positions.rs:55:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -73,7 +73,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on structs - --> $DIR/allowed-positions.rs:61:3 + --> $DIR/allowed-positions.rs:60:3 | LL | #[coverage(off)] | ^^^^^^^^ @@ -81,7 +81,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on struct fields - --> $DIR/allowed-positions.rs:63:7 + --> $DIR/allowed-positions.rs:62:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -89,7 +89,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on foreign statics - --> $DIR/allowed-positions.rs:76:7 + --> $DIR/allowed-positions.rs:75:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -97,7 +97,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on foreign types - --> $DIR/allowed-positions.rs:79:7 + --> $DIR/allowed-positions.rs:78:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -105,7 +105,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on foreign functions - --> $DIR/allowed-positions.rs:82:7 + --> $DIR/allowed-positions.rs:81:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -113,7 +113,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions with a body, impl blocks, and modules error: the `coverage` attribute cannot be used on statements - --> $DIR/allowed-positions.rs:88:7 + --> $DIR/allowed-positions.rs:87:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -121,7 +121,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on statements - --> $DIR/allowed-positions.rs:94:7 + --> $DIR/allowed-positions.rs:93:7 | LL | #[coverage(off)] | ^^^^^^^^ @@ -129,7 +129,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on match arms - --> $DIR/allowed-positions.rs:110:11 + --> $DIR/allowed-positions.rs:109:11 | LL | #[coverage(off)] | ^^^^^^^^ @@ -137,7 +137,7 @@ LL | #[coverage(off)] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error: the `coverage` attribute cannot be used on expressions - --> $DIR/allowed-positions.rs:114:7 + --> $DIR/allowed-positions.rs:113:7 | LL | #[coverage(off)] | ^^^^^^^^ diff --git a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr index f3b5cbf22282f..71f832c319773 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.feat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.feat.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-attr-ice.rs:11:3 + --> $DIR/bad-attr-ice.rs:10:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list diff --git a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr index 4b0330fee8ca3..be429beb1824d 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr +++ b/tests/ui/coverage-attr/bad-attr-ice.nofeat.stderr @@ -1,5 +1,5 @@ error[E0658]: the `coverage` attribute is an experimental feature - --> $DIR/bad-attr-ice.rs:11:3 + --> $DIR/bad-attr-ice.rs:10:3 | LL | #[coverage] | ^^^^^^^^ @@ -9,7 +9,7 @@ LL | #[coverage] = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-attr-ice.rs:11:3 + --> $DIR/bad-attr-ice.rs:10:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list diff --git a/tests/ui/coverage-attr/bad-attr-ice.rs b/tests/ui/coverage-attr/bad-attr-ice.rs index 2626f47037dbd..3c1d3424f3d9f 100644 --- a/tests/ui/coverage-attr/bad-attr-ice.rs +++ b/tests/ui/coverage-attr/bad-attr-ice.rs @@ -2,7 +2,6 @@ //@ revisions: feat nofeat //@ compile-flags: -Cinstrument-coverage //@ needs-profiler-runtime -//@ reference: attributes.coverage.syntax // Malformed `coverage` attributes should not cause an ICE when built // with `-Cinstrument-coverage`. diff --git a/tests/ui/coverage-attr/bad-syntax.rs b/tests/ui/coverage-attr/bad-syntax.rs index ef7b41db3440e..ea29fd6ae63a3 100644 --- a/tests/ui/coverage-attr/bad-syntax.rs +++ b/tests/ui/coverage-attr/bad-syntax.rs @@ -1,7 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax -//@ reference: attributes.coverage.duplicates // Tests the error messages produced (or not produced) by various unusual // uses of the `#[coverage(..)]` attribute. diff --git a/tests/ui/coverage-attr/bad-syntax.stderr b/tests/ui/coverage-attr/bad-syntax.stderr index ee082951d101b..8269228444262 100644 --- a/tests/ui/coverage-attr/bad-syntax.stderr +++ b/tests/ui/coverage-attr/bad-syntax.stderr @@ -1,29 +1,29 @@ error: multiple `coverage` attributes - --> $DIR/bad-syntax.rs:10:1 + --> $DIR/bad-syntax.rs:8:1 | LL | #[coverage(off)] | ^^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/bad-syntax.rs:9:1 + --> $DIR/bad-syntax.rs:7:1 | LL | #[coverage(off)] | ^^^^^^^^^^^^^^^^ error: multiple `coverage` attributes - --> $DIR/bad-syntax.rs:14:1 + --> $DIR/bad-syntax.rs:12:1 | LL | #[coverage(on)] | ^^^^^^^^^^^^^^^ help: remove this attribute | note: attribute also specified here - --> $DIR/bad-syntax.rs:13:1 + --> $DIR/bad-syntax.rs:11:1 | LL | #[coverage(off)] | ^^^^^^^^^^^^^^^^ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:17:3 + --> $DIR/bad-syntax.rs:15:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -36,7 +36,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:20:3 + --> $DIR/bad-syntax.rs:18:3 | LL | #[coverage = true] | ^^^^^^^^^------ @@ -53,7 +53,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:23:3 + --> $DIR/bad-syntax.rs:21:3 | LL | #[coverage()] | ^^^^^^^^-- @@ -68,7 +68,7 @@ LL | #[coverage(on)] | ++ error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:26:3 + --> $DIR/bad-syntax.rs:24:3 | LL | #[coverage(off, off)] | ^^^^^^^^---------- @@ -85,7 +85,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:29:3 + --> $DIR/bad-syntax.rs:27:3 | LL | #[coverage(off, on)] | ^^^^^^^^--------- @@ -102,7 +102,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:32:3 + --> $DIR/bad-syntax.rs:30:3 | LL | #[coverage(bogus)] | ^^^^^^^^^-----^ @@ -119,7 +119,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:35:3 + --> $DIR/bad-syntax.rs:33:3 | LL | #[coverage(bogus, off)] | ^^^^^^^^------------ @@ -136,7 +136,7 @@ LL + #[coverage(on)] | error[E0805]: malformed `coverage` attribute input - --> $DIR/bad-syntax.rs:38:3 + --> $DIR/bad-syntax.rs:36:3 | LL | #[coverage(off, bogus)] | ^^^^^^^^------------ @@ -153,7 +153,7 @@ LL + #[coverage(on)] | error: expected identifier, found `,` - --> $DIR/bad-syntax.rs:44:12 + --> $DIR/bad-syntax.rs:42:12 | LL | #[coverage(,off)] | ^ expected identifier diff --git a/tests/ui/coverage-attr/name-value.rs b/tests/ui/coverage-attr/name-value.rs index 6e81ab8961672..e2d133f762ac1 100644 --- a/tests/ui/coverage-attr/name-value.rs +++ b/tests/ui/coverage-attr/name-value.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax // Demonstrates the diagnostics produced when using the syntax // `#[coverage = "off"]`, which should not be allowed. diff --git a/tests/ui/coverage-attr/name-value.stderr b/tests/ui/coverage-attr/name-value.stderr index 7eff78dd80d26..e5cdcf83e0a48 100644 --- a/tests/ui/coverage-attr/name-value.stderr +++ b/tests/ui/coverage-attr/name-value.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:12:3 + --> $DIR/name-value.rs:11:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -16,7 +16,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:17:8 + --> $DIR/name-value.rs:16:8 | LL | #![coverage = "off"] | ^^^^^^^^^------- @@ -33,7 +33,7 @@ LL + #![coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:21:3 + --> $DIR/name-value.rs:20:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -50,7 +50,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on structs - --> $DIR/name-value.rs:21:3 + --> $DIR/name-value.rs:20:3 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -58,7 +58,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:26:3 + --> $DIR/name-value.rs:25:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -75,7 +75,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:29:7 + --> $DIR/name-value.rs:28:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -92,7 +92,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated consts - --> $DIR/name-value.rs:29:7 + --> $DIR/name-value.rs:28:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -100,7 +100,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:35:3 + --> $DIR/name-value.rs:34:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -117,7 +117,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on traits - --> $DIR/name-value.rs:35:3 + --> $DIR/name-value.rs:34:3 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -125,7 +125,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:39:7 + --> $DIR/name-value.rs:38:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -142,7 +142,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated consts - --> $DIR/name-value.rs:39:7 + --> $DIR/name-value.rs:38:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -150,7 +150,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:44:7 + --> $DIR/name-value.rs:43:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -167,7 +167,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated types - --> $DIR/name-value.rs:44:7 + --> $DIR/name-value.rs:43:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -175,7 +175,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:50:3 + --> $DIR/name-value.rs:49:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -192,7 +192,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:53:7 + --> $DIR/name-value.rs:52:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -209,7 +209,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated consts - --> $DIR/name-value.rs:53:7 + --> $DIR/name-value.rs:52:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -217,7 +217,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:58:7 + --> $DIR/name-value.rs:57:7 | LL | #[coverage = "off"] | ^^^^^^^^^------- @@ -234,7 +234,7 @@ LL + #[coverage(on)] | error: the `coverage` attribute cannot be used on associated types - --> $DIR/name-value.rs:58:7 + --> $DIR/name-value.rs:57:7 | LL | #[coverage = "off"] | ^^^^^^^^ @@ -242,7 +242,7 @@ LL | #[coverage = "off"] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/name-value.rs:64:3 + --> $DIR/name-value.rs:63:3 | LL | #[coverage = "off"] | ^^^^^^^^^------- diff --git a/tests/ui/coverage-attr/subword.rs b/tests/ui/coverage-attr/subword.rs index 84a5132ac4ac3..16582240b6908 100644 --- a/tests/ui/coverage-attr/subword.rs +++ b/tests/ui/coverage-attr/subword.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax // Check that yes/no in `#[coverage(yes)]` and `#[coverage(no)]` must be bare // words, not part of a more complicated substructure. diff --git a/tests/ui/coverage-attr/subword.stderr b/tests/ui/coverage-attr/subword.stderr index 401c1cec958e4..e03c38398b298 100644 --- a/tests/ui/coverage-attr/subword.stderr +++ b/tests/ui/coverage-attr/subword.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:8:3 + --> $DIR/subword.rs:7:3 | LL | #[coverage(yes(milord))] | ^^^^^^^^^-----------^ @@ -16,7 +16,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:11:3 + --> $DIR/subword.rs:10:3 | LL | #[coverage(no(milord))] | ^^^^^^^^^----------^ @@ -33,7 +33,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:14:3 + --> $DIR/subword.rs:13:3 | LL | #[coverage(yes = "milord")] | ^^^^^^^^^--------------^ @@ -50,7 +50,7 @@ LL + #[coverage(on)] | error[E0539]: malformed `coverage` attribute input - --> $DIR/subword.rs:17:3 + --> $DIR/subword.rs:16:3 | LL | #[coverage(no = "milord")] | ^^^^^^^^^-------------^ diff --git a/tests/ui/coverage-attr/word-only.rs b/tests/ui/coverage-attr/word-only.rs index e47279f74ca9b..2cdd5f9da7137 100644 --- a/tests/ui/coverage-attr/word-only.rs +++ b/tests/ui/coverage-attr/word-only.rs @@ -1,6 +1,5 @@ #![feature(coverage_attribute)] //@ edition: 2021 -//@ reference: attributes.coverage.syntax // Demonstrates the diagnostics produced when using the syntax `#[coverage]`, // which should not be allowed. diff --git a/tests/ui/coverage-attr/word-only.stderr b/tests/ui/coverage-attr/word-only.stderr index 4946cefc51fc2..fdf8506ae30a0 100644 --- a/tests/ui/coverage-attr/word-only.stderr +++ b/tests/ui/coverage-attr/word-only.stderr @@ -1,5 +1,5 @@ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:12:3 + --> $DIR/word-only.rs:11:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -12,7 +12,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:17:8 + --> $DIR/word-only.rs:16:8 | LL | #![coverage] | ^^^^^^^^ expected this to be a list @@ -25,7 +25,7 @@ LL | #![coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:21:3 + --> $DIR/word-only.rs:20:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -38,7 +38,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on structs - --> $DIR/word-only.rs:21:3 + --> $DIR/word-only.rs:20:3 | LL | #[coverage] | ^^^^^^^^ @@ -46,7 +46,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:26:3 + --> $DIR/word-only.rs:25:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -59,7 +59,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:29:7 + --> $DIR/word-only.rs:28:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -72,7 +72,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated consts - --> $DIR/word-only.rs:29:7 + --> $DIR/word-only.rs:28:7 | LL | #[coverage] | ^^^^^^^^ @@ -80,7 +80,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:35:3 + --> $DIR/word-only.rs:34:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -93,7 +93,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on traits - --> $DIR/word-only.rs:35:3 + --> $DIR/word-only.rs:34:3 | LL | #[coverage] | ^^^^^^^^ @@ -101,7 +101,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:39:7 + --> $DIR/word-only.rs:38:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -114,7 +114,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated consts - --> $DIR/word-only.rs:39:7 + --> $DIR/word-only.rs:38:7 | LL | #[coverage] | ^^^^^^^^ @@ -122,7 +122,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:44:7 + --> $DIR/word-only.rs:43:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -135,7 +135,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated types - --> $DIR/word-only.rs:44:7 + --> $DIR/word-only.rs:43:7 | LL | #[coverage] | ^^^^^^^^ @@ -143,7 +143,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:50:3 + --> $DIR/word-only.rs:49:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -156,7 +156,7 @@ LL | #[coverage(on)] | ++++ error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:53:7 + --> $DIR/word-only.rs:52:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -169,7 +169,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated consts - --> $DIR/word-only.rs:53:7 + --> $DIR/word-only.rs:52:7 | LL | #[coverage] | ^^^^^^^^ @@ -177,7 +177,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:58:7 + --> $DIR/word-only.rs:57:7 | LL | #[coverage] | ^^^^^^^^ expected this to be a list @@ -190,7 +190,7 @@ LL | #[coverage(on)] | ++++ error: the `coverage` attribute cannot be used on associated types - --> $DIR/word-only.rs:58:7 + --> $DIR/word-only.rs:57:7 | LL | #[coverage] | ^^^^^^^^ @@ -198,7 +198,7 @@ LL | #[coverage] = help: the `coverage` attribute can be applied to crates, functions, impl blocks, and modules error[E0539]: malformed `coverage` attribute input - --> $DIR/word-only.rs:64:3 + --> $DIR/word-only.rs:63:3 | LL | #[coverage] | ^^^^^^^^ expected this to be a list diff --git a/tests/ui/delegation/fn-header.next.stderr b/tests/ui/delegation/fn-header.next.stderr new file mode 100644 index 0000000000000..adca7d80a9b1d --- /dev/null +++ b/tests/ui/delegation/fn-header.next.stderr @@ -0,0 +1,11 @@ +error[E0282]: type annotations needed + --> $DIR/fn-header.rs:23:17 + | +LL | reuse to_reuse::async_fn; + | ^^^^^^^^ cannot infer type + | + = note: cannot infer type of hidden type of opaque + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/delegation/fn-header.rs b/tests/ui/delegation/fn-header.rs index 16e3c10136ce0..8aae776e295ff 100644 --- a/tests/ui/delegation/fn-header.rs +++ b/tests/ui/delegation/fn-header.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#304 +//@[old] check-pass //@ edition:2018 //@ aux-crate:fn_header_aux=fn-header-aux.rs //@ ignore-backends: gcc diff --git a/tests/ui/delegation/impl-trait.next.stderr b/tests/ui/delegation/impl-trait.next.stderr new file mode 100644 index 0000000000000..84e1e8ec4453a --- /dev/null +++ b/tests/ui/delegation/impl-trait.next.stderr @@ -0,0 +1,19 @@ +error[E0282]: type annotations needed + --> $DIR/impl-trait.rs:13:17 + | +LL | reuse to_reuse::foo; + | ^^^ cannot infer type + | + = note: cannot infer type of hidden type of opaque + +error[E0282]: type annotations needed + --> $DIR/impl-trait.rs:23:21 + | +LL | reuse to_reuse::foo; + | ^^^ cannot infer type + | + = note: cannot infer type of hidden type of opaque + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/delegation/impl-trait.rs b/tests/ui/delegation/impl-trait.rs index cb86a048a18e9..3b0d1a0383549 100644 --- a/tests/ui/delegation/impl-trait.rs +++ b/tests/ui/delegation/impl-trait.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#304 +//@[old] check-pass #![feature(fn_delegation)] diff --git a/tests/ui/impl-trait/member-constraints/incomplete-constraint.next.stderr b/tests/ui/impl-trait/member-constraints/incomplete-constraint.next.stderr new file mode 100644 index 0000000000000..d00ac00232591 --- /dev/null +++ b/tests/ui/impl-trait/member-constraints/incomplete-constraint.next.stderr @@ -0,0 +1,26 @@ +error: concrete type differs from previous defining opaque type use + --> $DIR/incomplete-constraint.rs:15:5 + | +LL | new_defining_use(rpit1::<'a, 'b>); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&'b ()`, got `&'static ()` + | +note: previous use here + --> $DIR/incomplete-constraint.rs:14:1 + | +LL | fn rpit1<'a, 'b: 'b>(x: &'b ()) -> impl Sized + use<'a, 'b> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: concrete type differs from previous defining opaque type use + --> $DIR/incomplete-constraint.rs:21:5 + | +LL | new_defining_use(rpit2::<'a>); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `Inv<'a, 'static>`, got `Inv<'a, 'a>` + | +note: previous use here + --> $DIR/incomplete-constraint.rs:20:1 + | +LL | fn rpit2<'a>(_: ()) -> impl Sized + use<'a> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 2 previous errors + diff --git a/tests/ui/impl-trait/member-constraints/incomplete-constraint.rs b/tests/ui/impl-trait/member-constraints/incomplete-constraint.rs index 4c085cc1eedf8..e619a07e1f435 100644 --- a/tests/ui/impl-trait/member-constraints/incomplete-constraint.rs +++ b/tests/ui/impl-trait/member-constraints/incomplete-constraint.rs @@ -1,5 +1,8 @@ -//@ check-pass -// FIXME(-Znext-solver): enable this test +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#227 +//@[old] check-pass // These functions currently do not normalize the opaque type but will do // so in the future. At this point we've got a new use of the opaque with fully diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-direct.next.stderr b/tests/ui/impl-trait/recursive-impl-trait-type-direct.next.stderr new file mode 100644 index 0000000000000..1459453b6d8f6 --- /dev/null +++ b/tests/ui/impl-trait/recursive-impl-trait-type-direct.next.stderr @@ -0,0 +1,11 @@ +error[E0282]: type annotations needed + --> $DIR/recursive-impl-trait-type-direct.rs:13:14 + | +LL | fn test() -> impl Sized { + | ^^^^^^^^^^ cannot infer type + | + = note: cannot infer type of hidden type of opaque + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0282`. diff --git a/tests/ui/impl-trait/recursive-impl-trait-type-direct.rs b/tests/ui/impl-trait/recursive-impl-trait-type-direct.rs index 1d82f89d7a1a3..6234c1c71b946 100644 --- a/tests/ui/impl-trait/recursive-impl-trait-type-direct.rs +++ b/tests/ui/impl-trait/recursive-impl-trait-type-direct.rs @@ -1,8 +1,17 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[old] check-pass #![allow(unconditional_recursion)] +// The new solver does not allow unconstrained opaque types and unlike +// the old solver, does not fall back to `()` here. +// +// See https://github.com/rust-lang/trait-system-refactor-initiative/issues/144. + fn test() -> impl Sized { + //[next]~^ ERROR: type annotations needed test() } diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.next.stderr b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.next.stderr new file mode 100644 index 0000000000000..5e1bae55aee06 --- /dev/null +++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.next.stderr @@ -0,0 +1,18 @@ +error: item does not constrain `Foo::{opaque#0}` + --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs:11:4 + | +LL | fn foo() -> Foo { + | ^^^ + | + = note: consider removing `#[define_opaque]` or adding an empty `#[define_opaque()]` +note: this opaque type is supposed to be constrained + --> $DIR/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs:8:16 + | +LL | pub type Foo = impl PartialEq<(Foo, i32)>; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0275]: overflow evaluating the requirement `Foo == _` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0275`. diff --git a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs index 662c7ee2ecf0b..85f53be6b1bca 100644 --- a/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs +++ b/tests/ui/impl-trait/recursive-type-alias-impl-trait-declaration-too-subtle-2.rs @@ -1,6 +1,9 @@ #![feature(type_alias_impl_trait)] - -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#143 +//@[old] check-pass pub type Foo = impl PartialEq<(Foo, i32)>; diff --git a/tests/ui/implied-bounds/gluon_salsa.next.stderr b/tests/ui/implied-bounds/gluon_salsa.next.stderr new file mode 100644 index 0000000000000..dfeb8456ea067 --- /dev/null +++ b/tests/ui/implied-bounds/gluon_salsa.next.stderr @@ -0,0 +1,13 @@ +error[E0309]: the associated type `>::SendDb` may not live long enough + --> $DIR/gluon_salsa.rs:46:26 + | +LL | pub fn get_async<'a>(&'a mut self) { + | -- ^^^^^^^^^^^^ ...so that the type `QueryTable<'me, Q, >::SendDb>` will meet its required lifetime bounds + | | + | the associated type `>::SendDb` must be valid for the lifetime `'a` as defined here... + | + = help: consider adding an explicit lifetime bound `>::SendDb: 'a`... + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/tests/ui/implied-bounds/gluon_salsa.rs b/tests/ui/implied-bounds/gluon_salsa.rs index cc6352c4a32e9..338b6fe5fb5c8 100644 --- a/tests/ui/implied-bounds/gluon_salsa.rs +++ b/tests/ui/implied-bounds/gluon_salsa.rs @@ -1,6 +1,20 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[old] check-pass + // Related to Bevy regression #115559, found in // a crater run on #118553. +// +// Normalizing when computing implied bounds and normalizing the +// signature when checking that it is well-formed happen separately. +// +// In the old solver both use the projection_cache so the resulting type +// has the same unconstrained infer var. +// +// The new solver does not have any per-infcx caches, so the unconstrained +// variables differ, causing lexical region error to fail to prove the relevant +// type outlives. pub trait QueryBase { type Db; @@ -30,6 +44,7 @@ where // to work we may have to structurally resolve regions as the actually used vars may // otherwise be semantically equal but structurally different. pub fn get_async<'a>(&'a mut self) { + //[next]~^ ERROR: the associated type `>::SendDb` may not live long enough panic!(); } } diff --git a/tests/ui/layout/aggregate-lang/struct-align.rs b/tests/ui/layout/aggregate-lang/struct-align.rs index f3b88a6d85d3e..0864bdc6bfce0 100644 --- a/tests/ui/layout/aggregate-lang/struct-align.rs +++ b/tests/ui/layout/aggregate-lang/struct-align.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/struct-offsets.rs b/tests/ui/layout/aggregate-lang/struct-offsets.rs index ca199bdfeb104..894ac67db2d4c 100644 --- a/tests/ui/layout/aggregate-lang/struct-offsets.rs +++ b/tests/ui/layout/aggregate-lang/struct-offsets.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-offsets //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/struct-size.rs b/tests/ui/layout/aggregate-lang/struct-size.rs index f9fb605c32486..43430b85e1bf0 100644 --- a/tests/ui/layout/aggregate-lang/struct-size.rs +++ b/tests/ui/layout/aggregate-lang/struct-size.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[allow(dead_code)] diff --git a/tests/ui/layout/aggregate-lang/union-align.rs b/tests/ui/layout/aggregate-lang/union-align.rs index 03825f1df2137..fd0b33e5f9018 100644 --- a/tests/ui/layout/aggregate-lang/union-align.rs +++ b/tests/ui/layout/aggregate-lang/union-align.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/union-offsets.rs b/tests/ui/layout/aggregate-lang/union-offsets.rs index 29ab0a9ce5490..b9b6b8e357dd8 100644 --- a/tests/ui/layout/aggregate-lang/union-offsets.rs +++ b/tests/ui/layout/aggregate-lang/union-offsets.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-offsets //@ edition: 2018 #[repr(align(64))] diff --git a/tests/ui/layout/aggregate-lang/union-size.rs b/tests/ui/layout/aggregate-lang/union-size.rs index 6d1b51b172db1..4189846571bf6 100644 --- a/tests/ui/layout/aggregate-lang/union-size.rs +++ b/tests/ui/layout/aggregate-lang/union-size.rs @@ -1,5 +1,4 @@ //@ run-pass -//@ reference: layout.aggregate.struct-size-align //@ edition: 2018 #[allow(dead_code)] diff --git a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs index 7de786dff3b77..2427c75f3e00e 100644 --- a/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs +++ b/tests/ui/lifetimes/temporary-lifetime-extension-tuple-ctor.rs @@ -1,4 +1,4 @@ -//@ reference: destructors.scope.lifetime-extension.exprs +//@ reference: destructors.scope.lifetime-extension.exprs.extending fn temp() -> String { String::from("Hello") diff --git a/tests/ui/macros/macro-shadowing.rs b/tests/ui/macros/macro-shadowing.rs index 87ed7c8d8fb09..b5d74f09df978 100644 --- a/tests/ui/macros/macro-shadowing.rs +++ b/tests/ui/macros/macro-shadowing.rs @@ -1,5 +1,4 @@ //@ aux-build:two_macros.rs -//@ reference: macro.decl.scope.textual.shadow //@ reference: names.resolution.expansion.macros.ambiguity.more-expanded-vs-outer #![allow(unused_macros)] diff --git a/tests/ui/macros/macro-shadowing.stderr b/tests/ui/macros/macro-shadowing.stderr index 96992aee649a4..2b4de7aacba3f 100644 --- a/tests/ui/macros/macro-shadowing.stderr +++ b/tests/ui/macros/macro-shadowing.stderr @@ -1,5 +1,5 @@ error: `macro_two` is already in scope - --> $DIR/macro-shadowing.rs:14:5 + --> $DIR/macro-shadowing.rs:13:5 | LL | macro_rules! m1 { () => { ... @@ -12,7 +12,7 @@ LL | m1!(); = note: macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560) error[E0659]: `foo` is ambiguous - --> $DIR/macro-shadowing.rs:19:1 + --> $DIR/macro-shadowing.rs:18:1 | LL | macro_rules! m1 { () => { ... @@ -21,7 +21,7 @@ LL | foo!(); | = note: ambiguous because of a conflict between a macro-expanded name and a less macro-expanded name from outer scope during import or macro resolution note: `foo` could refer to the macro defined here - --> $DIR/macro-shadowing.rs:12:5 + --> $DIR/macro-shadowing.rs:11:5 | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -29,7 +29,7 @@ LL | macro_rules! foo { () => {} } LL | m1!(); | ----- in this macro invocation note: `foo` could also refer to the macro defined here - --> $DIR/macro-shadowing.rs:7:1 + --> $DIR/macro-shadowing.rs:6:1 | LL | macro_rules! foo { () => {} } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/pattern/usefulness/impl-trait.stderr b/tests/ui/pattern/usefulness/impl-trait.next.stderr similarity index 85% rename from tests/ui/pattern/usefulness/impl-trait.stderr rename to tests/ui/pattern/usefulness/impl-trait.next.stderr index 6efa783cf63cb..58ce14171693f 100644 --- a/tests/ui/pattern/usefulness/impl-trait.stderr +++ b/tests/ui/pattern/usefulness/impl-trait.next.stderr @@ -1,5 +1,5 @@ error: unreachable pattern - --> $DIR/impl-trait.rs:16:13 + --> $DIR/impl-trait.rs:19:13 | LL | _ => {} | ^------ @@ -9,13 +9,13 @@ LL | _ => {} | = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types note: the lint level is defined here - --> $DIR/impl-trait.rs:4:9 + --> $DIR/impl-trait.rs:7:9 | LL | #![deny(unreachable_patterns)] | ^^^^^^^^^^^^^^^^^^^^ error: unreachable pattern - --> $DIR/impl-trait.rs:31:13 + --> $DIR/impl-trait.rs:34:13 | LL | _ => {} | ^------ @@ -26,7 +26,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:45:13 + --> $DIR/impl-trait.rs:48:13 | LL | Some(_) => {} | ^^^^^^^------ @@ -37,7 +37,7 @@ LL | Some(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:49:13 + --> $DIR/impl-trait.rs:52:13 | LL | None => {} | ---- matches all the relevant values @@ -45,7 +45,7 @@ LL | _ => {} | ^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:59:13 + --> $DIR/impl-trait.rs:62:13 | LL | Some(_) => {} | ^^^^^^^------ @@ -56,7 +56,7 @@ LL | Some(_) => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:63:13 + --> $DIR/impl-trait.rs:66:13 | LL | None => {} | ---- matches all the relevant values @@ -64,7 +64,7 @@ LL | _ => {} | ^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:76:9 + --> $DIR/impl-trait.rs:79:9 | LL | _ => {} | ^------ @@ -75,7 +75,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:86:9 + --> $DIR/impl-trait.rs:89:9 | LL | _ => {} | - matches any value @@ -83,7 +83,7 @@ LL | Some((a, b)) => {} | ^^^^^^^^^^^^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:95:13 + --> $DIR/impl-trait.rs:98:13 | LL | _ => {} | ^------ @@ -94,7 +94,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:107:9 + --> $DIR/impl-trait.rs:110:9 | LL | Some((a, b)) => {} | ------------ matches all the relevant values @@ -102,15 +102,7 @@ LL | Some((mut x, mut y)) => { | ^^^^^^^^^^^^^^^^^^^^ no value can reach this error: unreachable pattern - --> $DIR/impl-trait.rs:127:13 - | -LL | _ => {} - | - matches any value -LL | Rec { n: 0, w: Some(Rec { n: 0, w: _ }) } => {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no value can reach this - -error: unreachable pattern - --> $DIR/impl-trait.rs:142:13 + --> $DIR/impl-trait.rs:149:13 | LL | _ => {} | ^------ @@ -121,7 +113,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error: unreachable pattern - --> $DIR/impl-trait.rs:156:13 + --> $DIR/impl-trait.rs:163:13 | LL | _ => {} | ^------ @@ -132,7 +124,7 @@ LL | _ => {} = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty - --> $DIR/impl-trait.rs:22:11 + --> $DIR/impl-trait.rs:25:11 | LL | match return_never_rpit(x) {} | ^^^^^^^^^^^^^^^^^^^^ @@ -146,7 +138,7 @@ LL ~ } | error[E0004]: non-exhaustive patterns: type `T` is non-empty - --> $DIR/impl-trait.rs:37:11 + --> $DIR/impl-trait.rs:40:11 | LL | match return_never_tait(x) {} | ^^^^^^^^^^^^^^^^^^^^ @@ -159,6 +151,6 @@ LL + _ => todo!(), LL ~ } | -error: aborting due to 15 previous errors +error: aborting due to 14 previous errors For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/pattern/usefulness/impl-trait.old.stderr b/tests/ui/pattern/usefulness/impl-trait.old.stderr new file mode 100644 index 0000000000000..58ce14171693f --- /dev/null +++ b/tests/ui/pattern/usefulness/impl-trait.old.stderr @@ -0,0 +1,156 @@ +error: unreachable pattern + --> $DIR/impl-trait.rs:19:13 + | +LL | _ => {} + | ^------ + | | + | matches no values because `Void` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types +note: the lint level is defined here + --> $DIR/impl-trait.rs:7:9 + | +LL | #![deny(unreachable_patterns)] + | ^^^^^^^^^^^^^^^^^^^^ + +error: unreachable pattern + --> $DIR/impl-trait.rs:34:13 + | +LL | _ => {} + | ^------ + | | + | matches no values because `Void` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: unreachable pattern + --> $DIR/impl-trait.rs:48:13 + | +LL | Some(_) => {} + | ^^^^^^^------ + | | + | matches no values because `Void` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: unreachable pattern + --> $DIR/impl-trait.rs:52:13 + | +LL | None => {} + | ---- matches all the relevant values +LL | _ => {} + | ^ no value can reach this + +error: unreachable pattern + --> $DIR/impl-trait.rs:62:13 + | +LL | Some(_) => {} + | ^^^^^^^------ + | | + | matches no values because `Void` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: unreachable pattern + --> $DIR/impl-trait.rs:66:13 + | +LL | None => {} + | ---- matches all the relevant values +LL | _ => {} + | ^ no value can reach this + +error: unreachable pattern + --> $DIR/impl-trait.rs:79:9 + | +LL | _ => {} + | ^------ + | | + | matches no values because `Void` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: unreachable pattern + --> $DIR/impl-trait.rs:89:9 + | +LL | _ => {} + | - matches any value +LL | Some((a, b)) => {} + | ^^^^^^^^^^^^ no value can reach this + +error: unreachable pattern + --> $DIR/impl-trait.rs:98:13 + | +LL | _ => {} + | ^------ + | | + | matches no values because `Void` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: unreachable pattern + --> $DIR/impl-trait.rs:110:9 + | +LL | Some((a, b)) => {} + | ------------ matches all the relevant values +LL | Some((mut x, mut y)) => { + | ^^^^^^^^^^^^^^^^^^^^ no value can reach this + +error: unreachable pattern + --> $DIR/impl-trait.rs:149:13 + | +LL | _ => {} + | ^------ + | | + | matches no values because `SecretelyVoid` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error: unreachable pattern + --> $DIR/impl-trait.rs:163:13 + | +LL | _ => {} + | ^------ + | | + | matches no values because `SecretelyDoubleVoid` is uninhabited + | help: remove the match arm + | + = note: to learn more about uninhabited types, see https://doc.rust-lang.org/nomicon/exotic-sizes.html#empty-types + +error[E0004]: non-exhaustive patterns: type `impl Copy` is non-empty + --> $DIR/impl-trait.rs:25:11 + | +LL | match return_never_rpit(x) {} + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: the matched value is of type `impl Copy` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match return_never_rpit(x) { +LL + _ => todo!(), +LL ~ } + | + +error[E0004]: non-exhaustive patterns: type `T` is non-empty + --> $DIR/impl-trait.rs:40:11 + | +LL | match return_never_tait(x) {} + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: the matched value is of type `T` +help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown + | +LL ~ match return_never_tait(x) { +LL + _ => todo!(), +LL ~ } + | + +error: aborting due to 14 previous errors + +For more information about this error, try `rustc --explain E0004`. diff --git a/tests/ui/pattern/usefulness/impl-trait.rs b/tests/ui/pattern/usefulness/impl-trait.rs index f04633ebef2f6..9cb6b704597a9 100644 --- a/tests/ui/pattern/usefulness/impl-trait.rs +++ b/tests/ui/pattern/usefulness/impl-trait.rs @@ -1,3 +1,6 @@ +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver #![feature(type_alias_impl_trait)] #![feature(non_exhaustive_omitted_patterns_lint)] #![feature(exhaustive_patterns)] @@ -112,6 +115,9 @@ fn infer_in_match(x: Option) { } } +// FIXME(trait-system-refactor-initiative#293): This currently causes an ICE. +// It should not. +/* type W = impl Copy; #[derive(Copy, Clone)] struct Rec<'a> { @@ -124,12 +130,13 @@ fn recursive_opaque() -> W { match recursive_opaque() { // Check for the ol' ICE when the type is recursively opaque. _ => {} - Rec { n: 0, w: Some(Rec { n: 0, w: _ }) } => {} //~ ERROR unreachable + Rec { n: 0, w: Some(Rec { n: 0, w: _ }) } => {} } } let w: Option<&'static W> = None; Rec { n: 0, w } } +*/ type X = impl Copy; struct SecretelyVoid(X); diff --git a/tests/ui/proc-macro/modules-in-input.rs b/tests/ui/proc-macro/modules-in-input.rs index 50b4dc9e40f44..5f14d96b3b51e 100644 --- a/tests/ui/proc-macro/modules-in-input.rs +++ b/tests/ui/proc-macro/modules-in-input.rs @@ -1,6 +1,6 @@ //@ check-pass //@ proc-macro: expect-modules.rs -//@ reference: macro.invocation.attr.mod +//@ reference: macro.proc.attribute.outline-mod // Verifies how module items are represented in proc macro input. diff --git a/tests/ui/transmutability/alignment/align-pass.next.stderr b/tests/ui/transmutability/alignment/align-pass.next.stderr new file mode 100644 index 0000000000000..2095e97cc3915 --- /dev/null +++ b/tests/ui/transmutability/alignment/align-pass.next.stderr @@ -0,0 +1,29 @@ +error[E0277]: `&[u16; 0]` cannot be safely transmuted into `&[u8; 0]` + --> $DIR/align-pass.rs:25:56 + | +LL | assert::is_maybe_transmutable::<&'static [u16; 0], &'static [u8; 0]>(); + | ^^^^^^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `TransmuteFrom<&'static [u16; 0], Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `&'static [u8; 0]` +note: required by a bound in `is_maybe_transmutable` + --> $DIR/align-pass.rs:13:14 + | +LL | pub fn is_maybe_transmutable() +LL | where +LL | Dst: TransmuteFrom + | |__________^ required by this bound in `is_maybe_transmutable` +help: consider removing the leading `&`-reference + | +LL - assert::is_maybe_transmutable::<&'static [u16; 0], &'static [u8; 0]>(); +LL + assert::is_maybe_transmutable::<&'static [u16; 0], [u8; 0]>(); + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/alignment/align-pass.rs b/tests/ui/transmutability/alignment/align-pass.rs index feecf5edaa1ac..fa40c3a3ade43 100644 --- a/tests/ui/transmutability/alignment/align-pass.rs +++ b/tests/ui/transmutability/alignment/align-pass.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass #![feature(transmutability)] mod assert { diff --git a/tests/ui/transmutability/references/accept_assume_lifetime_extension.next.stderr b/tests/ui/transmutability/references/accept_assume_lifetime_extension.next.stderr new file mode 100644 index 0000000000000..4c469fd2222e3 --- /dev/null +++ b/tests/ui/transmutability/references/accept_assume_lifetime_extension.next.stderr @@ -0,0 +1,138 @@ +error[E0277]: `&u8` cannot be safely transmuted into `&u8` + --> $DIR/accept_assume_lifetime_extension.rs:24:18 + | +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `std::mem::TransmuteFrom<&u8, std::mem::Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `&u8` +note: required by a bound in `transmute` + --> $DIR/accept_assume_lifetime_extension.rs:15:10 + | +LL | unsafe fn transmute(src: Src) -> Dst +LL | where +LL | Dst: TransmuteFrom, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error[E0277]: `&&u8` cannot be safely transmuted into `&&u8` + --> $DIR/accept_assume_lifetime_extension.rs:32:18 + | +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `std::mem::TransmuteFrom<&&u8, std::mem::Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `&&u8` +note: required by a bound in `transmute` + --> $DIR/accept_assume_lifetime_extension.rs:15:10 + | +LL | unsafe fn transmute(src: Src) -> Dst +LL | where +LL | Dst: TransmuteFrom, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error[E0277]: `(&u8,)` cannot be safely transmuted into `(&u8,)` + --> $DIR/accept_assume_lifetime_extension.rs:40:18 + | +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `std::mem::TransmuteFrom<(&u8,), std::mem::Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `(&u8,)` +note: required by a bound in `transmute` + --> $DIR/accept_assume_lifetime_extension.rs:15:10 + | +LL | unsafe fn transmute(src: Src) -> Dst +LL | where +LL | Dst: TransmuteFrom, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error[E0277]: `(&u8, u8)` cannot be safely transmuted into `(&u8, u8)` + --> $DIR/accept_assume_lifetime_extension.rs:44:18 + | +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `std::mem::TransmuteFrom<(&u8, u8), std::mem::Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `(&u8, u8)` +note: required by a bound in `transmute` + --> $DIR/accept_assume_lifetime_extension.rs:15:10 + | +LL | unsafe fn transmute(src: Src) -> Dst +LL | where +LL | Dst: TransmuteFrom, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error[E0277]: `r#struct::Struct<'_>` cannot be safely transmuted into `r#struct::Struct<'_>` + --> $DIR/accept_assume_lifetime_extension.rs:54:18 + | +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ unsatisfied trait bound + | +help: the nightly-only, unstable trait `std::mem::TransmuteFrom, std::mem::Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `r#struct::Struct<'_>` + --> $DIR/accept_assume_lifetime_extension.rs:51:5 + | +LL | struct Struct<'a>(&'a u8); + | ^^^^^^^^^^^^^^^^^ +note: required by a bound in `transmute` + --> $DIR/accept_assume_lifetime_extension.rs:15:10 + | +LL | unsafe fn transmute(src: Src) -> Dst +LL | where +LL | Dst: TransmuteFrom, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error[E0277]: `Single<'_>` cannot be safely transmuted into `Single<'_>` + --> $DIR/accept_assume_lifetime_extension.rs:66:18 + | +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ unsatisfied trait bound + | +help: the nightly-only, unstable trait `std::mem::TransmuteFrom, std::mem::Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `Single<'_>` + --> $DIR/accept_assume_lifetime_extension.rs:61:5 + | +LL | enum Single<'a> { + | ^^^^^^^^^^^^^^^ +note: required by a bound in `transmute` + --> $DIR/accept_assume_lifetime_extension.rs:15:10 + | +LL | unsafe fn transmute(src: Src) -> Dst +LL | where +LL | Dst: TransmuteFrom, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error[E0277]: `Multi<'_>` cannot be safely transmuted into `Multi<'_>` + --> $DIR/accept_assume_lifetime_extension.rs:76:18 + | +LL | unsafe { transmute(src) } + | ^^^^^^^^^^^^^^ unsatisfied trait bound + | +help: the nightly-only, unstable trait `std::mem::TransmuteFrom, std::mem::Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `Multi<'_>` + --> $DIR/accept_assume_lifetime_extension.rs:69:5 + | +LL | enum Multi<'a> { + | ^^^^^^^^^^^^^^ +note: required by a bound in `transmute` + --> $DIR/accept_assume_lifetime_extension.rs:15:10 + | +LL | unsafe fn transmute(src: Src) -> Dst +LL | where +LL | Dst: TransmuteFrom, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error[E0277]: `&u8` cannot be safely transmuted into `&u8` + --> $DIR/accept_assume_lifetime_extension.rs:84:18 + | +LL | unsafe { extend_hrtb(src) } + | ^^^^^^^^^^^^---^ + | | | + | | `&u8` doesn't satisfy the trait bound + | unsatisfied trait bound + | + = help: the nightly-only, unstable trait `for<'b> std::mem::TransmuteFrom<&u8, std::mem::Assume { alignment: false, lifetimes: true, safety: false, validity: false }>` is not implemented for `&'b u8` +note: required by a bound in `extend_hrtb` + --> $DIR/accept_assume_lifetime_extension.rs:89:25 + | +LL | unsafe fn extend_hrtb<'a>(src: &'a u8) -> &'static u8 +LL | where +LL | for<'b> &'b u8: TransmuteFrom<&'a u8, { Assume::LIFETIMES }>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `extend_hrtb` + +error: aborting due to 8 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/references/accept_assume_lifetime_extension.rs b/tests/ui/transmutability/references/accept_assume_lifetime_extension.rs index edad02fc96d22..86feb3c40eb7d 100644 --- a/tests/ui/transmutability/references/accept_assume_lifetime_extension.rs +++ b/tests/ui/transmutability/references/accept_assume_lifetime_extension.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass //! Accept lifetime extensions with `Assume::LIFETIMES`. diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.next.stderr b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.next.stderr new file mode 100644 index 0000000000000..32156298a1f6f --- /dev/null +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.next.stderr @@ -0,0 +1,24 @@ +error[E0277]: `&A` cannot be safely transmuted into `&B` + --> $DIR/recursive-wrapper-types-bit-compatible.rs:27:49 + | +LL | assert::is_maybe_transmutable::<&'static A, &'static B>(); + | ^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `TransmuteFrom<&'static A, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>` is not implemented for `&'static B` +note: required by a bound in `is_maybe_transmutable` + --> $DIR/recursive-wrapper-types-bit-compatible.rs:13:14 + | +LL | pub fn is_maybe_transmutable() +LL | where +LL | Dst: TransmuteFrom + | |__________^ required by this bound in `is_maybe_transmutable` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs index 8e2da3518a961..f1bb503549968 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs +++ b/tests/ui/transmutability/references/recursive-wrapper-types-bit-compatible.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass #![feature(transmutability)] mod assert { diff --git a/tests/ui/transmutability/references/recursive-wrapper-types.next.stderr b/tests/ui/transmutability/references/recursive-wrapper-types.next.stderr new file mode 100644 index 0000000000000..8ea346d7c08b5 --- /dev/null +++ b/tests/ui/transmutability/references/recursive-wrapper-types.next.stderr @@ -0,0 +1,45 @@ +error[E0277]: `&A` cannot be safely transmuted into `&B` + --> $DIR/recursive-wrapper-types.rs:27:49 + | +LL | assert::is_maybe_transmutable::<&'static A, &'static B>(); + | ^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `TransmuteFrom<&'static A, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>` is not implemented for `&'static B` +note: required by a bound in `is_maybe_transmutable` + --> $DIR/recursive-wrapper-types.rs:13:14 + | +LL | pub fn is_maybe_transmutable() +LL | where +LL | Dst: TransmuteFrom + | |__________^ required by this bound in `is_maybe_transmutable` + +error[E0277]: `&B` cannot be safely transmuted into `&A` + --> $DIR/recursive-wrapper-types.rs:28:49 + | +LL | assert::is_maybe_transmutable::<&'static B, &'static A>(); + | ^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `TransmuteFrom<&'static B, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>` is not implemented for `&'static A` +note: required by a bound in `is_maybe_transmutable` + --> $DIR/recursive-wrapper-types.rs:13:14 + | +LL | pub fn is_maybe_transmutable() +LL | where +LL | Dst: TransmuteFrom + | |__________^ required by this bound in `is_maybe_transmutable` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/references/recursive-wrapper-types.rs b/tests/ui/transmutability/references/recursive-wrapper-types.rs index 53dedeb6388f5..7ff458aa2512b 100644 --- a/tests/ui/transmutability/references/recursive-wrapper-types.rs +++ b/tests/ui/transmutability/references/recursive-wrapper-types.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass #![feature(transmutability)] mod assert { diff --git a/tests/ui/transmutability/references/u8-to-unit.next.stderr b/tests/ui/transmutability/references/u8-to-unit.next.stderr new file mode 100644 index 0000000000000..0897833202826 --- /dev/null +++ b/tests/ui/transmutability/references/u8-to-unit.next.stderr @@ -0,0 +1,29 @@ +error[E0277]: `&u8` cannot be safely transmuted into `&Unit` + --> $DIR/u8-to-unit.rs:26:50 + | +LL | assert::is_maybe_transmutable::<&'static u8, &'static Unit>(); + | ^^^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `TransmuteFrom<&'static u8, Assume { alignment: false, lifetimes: true, safety: true, validity: false }>` is not implemented for `&'static Unit` +note: required by a bound in `is_maybe_transmutable` + --> $DIR/u8-to-unit.rs:13:14 + | +LL | pub fn is_maybe_transmutable() +LL | where +LL | Dst: TransmuteFrom + | |__________^ required by this bound in `is_maybe_transmutable` +help: consider removing the leading `&`-reference + | +LL - assert::is_maybe_transmutable::<&'static u8, &'static Unit>(); +LL + assert::is_maybe_transmutable::<&'static u8, Unit>(); + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/references/u8-to-unit.rs b/tests/ui/transmutability/references/u8-to-unit.rs index 98deb6457cb07..df124cafda3d6 100644 --- a/tests/ui/transmutability/references/u8-to-unit.rs +++ b/tests/ui/transmutability/references/u8-to-unit.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass #![feature(transmutability)] mod assert { diff --git a/tests/ui/transmutability/references/unit-to-itself.next.stderr b/tests/ui/transmutability/references/unit-to-itself.next.stderr new file mode 100644 index 0000000000000..4a15b3b3d5c30 --- /dev/null +++ b/tests/ui/transmutability/references/unit-to-itself.next.stderr @@ -0,0 +1,29 @@ +error[E0277]: `&Unit` cannot be safely transmuted into `&Unit` + --> $DIR/unit-to-itself.rs:26:52 + | +LL | assert::is_maybe_transmutable::<&'static Unit, &'static Unit>(); + | ^^^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `TransmuteFrom<&'static Unit, Assume { alignment: true, lifetimes: false, safety: true, validity: false }>` is not implemented for `&'static Unit` +note: required by a bound in `is_maybe_transmutable` + --> $DIR/unit-to-itself.rs:13:14 + | +LL | pub fn is_maybe_transmutable() +LL | where +LL | Dst: TransmuteFrom + | |__________^ required by this bound in `is_maybe_transmutable` +help: consider removing the leading `&`-reference + | +LL - assert::is_maybe_transmutable::<&'static Unit, &'static Unit>(); +LL + assert::is_maybe_transmutable::<&'static Unit, Unit>(); + | + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/references/unit-to-itself.rs b/tests/ui/transmutability/references/unit-to-itself.rs index 789455c03ea17..87d001222f96e 100644 --- a/tests/ui/transmutability/references/unit-to-itself.rs +++ b/tests/ui/transmutability/references/unit-to-itself.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass #![feature(transmutability)] mod assert { diff --git a/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.next.stderr b/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.next.stderr new file mode 100644 index 0000000000000..2cbaa71262cea --- /dev/null +++ b/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.next.stderr @@ -0,0 +1,18 @@ +error[E0277]: `&mut Src` cannot be safely transmuted into `&mut u8` + --> $DIR/should_accept_if_ref_src_has_safety_invariant.rs:29:41 + | +LL | assert::is_transmutable::<&mut Src, &mut Dst>(); + | ^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `TransmuteFrom<&mut Src, Assume { alignment: false, lifetimes: false, safety: true, validity: false }>` is not implemented for `&mut u8` +note: required by a bound in `is_transmutable` + --> $DIR/should_accept_if_ref_src_has_safety_invariant.rs:19:14 + | +LL | pub fn is_transmutable() +LL | where +LL | Dst: TransmuteFrom + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_transmutable` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.rs b/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.rs index eca7a06559d21..32d70c3298eda 100644 --- a/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.rs +++ b/tests/ui/transmutability/safety/assume/should_accept_if_ref_src_has_safety_invariant.rs @@ -1,4 +1,8 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass //! When safety is assumed, a transmutation over exclusive references should be //! accepted if the source type potentially carries safety invariants. diff --git a/tests/ui/transmutability/transmute-higher-ranked.next.stderr b/tests/ui/transmutability/transmute-higher-ranked.next.stderr new file mode 100644 index 0000000000000..9d86559f62bcc --- /dev/null +++ b/tests/ui/transmutability/transmute-higher-ranked.next.stderr @@ -0,0 +1,18 @@ +error[E0277]: `&&u32` cannot be safely transmuted into `&&i32` + --> $DIR/transmute-higher-ranked.rs:21:5 + | +LL | transmute(); + | ^^^^^^^^^^^ unsatisfied trait bound + | + = help: the nightly-only, unstable trait `for<'a> TransmuteFrom<&'a &'a u32, Assume { alignment: false, lifetimes: false, safety: false, validity: false }>` is not implemented for `&'a &'a i32` +note: required by a bound in `transmute` + --> $DIR/transmute-higher-ranked.rs:16:26 + | +LL | pub fn transmute() +LL | where +LL | for<'a> &'a &'a i32: TransmuteFrom<&'a &'a u32>, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `transmute` + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0277`. diff --git a/tests/ui/transmutability/transmute-higher-ranked.rs b/tests/ui/transmutability/transmute-higher-ranked.rs index f0fe02a7908ee..fc0753942906a 100644 --- a/tests/ui/transmutability/transmute-higher-ranked.rs +++ b/tests/ui/transmutability/transmute-higher-ranked.rs @@ -1,7 +1,11 @@ // Ensure we don't ICE when transmuting higher-ranked types via a // higher-ranked transmute goal. -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#152 +//@[old] check-pass #![feature(transmutability)] diff --git a/tests/ui/type-alias-impl-trait/implied_bounds2.rs b/tests/ui/type-alias-impl-trait/implied_bounds2.rs index 0d829113ce708..99d125b23c486 100644 --- a/tests/ui/type-alias-impl-trait/implied_bounds2.rs +++ b/tests/ui/type-alias-impl-trait/implied_bounds2.rs @@ -1,4 +1,11 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] failure-status: 101 +//@[next] dont-check-compiler-stderr +//@[next] known-bug: trait-system-refactor-initiative#293 +//@[next] needs-rustc-debug-assertions +//@[old] check-pass #![feature(type_alias_impl_trait)] diff --git a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.stderr b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.old.stderr similarity index 88% rename from tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.stderr rename to tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.old.stderr index bbc0b91cd5031..7550f9ebf1151 100644 --- a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.stderr +++ b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.old.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/implied_lifetime_wf_check3.rs:15:5 + --> $DIR/implied_lifetime_wf_check3.rs:22:5 | LL | fn test_lifetime_param_test<'a>() | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | test_lifetime_param::assert_static::<'a>() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/implied_lifetime_wf_check3.rs:31:5 + --> $DIR/implied_lifetime_wf_check3.rs:38:5 | LL | fn test_higher_kinded_lifetime_param_test<'a>() | -- lifetime `'a` defined here @@ -17,7 +17,7 @@ LL | test_higher_kinded_lifetime_param::assert_static::<'a>() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/implied_lifetime_wf_check3.rs:38:9 + --> $DIR/implied_lifetime_wf_check3.rs:45:9 | LL | fn test<'a>() { | -- lifetime `'a` defined here @@ -25,7 +25,7 @@ LL | assert_static::<'a>() | ^^^^^^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` error[E0310]: the parameter type `A` may not live long enough - --> $DIR/implied_lifetime_wf_check3.rs:55:5 + --> $DIR/implied_lifetime_wf_check3.rs:62:5 | LL | test_type_param::assert_static::() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs index 889438d1b733e..80ead60158b3b 100644 --- a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs +++ b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check3.rs @@ -1,3 +1,10 @@ +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] failure-status: 101 +//@[next] dont-check-compiler-stderr +//@[next] known-bug: trait-system-refactor-initiative#293 +//@[next] needs-rustc-debug-assertions #![feature(type_alias_impl_trait)] mod test_lifetime_param { @@ -13,7 +20,7 @@ where test_lifetime_param::Ty<'a>: 'static, { test_lifetime_param::assert_static::<'a>() - //~^ ERROR: lifetime may not live long enough + //[old]~^ ERROR: lifetime may not live long enough } mod test_higher_kinded_lifetime_param { @@ -29,14 +36,14 @@ where for<'b> test_higher_kinded_lifetime_param::Ty<'b>: 'a, { test_higher_kinded_lifetime_param::assert_static::<'a>() - //~^ ERROR: lifetime may not live long enough + //[old]~^ ERROR: lifetime may not live long enough } mod test_higher_kinded_lifetime_param2 { fn assert_static<'a: 'static>() {} fn test<'a>() { assert_static::<'a>() - //~^ ERROR: lifetime may not live long enough + //[old]~^ ERROR: lifetime may not live long enough } } @@ -53,7 +60,7 @@ where test_type_param::Ty: 'static, { test_type_param::assert_static::() - //~^ ERROR: parameter type `A` may not live long enough + //[old]~^ ERROR: parameter type `A` may not live long enough } mod test_implied_from_fn_sig { diff --git a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.stderr b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.old.stderr similarity index 86% rename from tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.stderr rename to tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.old.stderr index 710e4a5ce9e82..56b4f601e3b0e 100644 --- a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.stderr +++ b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.old.stderr @@ -1,5 +1,5 @@ error[E0310]: the parameter type `A` may not live long enough - --> $DIR/implied_lifetime_wf_check4_static.rs:6:5 + --> $DIR/implied_lifetime_wf_check4_static.rs:13:5 | LL | s | ^ @@ -8,7 +8,7 @@ LL | s | ...so that the type `A` will meet its required lifetime bounds... | note: ...that is required by this bound - --> $DIR/implied_lifetime_wf_check4_static.rs:3:31 + --> $DIR/implied_lifetime_wf_check4_static.rs:10:31 | LL | pub type Ty = impl Sized + 'static; | ^^^^^^^ @@ -18,7 +18,7 @@ LL | pub type Ty = impl Sized + 'static; | +++++++++ error[E0310]: the parameter type `A` may not live long enough - --> $DIR/implied_lifetime_wf_check4_static.rs:15:5 + --> $DIR/implied_lifetime_wf_check4_static.rs:22:5 | LL | assert_static::() | ^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs index 5484b91e6f1f4..0759414f3148f 100644 --- a/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs +++ b/tests/ui/type-alias-impl-trait/implied_lifetime_wf_check4_static.rs @@ -1,10 +1,17 @@ +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] failure-status: 101 +//@[next] dont-check-compiler-stderr +//@[next] known-bug: trait-system-refactor-initiative#293 +//@[next] needs-rustc-debug-assertions #![feature(type_alias_impl_trait)] pub type Ty = impl Sized + 'static; #[define_opaque(Ty)] fn defining(s: A) -> Ty { s - //~^ ERROR: the parameter type `A` may not live long enough + //[old]~^ ERROR: the parameter type `A` may not live long enough } pub fn assert_static() {} @@ -13,7 +20,7 @@ where Ty: 'static, { assert_static::() - //~^ ERROR: the parameter type `A` may not live long enough + //[old]~^ ERROR: the parameter type `A` may not live long enough } fn main() {} diff --git a/tests/ui/type-alias-impl-trait/struct-assignment-validity.next.stderr b/tests/ui/type-alias-impl-trait/struct-assignment-validity.next.stderr new file mode 100644 index 0000000000000..78724a5ccec1c --- /dev/null +++ b/tests/ui/type-alias-impl-trait/struct-assignment-validity.next.stderr @@ -0,0 +1,23 @@ +error[E0391]: cycle detected when computing type of `::Assoc::{opaque#0}` + --> $DIR/struct-assignment-validity.rs:21:18 + | +LL | type Assoc = impl std::fmt::Debug; + | ^^^^^^^^^^^^^^^^^^^^ + | + = note: ...which requires computing type of opaque `::Assoc::{opaque#0}`... +note: ...which requires borrow-checking `::foo`... + --> $DIR/struct-assignment-validity.rs:22:5 + | +LL | / fn foo() -> Foo +LL | | where +LL | | Self::Assoc:, + | |_____________________^ + = note: ...which requires promoting constants in MIR for `::foo`... + = note: ...which requires normalizing `::Assoc`... + = note: ...which again requires computing type of `::Assoc::{opaque#0}`, completing the cycle + = note: cycle used when checking that `::Assoc::{opaque#0}` is well-formed + = note: for more information, see and + +error: aborting due to 1 previous error + +For more information about this error, try `rustc --explain E0391`. diff --git a/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs b/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs index c52dbd3253905..608c804be9c94 100644 --- a/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs +++ b/tests/ui/type-alias-impl-trait/struct-assignment-validity.rs @@ -1,5 +1,9 @@ +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] known-bug: trait-system-refactor-initiative#303 //@ compile-flags: -Zvalidate-mir -//@ check-pass +//@[old] check-pass // Check that we don't cause cycle errors when validating pre-`RevealOpaques` MIR // that assigns opaques through normalized projections. diff --git a/tests/ui/type-alias-impl-trait/unbounded_opaque_type.rs b/tests/ui/type-alias-impl-trait/unbounded_opaque_type.rs index 063c4deaf06ee..44ccc5c22e09d 100644 --- a/tests/ui/type-alias-impl-trait/unbounded_opaque_type.rs +++ b/tests/ui/type-alias-impl-trait/unbounded_opaque_type.rs @@ -1,4 +1,11 @@ -//@ check-pass +//@ revisions: old next +//@ ignore-compare-mode-next-solver (explicit revisions) +//@[next] compile-flags: -Znext-solver +//@[next] failure-status: 101 +//@[next] dont-check-compiler-stderr +//@[next] known-bug: trait-system-refactor-initiative#293 +//@[next] needs-rustc-debug-assertions +//@[old] check-pass #![feature(type_alias_impl_trait)] diff --git a/tests/ui/union/union-inherent-method.rs b/tests/ui/union/union-inherent-method.rs index 86a62ff18cd3d..b3b0fec8c1f37 100644 --- a/tests/ui/union/union-inherent-method.rs +++ b/tests/ui/union/union-inherent-method.rs @@ -1,5 +1,5 @@ //@ run-pass -//@ reference: items.impl.inherent.associated-items.allowed-items +//@ reference: items.impl.inherent.allowed-items union U { a: u8,