| author | bors <bors@rust-lang.org> 2026-02-18 11:12:36 UTC |
| committer | bors <bors@rust-lang.org> 2026-02-18 11:12:36 UTC |
| log | c043085801b7a884054add21a94882216df5971c |
| tree | a1a125e8def6f7efc221221c2a5652cfe5ed2e7f |
| parent | 8387095803f21a256a9a772ac1f9b41ed4d5aa0a |
| parent | 8a2c6ea4097f8bd2f282af2c491ff58622d12bbe |
Rollup of 20 pull requests
Successful merges:
- rust-lang/rust#145399 (Unify wording of resolve error)
- rust-lang/rust#150473 (tail calls: fix copying non-scalar arguments to callee)
- rust-lang/rust#152637 (Add a note about elided lifetime)
- rust-lang/rust#152729 (compiler: Don't mark `SingleUseConsts` MIR pass as "required for soundness")
- rust-lang/rust#152751 (Rename dep node "fingerprints" to distinguish key and value hashes)
- rust-lang/rust#152753 (remove the explicit error for old `rental` versions)
- rust-lang/rust#152758 (Remove ShallowInitBox.)
- rust-lang/rust#151530 (Fix invalid `mut T` suggestion for `&mut T` in missing lifetime error)
- rust-lang/rust#152179 (Add documentation note about signed overflow direction)
- rust-lang/rust#152474 (Implement opt-bisect-limit for MIR)
- rust-lang/rust#152509 (tests/ui/test-attrs: add annotations for reference rules)
- rust-lang/rust#152672 (std: use libc version of `_NSGetArgc`/`_NSGetArgv`)
- rust-lang/rust#152711 (resolve: Disable an assert that no longer holds)
- rust-lang/rust#152725 (Rework explanation of CLI lint level flags)
- rust-lang/rust#152732 (add regression test for 147958)
- rust-lang/rust#152745 (Fix ICE in `suggest_param_env_shadowing` with incompatible args)
- rust-lang/rust#152749 (make `rustc_allow_const_fn_unstable` an actual `rustc_attrs` attribute)
- rust-lang/rust#152756 (Miri: recursive validity: also recurse into Boxes)
- rust-lang/rust#152770 (carryless_mul: mention the base)
- rust-lang/rust#152778 (Update tracking issue number for final_associated_functions)365 files changed, 2074 insertions(+), 1582 deletions(-)
compiler/rustc_borrowck/src/lib.rs+1-2| ... | ... | @@ -1544,8 +1544,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> { |
| 1544 | 1544 | Rvalue::Use(operand) |
| 1545 | 1545 | | Rvalue::Repeat(operand, _) |
| 1546 | 1546 | | Rvalue::UnaryOp(_ /*un_op*/, operand) |
| 1547 | | Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/) | |
| 1548 | | Rvalue::ShallowInitBox(operand, _ /*ty*/) => { | |
| 1547 | | Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/) => { | |
| 1549 | 1548 | self.consume_operand(location, (operand, span), state) |
| 1550 | 1549 | } |
| 1551 | 1550 |
compiler/rustc_borrowck/src/polonius/legacy/loan_invalidations.rs+3-2| ... | ... | @@ -297,8 +297,9 @@ impl<'a, 'tcx> LoanInvalidationsGenerator<'a, 'tcx> { |
| 297 | 297 | Rvalue::Use(operand) |
| 298 | 298 | | Rvalue::Repeat(operand, _) |
| 299 | 299 | | Rvalue::UnaryOp(_ /*un_op*/, operand) |
| 300 | | Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/) | |
| 301 | | Rvalue::ShallowInitBox(operand, _ /*ty*/) => self.consume_operand(location, operand), | |
| 300 | | Rvalue::Cast(_ /*cast_kind*/, operand, _ /*ty*/) => { | |
| 301 | self.consume_operand(location, operand) | |
| 302 | } | |
| 302 | 303 | |
| 303 | 304 | &Rvalue::Discriminant(place) => { |
| 304 | 305 | self.access_place( |
compiler/rustc_borrowck/src/type_check/mod.rs-12| ... | ... | @@ -1004,17 +1004,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { |
| 1004 | 1004 | } |
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | Rvalue::ShallowInitBox(_operand, ty) => { | |
| 1008 | let trait_ref = | |
| 1009 | ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, span), [*ty]); | |
| 1010 | ||
| 1011 | self.prove_trait_ref( | |
| 1012 | trait_ref, | |
| 1013 | location.to_locations(), | |
| 1014 | ConstraintCategory::SizedBound, | |
| 1015 | ); | |
| 1016 | } | |
| 1017 | ||
| 1018 | 1007 | Rvalue::Cast(cast_kind, op, ty) => { |
| 1019 | 1008 | match *cast_kind { |
| 1020 | 1009 | CastKind::PointerCoercion( |
| ... | ... | @@ -2231,7 +2220,6 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { |
| 2231 | 2220 | | Rvalue::Ref(..) |
| 2232 | 2221 | | Rvalue::RawPtr(..) |
| 2233 | 2222 | | Rvalue::Cast(..) |
| 2234 | | Rvalue::ShallowInitBox(..) | |
| 2235 | 2223 | | Rvalue::BinaryOp(..) |
| 2236 | 2224 | | Rvalue::CopyForDeref(..) |
| 2237 | 2225 | | Rvalue::UnaryOp(..) |
compiler/rustc_codegen_cranelift/src/base.rs-1| ... | ... | @@ -902,7 +902,6 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt: |
| 902 | 902 | lval.write_cvalue_transmute(fx, operand); |
| 903 | 903 | } |
| 904 | 904 | Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in codegen"), |
| 905 | Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in codegen"), | |
| 906 | 905 | } |
| 907 | 906 | } |
| 908 | 907 | StatementKind::StorageLive(_) |
compiler/rustc_codegen_ssa/src/mir/rvalue.rs-1| ... | ... | @@ -710,7 +710,6 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
| 710 | 710 | OperandRef { val: operand.val, layout, move_annotation: None } |
| 711 | 711 | } |
| 712 | 712 | mir::Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in codegen"), |
| 713 | mir::Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in codegen"), | |
| 714 | 713 | } |
| 715 | 714 | } |
| 716 | 715 |
compiler/rustc_const_eval/src/check_consts/check.rs-2| ... | ... | @@ -646,8 +646,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { |
| 646 | 646 | |
| 647 | 647 | Rvalue::Cast(_, _, _) => {} |
| 648 | 648 | |
| 649 | Rvalue::ShallowInitBox(_, _) => {} | |
| 650 | ||
| 651 | 649 | Rvalue::UnaryOp(op, operand) => { |
| 652 | 650 | let ty = operand.ty(self.body, self.tcx); |
| 653 | 651 | match op { |
compiler/rustc_const_eval/src/check_consts/qualifs.rs+1-2| ... | ... | @@ -237,8 +237,7 @@ where |
| 237 | 237 | Rvalue::Use(operand) |
| 238 | 238 | | Rvalue::Repeat(operand, _) |
| 239 | 239 | | Rvalue::UnaryOp(_, operand) |
| 240 | | Rvalue::Cast(_, operand, _) | |
| 241 | | Rvalue::ShallowInitBox(operand, _) => in_operand::<Q, _>(cx, in_local, operand), | |
| 240 | | Rvalue::Cast(_, operand, _) => in_operand::<Q, _>(cx, in_local, operand), | |
| 242 | 241 | |
| 243 | 242 | Rvalue::BinaryOp(_, box (lhs, rhs)) => { |
| 244 | 243 | in_operand::<Q, _>(cx, in_local, lhs) || in_operand::<Q, _>(cx, in_local, rhs) |
compiler/rustc_const_eval/src/check_consts/resolver.rs-1| ... | ... | @@ -192,7 +192,6 @@ where |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | mir::Rvalue::Cast(..) |
| 195 | | mir::Rvalue::ShallowInitBox(..) | |
| 196 | 195 | | mir::Rvalue::Use(..) |
| 197 | 196 | | mir::Rvalue::CopyForDeref(..) |
| 198 | 197 | | mir::Rvalue::ThreadLocalRef(..) |
compiler/rustc_const_eval/src/const_eval/machine.rs+1-1| ... | ... | @@ -236,7 +236,7 @@ impl<'tcx> CompileTimeInterpCx<'tcx> { |
| 236 | 236 | if self.tcx.is_lang_item(def_id, LangItem::PanicDisplay) |
| 237 | 237 | || self.tcx.is_lang_item(def_id, LangItem::BeginPanic) |
| 238 | 238 | { |
| 239 | let args = self.copy_fn_args(args); | |
| 239 | let args = Self::copy_fn_args(args); | |
| 240 | 240 | // &str or &&str |
| 241 | 241 | assert!(args.len() == 1); |
| 242 | 242 |
compiler/rustc_const_eval/src/interpret/call.rs+51-41| ... | ... | @@ -19,8 +19,8 @@ use tracing::{info, instrument, trace}; |
| 19 | 19 | |
| 20 | 20 | use super::{ |
| 21 | 21 | CtfeProvenance, FnVal, ImmTy, InterpCx, InterpResult, MPlaceTy, Machine, OpTy, PlaceTy, |
| 22 | Projectable, Provenance, ReturnAction, ReturnContinuation, Scalar, StackPopInfo, interp_ok, | |
| 23 | throw_ub, throw_ub_custom, | |
| 22 | Projectable, Provenance, ReturnAction, ReturnContinuation, Scalar, interp_ok, throw_ub, | |
| 23 | throw_ub_custom, | |
| 24 | 24 | }; |
| 25 | 25 | use crate::enter_trace_span; |
| 26 | 26 | use crate::interpret::EnteredTraceSpan; |
| ... | ... | @@ -43,25 +43,22 @@ impl<'tcx, Prov: Provenance> FnArg<'tcx, Prov> { |
| 43 | 43 | FnArg::InPlace(mplace) => &mplace.layout, |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | } | |
| 47 | 46 | |
| 48 | impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { | |
| 49 | 47 | /// Make a copy of the given fn_arg. Any `InPlace` are degenerated to copies, no protection of the |
| 50 | 48 | /// original memory occurs. |
| 51 | pub fn copy_fn_arg(&self, arg: &FnArg<'tcx, M::Provenance>) -> OpTy<'tcx, M::Provenance> { | |
| 52 | match arg { | |
| 49 | pub fn copy_fn_arg(&self) -> OpTy<'tcx, Prov> { | |
| 50 | match self { | |
| 53 | 51 | FnArg::Copy(op) => op.clone(), |
| 54 | 52 | FnArg::InPlace(mplace) => mplace.clone().into(), |
| 55 | 53 | } |
| 56 | 54 | } |
| 55 | } | |
| 57 | 56 | |
| 57 | impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { | |
| 58 | 58 | /// Make a copy of the given fn_args. Any `InPlace` are degenerated to copies, no protection of the |
| 59 | 59 | /// original memory occurs. |
| 60 | pub fn copy_fn_args( | |
| 61 | &self, | |
| 62 | args: &[FnArg<'tcx, M::Provenance>], | |
| 63 | ) -> Vec<OpTy<'tcx, M::Provenance>> { | |
| 64 | args.iter().map(|fn_arg| self.copy_fn_arg(fn_arg)).collect() | |
| 60 | pub fn copy_fn_args(args: &[FnArg<'tcx, M::Provenance>]) -> Vec<OpTy<'tcx, M::Provenance>> { | |
| 61 | args.iter().map(|fn_arg| fn_arg.copy_fn_arg()).collect() | |
| 65 | 62 | } |
| 66 | 63 | |
| 67 | 64 | /// Helper function for argument untupling. |
| ... | ... | @@ -319,7 +316,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 319 | 316 | // We work with a copy of the argument for now; if this is in-place argument passing, we |
| 320 | 317 | // will later protect the source it comes from. This means the callee cannot observe if we |
| 321 | 318 | // did in-place of by-copy argument passing, except for pointer equality tests. |
| 322 | let caller_arg_copy = self.copy_fn_arg(caller_arg); | |
| 319 | let caller_arg_copy = caller_arg.copy_fn_arg(); | |
| 323 | 320 | if !already_live { |
| 324 | 321 | let local = callee_arg.as_local().unwrap(); |
| 325 | 322 | let meta = caller_arg_copy.meta(); |
| ... | ... | @@ -616,7 +613,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 616 | 613 | if let Some(fallback) = M::call_intrinsic( |
| 617 | 614 | self, |
| 618 | 615 | instance, |
| 619 | &self.copy_fn_args(args), | |
| 616 | &Self::copy_fn_args(args), | |
| 620 | 617 | destination, |
| 621 | 618 | target, |
| 622 | 619 | unwind, |
| ... | ... | @@ -703,7 +700,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 703 | 700 | // An `InPlace` does nothing here, we keep the original receiver intact. We can't |
| 704 | 701 | // really pass the argument in-place anyway, and we are constructing a new |
| 705 | 702 | // `Immediate` receiver. |
| 706 | let mut receiver = self.copy_fn_arg(&args[0]); | |
| 703 | let mut receiver = args[0].copy_fn_arg(); | |
| 707 | 704 | let receiver_place = loop { |
| 708 | 705 | match receiver.layout.ty.kind() { |
| 709 | 706 | ty::Ref(..) | ty::RawPtr(..) => { |
| ... | ... | @@ -824,41 +821,50 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 824 | 821 | with_caller_location: bool, |
| 825 | 822 | ) -> InterpResult<'tcx> { |
| 826 | 823 | trace!("init_fn_tail_call: {:#?}", fn_val); |
| 827 | ||
| 828 | 824 | // This is the "canonical" implementation of tails calls, |
| 829 | 825 | // a pop of the current stack frame, followed by a normal call |
| 830 | 826 | // which pushes a new stack frame, with the return address from |
| 831 | 827 | // the popped stack frame. |
| 832 | 828 | // |
| 833 | // Note that we are using `pop_stack_frame_raw` and not `return_from_current_stack_frame`, | |
| 834 | // as the latter "executes" the goto to the return block, but we don't want to, | |
| 829 | // Note that we cannot use `return_from_current_stack_frame`, | |
| 830 | // as that "executes" the goto to the return block, but we don't want to, | |
| 835 | 831 | // only the tail called function should return to the current return block. |
| 836 | let StackPopInfo { return_action, return_cont, return_place } = | |
| 837 | self.pop_stack_frame_raw(false, |_this, _return_place| { | |
| 838 | // This function's return value is just discarded, the tail-callee will fill in the return place instead. | |
| 839 | interp_ok(()) | |
| 840 | })?; | |
| 841 | 832 | |
| 842 | assert_eq!(return_action, ReturnAction::Normal); | |
| 843 | ||
| 844 | // Take the "stack pop cleanup" info, and use that to initiate the next call. | |
| 845 | let ReturnContinuation::Goto { ret, unwind } = return_cont else { | |
| 846 | bug!("can't tailcall as root"); | |
| 833 | // The arguments need to all be copied since the current stack frame will be removed | |
| 834 | // before the callee even starts executing. | |
| 835 | // FIXME(explicit_tail_calls,#144855): does this match what codegen does? | |
| 836 | let args = args.iter().map(|fn_arg| FnArg::Copy(fn_arg.copy_fn_arg())).collect::<Vec<_>>(); | |
| 837 | // Remove the frame from the stack. | |
| 838 | let frame = self.pop_stack_frame_raw()?; | |
| 839 | // Remember where this frame would have returned to. | |
| 840 | let ReturnContinuation::Goto { ret, unwind } = frame.return_cont() else { | |
| 841 | bug!("can't tailcall as root of the stack"); | |
| 847 | 842 | }; |
| 848 | ||
| 843 | // There's no return value to deal with! Instead, we forward the old return place | |
| 844 | // to the new function. | |
| 849 | 845 | // FIXME(explicit_tail_calls): |
| 850 | 846 | // we should check if both caller&callee can/n't unwind, |
| 851 | 847 | // see <https://github.com/rust-lang/rust/pull/113128#issuecomment-1614979803> |
| 852 | 848 | |
| 849 | // Now push the new stack frame. | |
| 853 | 850 | self.init_fn_call( |
| 854 | 851 | fn_val, |
| 855 | 852 | (caller_abi, caller_fn_abi), |
| 856 | args, | |
| 853 | &*args, | |
| 857 | 854 | with_caller_location, |
| 858 | &return_place, | |
| 855 | frame.return_place(), | |
| 859 | 856 | ret, |
| 860 | 857 | unwind, |
| 861 | ) | |
| 858 | )?; | |
| 859 | ||
| 860 | // Finally, clear the local variables. Has to be done after pushing to support | |
| 861 | // non-scalar arguments. | |
| 862 | // FIXME(explicit_tail_calls,#144855): revisit this once codegen supports indirect | |
| 863 | // arguments, to ensure the semantics are compatible. | |
| 864 | let return_action = self.cleanup_stack_frame(/* unwinding */ false, frame)?; | |
| 865 | assert_eq!(return_action, ReturnAction::Normal); | |
| 866 | ||
| 867 | interp_ok(()) | |
| 862 | 868 | } |
| 863 | 869 | |
| 864 | 870 | pub(super) fn init_drop_in_place_call( |
| ... | ... | @@ -953,14 +959,18 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 953 | 959 | // local's value out. |
| 954 | 960 | let return_op = |
| 955 | 961 | self.local_to_op(mir::RETURN_PLACE, None).expect("return place should always be live"); |
| 956 | // Do the actual pop + copy. | |
| 957 | let stack_pop_info = self.pop_stack_frame_raw(unwinding, |this, return_place| { | |
| 958 | this.copy_op_allow_transmute(&return_op, return_place)?; | |
| 959 | trace!("return value: {:?}", this.dump_place(return_place)); | |
| 960 | interp_ok(()) | |
| 961 | })?; | |
| 962 | ||
| 963 | match stack_pop_info.return_action { | |
| 962 | // Remove the frame from the stack. | |
| 963 | let frame = self.pop_stack_frame_raw()?; | |
| 964 | // Copy the return value and remember the return continuation. | |
| 965 | if !unwinding { | |
| 966 | self.copy_op_allow_transmute(&return_op, frame.return_place())?; | |
| 967 | trace!("return value: {:?}", self.dump_place(frame.return_place())); | |
| 968 | } | |
| 969 | let return_cont = frame.return_cont(); | |
| 970 | // Finish popping the stack frame. | |
| 971 | let return_action = self.cleanup_stack_frame(unwinding, frame)?; | |
| 972 | // Jump to the next block. | |
| 973 | match return_action { | |
| 964 | 974 | ReturnAction::Normal => {} |
| 965 | 975 | ReturnAction::NoJump => { |
| 966 | 976 | // The hook already did everything. |
| ... | ... | @@ -978,7 +988,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 978 | 988 | // Normal return, figure out where to jump. |
| 979 | 989 | if unwinding { |
| 980 | 990 | // Follow the unwind edge. |
| 981 | match stack_pop_info.return_cont { | |
| 991 | match return_cont { | |
| 982 | 992 | ReturnContinuation::Goto { unwind, .. } => { |
| 983 | 993 | // This must be the very last thing that happens, since it can in fact push a new stack frame. |
| 984 | 994 | self.unwind_to_block(unwind) |
| ... | ... | @@ -989,7 +999,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 989 | 999 | } |
| 990 | 1000 | } else { |
| 991 | 1001 | // Follow the normal return edge. |
| 992 | match stack_pop_info.return_cont { | |
| 1002 | match return_cont { | |
| 993 | 1003 | ReturnContinuation::Goto { ret, .. } => self.return_to_block(ret), |
| 994 | 1004 | ReturnContinuation::Stop { .. } => { |
| 995 | 1005 | assert!( |
compiler/rustc_const_eval/src/interpret/mod.rs+1-1| ... | ... | @@ -36,7 +36,7 @@ pub use self::operand::{ImmTy, Immediate, OpTy}; |
| 36 | 36 | pub use self::place::{MPlaceTy, MemPlaceMeta, PlaceTy, Writeable}; |
| 37 | 37 | use self::place::{MemPlace, Place}; |
| 38 | 38 | pub use self::projection::{OffsetMode, Projectable}; |
| 39 | pub use self::stack::{Frame, FrameInfo, LocalState, ReturnContinuation, StackPopInfo}; | |
| 39 | pub use self::stack::{Frame, FrameInfo, LocalState, ReturnContinuation}; | |
| 40 | 40 | pub use self::util::EnteredTraceSpan; |
| 41 | 41 | pub(crate) use self::util::create_static_alloc; |
| 42 | 42 | pub use self::validity::{CtfeValidationMode, RangeSet, RefTracking}; |
compiler/rustc_const_eval/src/interpret/stack.rs+27-43| ... | ... | @@ -81,7 +81,7 @@ pub struct Frame<'tcx, Prov: Provenance = CtfeProvenance, Extra = ()> { |
| 81 | 81 | /// and its layout in the caller. This place is to be interpreted relative to the |
| 82 | 82 | /// *caller's* stack frame. We use a `PlaceTy` instead of an `MPlaceTy` since this |
| 83 | 83 | /// avoids having to move *all* return places into Miri's memory. |
| 84 | pub return_place: PlaceTy<'tcx, Prov>, | |
| 84 | return_place: PlaceTy<'tcx, Prov>, | |
| 85 | 85 | |
| 86 | 86 | /// The list of locals for this stack frame, stored in order as |
| 87 | 87 | /// `[return_ptr, arguments..., variables..., temporaries...]`. |
| ... | ... | @@ -127,19 +127,6 @@ pub enum ReturnContinuation { |
| 127 | 127 | Stop { cleanup: bool }, |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | /// Return type of [`InterpCx::pop_stack_frame_raw`]. | |
| 131 | pub struct StackPopInfo<'tcx, Prov: Provenance> { | |
| 132 | /// Additional information about the action to be performed when returning from the popped | |
| 133 | /// stack frame. | |
| 134 | pub return_action: ReturnAction, | |
| 135 | ||
| 136 | /// [`return_cont`](Frame::return_cont) of the popped stack frame. | |
| 137 | pub return_cont: ReturnContinuation, | |
| 138 | ||
| 139 | /// [`return_place`](Frame::return_place) of the popped stack frame. | |
| 140 | pub return_place: PlaceTy<'tcx, Prov>, | |
| 141 | } | |
| 142 | ||
| 143 | 130 | /// State of a local variable including a memoized layout |
| 144 | 131 | #[derive(Clone)] |
| 145 | 132 | pub struct LocalState<'tcx, Prov: Provenance = CtfeProvenance> { |
| ... | ... | @@ -292,6 +279,14 @@ impl<'tcx, Prov: Provenance, Extra> Frame<'tcx, Prov, Extra> { |
| 292 | 279 | self.instance |
| 293 | 280 | } |
| 294 | 281 | |
| 282 | pub fn return_place(&self) -> &PlaceTy<'tcx, Prov> { | |
| 283 | &self.return_place | |
| 284 | } | |
| 285 | ||
| 286 | pub fn return_cont(&self) -> ReturnContinuation { | |
| 287 | self.return_cont | |
| 288 | } | |
| 289 | ||
| 295 | 290 | /// Return the `SourceInfo` of the current instruction. |
| 296 | 291 | pub fn current_source_info(&self) -> Option<&mir::SourceInfo> { |
| 297 | 292 | self.loc.left().map(|loc| self.body.source_info(loc)) |
| ... | ... | @@ -417,35 +412,26 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 417 | 412 | interp_ok(()) |
| 418 | 413 | } |
| 419 | 414 | |
| 420 | /// Low-level helper that pops a stack frame from the stack and returns some information about | |
| 421 | /// it. | |
| 422 | /// | |
| 423 | /// This also deallocates locals, if necessary. | |
| 424 | /// `copy_ret_val` gets called after the frame has been taken from the stack but before the locals have been deallocated. | |
| 425 | /// | |
| 426 | /// [`M::before_stack_pop`] and [`M::after_stack_pop`] are called by this function | |
| 427 | /// automatically. | |
| 428 | /// | |
| 429 | /// The high-level version of this is `return_from_current_stack_frame`. | |
| 430 | /// | |
| 431 | /// [`M::before_stack_pop`]: Machine::before_stack_pop | |
| 432 | /// [`M::after_stack_pop`]: Machine::after_stack_pop | |
| 415 | /// Low-level helper that pops a stack frame from the stack without any cleanup. | |
| 416 | /// This invokes `before_stack_pop`. | |
| 417 | /// After calling this function, you need to deal with the return value, and then | |
| 418 | /// invoke `cleanup_stack_frame`. | |
| 433 | 419 | pub(super) fn pop_stack_frame_raw( |
| 434 | 420 | &mut self, |
| 435 | unwinding: bool, | |
| 436 | copy_ret_val: impl FnOnce(&mut Self, &PlaceTy<'tcx, M::Provenance>) -> InterpResult<'tcx>, | |
| 437 | ) -> InterpResult<'tcx, StackPopInfo<'tcx, M::Provenance>> { | |
| 421 | ) -> InterpResult<'tcx, Frame<'tcx, M::Provenance, M::FrameExtra>> { | |
| 438 | 422 | M::before_stack_pop(self)?; |
| 439 | 423 | let frame = |
| 440 | 424 | self.stack_mut().pop().expect("tried to pop a stack frame, but there were none"); |
| 425 | interp_ok(frame) | |
| 426 | } | |
| 441 | 427 | |
| 442 | // Copy return value (unless we are unwinding). | |
| 443 | if !unwinding { | |
| 444 | copy_ret_val(self, &frame.return_place)?; | |
| 445 | } | |
| 446 | ||
| 428 | /// Deallocate local variables in the stack frame, and invoke `after_stack_pop`. | |
| 429 | pub(super) fn cleanup_stack_frame( | |
| 430 | &mut self, | |
| 431 | unwinding: bool, | |
| 432 | frame: Frame<'tcx, M::Provenance, M::FrameExtra>, | |
| 433 | ) -> InterpResult<'tcx, ReturnAction> { | |
| 447 | 434 | let return_cont = frame.return_cont; |
| 448 | let return_place = frame.return_place.clone(); | |
| 449 | 435 | |
| 450 | 436 | // Cleanup: deallocate locals. |
| 451 | 437 | // Usually we want to clean up (deallocate locals), but in a few rare cases we don't. |
| ... | ... | @@ -455,7 +441,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 455 | 441 | ReturnContinuation::Stop { cleanup, .. } => cleanup, |
| 456 | 442 | }; |
| 457 | 443 | |
| 458 | let return_action = if cleanup { | |
| 444 | if cleanup { | |
| 459 | 445 | for local in &frame.locals { |
| 460 | 446 | self.deallocate_local(local.value)?; |
| 461 | 447 | } |
| ... | ... | @@ -466,13 +452,11 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 466 | 452 | // Call the machine hook, which determines the next steps. |
| 467 | 453 | let return_action = M::after_stack_pop(self, frame, unwinding)?; |
| 468 | 454 | assert_ne!(return_action, ReturnAction::NoCleanup); |
| 469 | return_action | |
| 455 | interp_ok(return_action) | |
| 470 | 456 | } else { |
| 471 | 457 | // We also skip the machine hook when there's no cleanup. This not a real "pop" anyway. |
| 472 | ReturnAction::NoCleanup | |
| 473 | }; | |
| 474 | ||
| 475 | interp_ok(StackPopInfo { return_action, return_cont, return_place }) | |
| 458 | interp_ok(ReturnAction::NoCleanup) | |
| 459 | } | |
| 476 | 460 | } |
| 477 | 461 | |
| 478 | 462 | /// In the current stack frame, mark all locals as live that are not arguments and don't have |
| ... | ... | @@ -655,7 +639,7 @@ impl<'a, 'tcx: 'a, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 655 | 639 | let (_idx, callee_abi) = callee_abis.next().unwrap(); |
| 656 | 640 | assert!(self.check_argument_compat(caller_abi, callee_abi)?); |
| 657 | 641 | // FIXME: do we have to worry about in-place argument passing? |
| 658 | let op = self.copy_fn_arg(fn_arg); | |
| 642 | let op = fn_arg.copy_fn_arg(); | |
| 659 | 643 | let mplace = self.allocate(op.layout, MemoryKind::Stack)?; |
| 660 | 644 | self.copy_op(&op, &mplace)?; |
| 661 | 645 |
compiler/rustc_const_eval/src/interpret/step.rs-6| ... | ... | @@ -249,12 +249,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 249 | 249 | self.write_immediate(*val, &dest)?; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | ShallowInitBox(ref operand, _) => { | |
| 253 | let src = self.eval_operand(operand, None)?; | |
| 254 | let v = self.read_immediate(&src)?; | |
| 255 | self.write_immediate(*v, &dest)?; | |
| 256 | } | |
| 257 | ||
| 258 | 252 | Cast(cast_kind, ref operand, cast_ty) => { |
| 259 | 253 | let src = self.eval_operand(operand, None)?; |
| 260 | 254 | let cast_ty = |
compiler/rustc_const_eval/src/interpret/validity.rs+1-6| ... | ... | @@ -647,13 +647,8 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { |
| 647 | 647 | } |
| 648 | 648 | } else { |
| 649 | 649 | // This is not CTFE, so it's Miri with recursive checking. |
| 650 | // FIXME: we do *not* check behind boxes, since creating a new box first creates it uninitialized | |
| 651 | // and then puts the value in there, so briefly we have a box with uninit contents. | |
| 652 | // FIXME: should we also skip `UnsafeCell` behind shared references? Currently that is not | |
| 650 | // FIXME: should we also `UnsafeCell` behind shared references? Currently that is not | |
| 653 | 651 | // needed since validation reads bypass Stacked Borrows and data race checks. |
| 654 | if matches!(ptr_kind, PointerKind::Box) { | |
| 655 | return interp_ok(()); | |
| 656 | } | |
| 657 | 652 | } |
| 658 | 653 | let path = &self.path; |
| 659 | 654 | ref_tracking.track(place, || { |
compiler/rustc_expand/src/base.rs+3-81| ... | ... | @@ -2,12 +2,11 @@ use std::any::Any; |
| 2 | 2 | use std::default::Default; |
| 3 | 3 | use std::iter; |
| 4 | 4 | use std::path::Component::Prefix; |
| 5 | use std::path::{Path, PathBuf}; | |
| 5 | use std::path::PathBuf; | |
| 6 | 6 | use std::rc::Rc; |
| 7 | 7 | use std::sync::Arc; |
| 8 | 8 | |
| 9 | 9 | use rustc_ast::attr::MarkedAttrs; |
| 10 | use rustc_ast::token::MetaVarKind; | |
| 11 | 10 | use rustc_ast::tokenstream::TokenStream; |
| 12 | 11 | use rustc_ast::visit::{AssocCtxt, Visitor}; |
| 13 | 12 | use rustc_ast::{self as ast, AttrVec, Attribute, HasAttrs, Item, NodeId, PatKind, Safety}; |
| ... | ... | @@ -22,14 +21,14 @@ use rustc_hir::limit::Limit; |
| 22 | 21 | use rustc_hir::{Stability, find_attr}; |
| 23 | 22 | use rustc_lint_defs::RegisteredTools; |
| 24 | 23 | use rustc_parse::MACRO_ARGUMENTS; |
| 25 | use rustc_parse::parser::{AllowConstBlockItems, ForceCollect, Parser}; | |
| 24 | use rustc_parse::parser::Parser; | |
| 26 | 25 | use rustc_session::Session; |
| 27 | 26 | use rustc_session::parse::ParseSess; |
| 28 | 27 | use rustc_span::def_id::{CrateNum, DefId, LocalDefId}; |
| 29 | 28 | use rustc_span::edition::Edition; |
| 30 | 29 | use rustc_span::hygiene::{AstPass, ExpnData, ExpnKind, LocalExpnId, MacroKind}; |
| 31 | 30 | use rustc_span::source_map::SourceMap; |
| 32 | use rustc_span::{DUMMY_SP, FileName, Ident, Span, Symbol, kw, sym}; | |
| 31 | use rustc_span::{DUMMY_SP, Ident, Span, Symbol, kw}; | |
| 33 | 32 | use smallvec::{SmallVec, smallvec}; |
| 34 | 33 | use thin_vec::ThinVec; |
| 35 | 34 | |
| ... | ... | @@ -1421,80 +1420,3 @@ pub fn resolve_path(sess: &Session, path: impl Into<PathBuf>, span: Span) -> PRe |
| 1421 | 1420 | } |
| 1422 | 1421 | } |
| 1423 | 1422 | } |
| 1424 | ||
| 1425 | /// If this item looks like a specific enums from `rental`, emit a fatal error. | |
| 1426 | /// See #73345 and #83125 for more details. | |
| 1427 | /// FIXME(#73933): Remove this eventually. | |
| 1428 | fn pretty_printing_compatibility_hack(item: &Item, psess: &ParseSess) { | |
| 1429 | if let ast::ItemKind::Enum(ident, _, enum_def) = &item.kind | |
| 1430 | && ident.name == sym::ProceduralMasqueradeDummyType | |
| 1431 | && let [variant] = &*enum_def.variants | |
| 1432 | && variant.ident.name == sym::Input | |
| 1433 | && let FileName::Real(real) = psess.source_map().span_to_filename(ident.span) | |
| 1434 | && let Some(c) = real | |
| 1435 | .local_path() | |
| 1436 | .unwrap_or(Path::new("")) | |
| 1437 | .components() | |
| 1438 | .flat_map(|c| c.as_os_str().to_str()) | |
| 1439 | .find(|c| c.starts_with("rental") || c.starts_with("allsorts-rental")) | |
| 1440 | { | |
| 1441 | let crate_matches = if c.starts_with("allsorts-rental") { | |
| 1442 | true | |
| 1443 | } else { | |
| 1444 | let mut version = c.trim_start_matches("rental-").split('.'); | |
| 1445 | version.next() == Some("0") | |
| 1446 | && version.next() == Some("5") | |
| 1447 | && version.next().and_then(|c| c.parse::<u32>().ok()).is_some_and(|v| v < 6) | |
| 1448 | }; | |
| 1449 | ||
| 1450 | if crate_matches { | |
| 1451 | psess.dcx().emit_fatal(errors::ProcMacroBackCompat { | |
| 1452 | crate_name: "rental".to_string(), | |
| 1453 | fixed_version: "0.5.6".to_string(), | |
| 1454 | }); | |
| 1455 | } | |
| 1456 | } | |
| 1457 | } | |
| 1458 | ||
| 1459 | pub(crate) fn ann_pretty_printing_compatibility_hack(ann: &Annotatable, psess: &ParseSess) { | |
| 1460 | let item = match ann { | |
| 1461 | Annotatable::Item(item) => item, | |
| 1462 | Annotatable::Stmt(stmt) => match &stmt.kind { | |
| 1463 | ast::StmtKind::Item(item) => item, | |
| 1464 | _ => return, | |
| 1465 | }, | |
| 1466 | _ => return, | |
| 1467 | }; | |
| 1468 | pretty_printing_compatibility_hack(item, psess) | |
| 1469 | } | |
| 1470 | ||
| 1471 | pub(crate) fn stream_pretty_printing_compatibility_hack( | |
| 1472 | kind: MetaVarKind, | |
| 1473 | stream: &TokenStream, | |
| 1474 | psess: &ParseSess, | |
| 1475 | ) { | |
| 1476 | let item = match kind { | |
| 1477 | MetaVarKind::Item => { | |
| 1478 | let mut parser = Parser::new(psess, stream.clone(), None); | |
| 1479 | // No need to collect tokens for this simple check. | |
| 1480 | parser | |
| 1481 | .parse_item(ForceCollect::No, AllowConstBlockItems::No) | |
| 1482 | .expect("failed to reparse item") | |
| 1483 | .expect("an actual item") | |
| 1484 | } | |
| 1485 | MetaVarKind::Stmt => { | |
| 1486 | let mut parser = Parser::new(psess, stream.clone(), None); | |
| 1487 | // No need to collect tokens for this simple check. | |
| 1488 | let stmt = parser | |
| 1489 | .parse_stmt(ForceCollect::No) | |
| 1490 | .expect("failed to reparse") | |
| 1491 | .expect("an actual stmt"); | |
| 1492 | match &stmt.kind { | |
| 1493 | ast::StmtKind::Item(item) => item.clone(), | |
| 1494 | _ => return, | |
| 1495 | } | |
| 1496 | } | |
| 1497 | _ => return, | |
| 1498 | }; | |
| 1499 | pretty_printing_compatibility_hack(&item, psess) | |
| 1500 | } |
compiler/rustc_expand/src/errors.rs-12| ... | ... | @@ -446,18 +446,6 @@ pub(crate) struct GlobDelegationTraitlessQpath { |
| 446 | 446 | pub span: Span, |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | // This used to be the `proc_macro_back_compat` lint (#83125). It was later | |
| 450 | // turned into a hard error. | |
| 451 | #[derive(Diagnostic)] | |
| 452 | #[diag("using an old version of `{$crate_name}`")] | |
| 453 | #[note( | |
| 454 | "older versions of the `{$crate_name}` crate no longer compile; please update to `{$crate_name}` v{$fixed_version}, or switch to one of the `{$crate_name}` alternatives" | |
| 455 | )] | |
| 456 | pub(crate) struct ProcMacroBackCompat { | |
| 457 | pub crate_name: String, | |
| 458 | pub fixed_version: String, | |
| 459 | } | |
| 460 | ||
| 461 | 449 | pub(crate) use metavar_exprs::*; |
| 462 | 450 | mod metavar_exprs { |
| 463 | 451 | use super::*; |
compiler/rustc_expand/src/proc_macro.rs-5| ... | ... | @@ -105,11 +105,6 @@ impl MultiItemModifier for DeriveProcMacro { |
| 105 | 105 | // (e.g. `fn foo() { #[derive(Debug)] struct Bar; }`) |
| 106 | 106 | let is_stmt = matches!(item, Annotatable::Stmt(..)); |
| 107 | 107 | |
| 108 | // We used to have an alternative behaviour for crates that needed it. | |
| 109 | // We had a lint for a long time, but now we just emit a hard error. | |
| 110 | // Eventually we might remove the special case hard error check | |
| 111 | // altogether. See #73345. | |
| 112 | crate::base::ann_pretty_printing_compatibility_hack(&item, &ecx.sess.psess); | |
| 113 | 108 | let input = item.to_tokens(); |
| 114 | 109 | |
| 115 | 110 | let invoc_id = ecx.current_expansion.id; |
compiler/rustc_expand/src/proc_macro_server.rs+3-19| ... | ... | @@ -103,8 +103,8 @@ impl ToInternal<token::LitKind> for LitKind { |
| 103 | 103 | } |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | impl FromInternal<(TokenStream, &mut Rustc<'_, '_>)> for Vec<TokenTree<TokenStream, Span, Symbol>> { | |
| 107 | fn from_internal((stream, rustc): (TokenStream, &mut Rustc<'_, '_>)) -> Self { | |
| 106 | impl FromInternal<TokenStream> for Vec<TokenTree<TokenStream, Span, Symbol>> { | |
| 107 | fn from_internal(stream: TokenStream) -> Self { | |
| 108 | 108 | use rustc_ast::token::*; |
| 109 | 109 | |
| 110 | 110 | // Estimate the capacity as `stream.len()` rounded up to the next power |
| ... | ... | @@ -115,22 +115,6 @@ impl FromInternal<(TokenStream, &mut Rustc<'_, '_>)> for Vec<TokenTree<TokenStre |
| 115 | 115 | while let Some(tree) = iter.next() { |
| 116 | 116 | let (Token { kind, span }, joint) = match tree.clone() { |
| 117 | 117 | tokenstream::TokenTree::Delimited(span, _, mut delim, mut stream) => { |
| 118 | // We used to have an alternative behaviour for crates that | |
| 119 | // needed it: a hack used to pass AST fragments to | |
| 120 | // attribute and derive macros as a single nonterminal | |
| 121 | // token instead of a token stream. Such token needs to be | |
| 122 | // "unwrapped" and not represented as a delimited group. We | |
| 123 | // had a lint for a long time, but now we just emit a hard | |
| 124 | // error. Eventually we might remove the special case hard | |
| 125 | // error check altogether. See #73345. | |
| 126 | if let Delimiter::Invisible(InvisibleOrigin::MetaVar(kind)) = delim { | |
| 127 | crate::base::stream_pretty_printing_compatibility_hack( | |
| 128 | kind, | |
| 129 | &stream, | |
| 130 | rustc.psess(), | |
| 131 | ); | |
| 132 | } | |
| 133 | ||
| 134 | 118 | // In `mk_delimited` we avoid nesting invisible delimited |
| 135 | 119 | // of the same `MetaVarKind`. Here we do the same but |
| 136 | 120 | // ignore the `MetaVarKind` because it is discarded when we |
| ... | ... | @@ -687,7 +671,7 @@ impl server::Server for Rustc<'_, '_> { |
| 687 | 671 | &mut self, |
| 688 | 672 | stream: Self::TokenStream, |
| 689 | 673 | ) -> Vec<TokenTree<Self::TokenStream, Self::Span, Self::Symbol>> { |
| 690 | FromInternal::from_internal((stream, self)) | |
| 674 | FromInternal::from_internal(stream) | |
| 691 | 675 | } |
| 692 | 676 | |
| 693 | 677 | fn span_debug(&mut self, span: Self::Span) -> String { |
compiler/rustc_feature/src/builtin_attrs.rs+1-1| ... | ... | @@ -1208,7 +1208,7 @@ pub static BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ |
| 1208 | 1208 | rustc_intrinsic_const_stable_indirect, Normal, |
| 1209 | 1209 | template!(Word), WarnFollowing, EncodeCrossCrate::No, "this is an internal implementation detail", |
| 1210 | 1210 | ), |
| 1211 | gated!( | |
| 1211 | rustc_attr!( | |
| 1212 | 1212 | rustc_allow_const_fn_unstable, Normal, |
| 1213 | 1213 | template!(Word, List: &["feat1, feat2, ..."]), DuplicatesOk, EncodeCrossCrate::No, |
| 1214 | 1214 | "rustc_allow_const_fn_unstable side-steps feature gating and stability checks" |
compiler/rustc_feature/src/unstable.rs+1-5| ... | ... | @@ -287,10 +287,6 @@ declare_features! ( |
| 287 | 287 | (internal, panic_runtime, "1.10.0", Some(32837)), |
| 288 | 288 | /// Allows using pattern types. |
| 289 | 289 | (internal, pattern_types, "1.79.0", Some(123646)), |
| 290 | /// Allows using `#[rustc_allow_const_fn_unstable]`. | |
| 291 | /// This is an attribute on `const fn` for the same | |
| 292 | /// purpose as `#[allow_internal_unstable]`. | |
| 293 | (internal, rustc_allow_const_fn_unstable, "1.49.0", Some(69399)), | |
| 294 | 290 | /// Allows using compiler's own crates. |
| 295 | 291 | (unstable, rustc_private, "1.0.0", Some(27812)), |
| 296 | 292 | /// Allows using internal rustdoc features like `doc(keyword)`. |
| ... | ... | @@ -493,7 +489,7 @@ declare_features! ( |
| 493 | 489 | /// Allows the use of `#[ffi_pure]` on foreign functions. |
| 494 | 490 | (unstable, ffi_pure, "1.45.0", Some(58329)), |
| 495 | 491 | /// Allows marking trait functions as `final` to prevent overriding impls |
| 496 | (unstable, final_associated_functions, "CURRENT_RUSTC_VERSION", Some(1)), | |
| 492 | (unstable, final_associated_functions, "CURRENT_RUSTC_VERSION", Some(131179)), | |
| 497 | 493 | /// Controlling the behavior of fmt::Debug |
| 498 | 494 | (unstable, fmt_debug, "1.82.0", Some(129709)), |
| 499 | 495 | /// Allows using `#[align(...)]` on function items |
compiler/rustc_incremental/src/persist/clean.rs+1-1| ... | ... | @@ -322,7 +322,7 @@ impl<'tcx> CleanVisitor<'tcx> { |
| 322 | 322 | if let Some(def_id) = dep_node.extract_def_id(self.tcx) { |
| 323 | 323 | format!("{:?}({})", dep_node.kind, self.tcx.def_path_str(def_id)) |
| 324 | 324 | } else { |
| 325 | format!("{:?}({:?})", dep_node.kind, dep_node.hash) | |
| 325 | format!("{:?}({:?})", dep_node.kind, dep_node.key_fingerprint) | |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 |
compiler/rustc_middle/src/dep_graph/dep_node.rs+44-42| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | //! This module defines the [`DepNode`] type which the compiler uses to represent |
| 2 | 2 | //! nodes in the [dependency graph]. A `DepNode` consists of a [`DepKind`] (which |
| 3 | 3 | //! specifies the kind of thing it represents, like a piece of HIR, MIR, etc.) |
| 4 | //! and a [`Fingerprint`], a 128-bit hash value, the exact meaning of which | |
| 5 | //! depends on the node's `DepKind`. Together, the kind and the fingerprint | |
| 4 | //! and a "key fingerprint", a 128-bit hash value, the exact meaning of which | |
| 5 | //! depends on the node's `DepKind`. Together, the kind and the key fingerprint | |
| 6 | 6 | //! fully identify a dependency node, even across multiple compilation sessions. |
| 7 | //! In other words, the value of the fingerprint does not depend on anything | |
| 7 | //! In other words, the value of the key fingerprint does not depend on anything | |
| 8 | 8 | //! that is specific to a given compilation session, like an unpredictable |
| 9 | 9 | //! interning key (e.g., `NodeId`, `DefId`, `Symbol`) or the numeric value of a |
| 10 | 10 | //! pointer. The concept behind this could be compared to how git commit hashes |
| ... | ... | @@ -41,17 +41,9 @@ |
| 41 | 41 | //! `DepNode`s could represent global concepts with only one value. |
| 42 | 42 | //! * Whether it is possible, in principle, to reconstruct a query key from a |
| 43 | 43 | //! given `DepNode`. Many `DepKind`s only require a single `DefId` parameter, |
| 44 | //! in which case it is possible to map the node's fingerprint back to the | |
| 44 | //! in which case it is possible to map the node's key fingerprint back to the | |
| 45 | 45 | //! `DefId` it was computed from. In other cases, too much information gets |
| 46 | //! lost during fingerprint computation. | |
| 47 | //! | |
| 48 | //! `make_compile_codegen_unit` and `make_compile_mono_items`, together with | |
| 49 | //! `DepNode::new()`, ensure that only valid `DepNode` instances can be | |
| 50 | //! constructed. For example, the API does not allow for constructing | |
| 51 | //! parameterless `DepNode`s with anything other than a zeroed out fingerprint. | |
| 52 | //! More generally speaking, it relieves the user of the `DepNode` API of | |
| 53 | //! having to know how to compute the expected fingerprint for a given set of | |
| 54 | //! node parameters. | |
| 46 | //! lost when computing a key fingerprint. | |
| 55 | 47 | //! |
| 56 | 48 | //! [dependency graph]: https://rustc-dev-guide.rust-lang.org/query.html |
| 57 | 49 | |
| ... | ... | @@ -65,7 +57,7 @@ use rustc_hir::definitions::DefPathHash; |
| 65 | 57 | use rustc_macros::{Decodable, Encodable}; |
| 66 | 58 | use rustc_span::Symbol; |
| 67 | 59 | |
| 68 | use super::{FingerprintStyle, SerializedDepNodeIndex}; | |
| 60 | use super::{KeyFingerprintStyle, SerializedDepNodeIndex}; | |
| 69 | 61 | use crate::ich::StableHashingContext; |
| 70 | 62 | use crate::mir::mono::MonoItem; |
| 71 | 63 | use crate::ty::{TyCtxt, tls}; |
| ... | ... | @@ -125,10 +117,20 @@ impl fmt::Debug for DepKind { |
| 125 | 117 | } |
| 126 | 118 | } |
| 127 | 119 | |
| 120 | /// Combination of a [`DepKind`] and a key fingerprint that uniquely identifies | |
| 121 | /// a node in the dep graph. | |
| 128 | 122 | #[derive(Clone, Copy, PartialEq, Eq, Hash)] |
| 129 | 123 | pub struct DepNode { |
| 130 | 124 | pub kind: DepKind, |
| 131 | pub hash: PackedFingerprint, | |
| 125 | ||
| 126 | /// This is _typically_ a hash of the query key, but sometimes not. | |
| 127 | /// | |
| 128 | /// For example, `anon` nodes have a fingerprint that is derived from their | |
| 129 | /// dependencies instead of a key. | |
| 130 | /// | |
| 131 | /// In some cases the key value can be reconstructed from this fingerprint; | |
| 132 | /// see [`KeyFingerprintStyle`]. | |
| 133 | pub key_fingerprint: PackedFingerprint, | |
| 132 | 134 | } |
| 133 | 135 | |
| 134 | 136 | impl DepNode { |
| ... | ... | @@ -136,24 +138,23 @@ impl DepNode { |
| 136 | 138 | /// that the DepNode corresponding to the given DepKind actually |
| 137 | 139 | /// does not require any parameters. |
| 138 | 140 | pub fn new_no_params<'tcx>(tcx: TyCtxt<'tcx>, kind: DepKind) -> DepNode { |
| 139 | debug_assert_eq!(tcx.fingerprint_style(kind), FingerprintStyle::Unit); | |
| 140 | DepNode { kind, hash: Fingerprint::ZERO.into() } | |
| 141 | debug_assert_eq!(tcx.key_fingerprint_style(kind), KeyFingerprintStyle::Unit); | |
| 142 | DepNode { kind, key_fingerprint: Fingerprint::ZERO.into() } | |
| 141 | 143 | } |
| 142 | 144 | |
| 143 | pub fn construct<'tcx, Key>(tcx: TyCtxt<'tcx>, kind: DepKind, arg: &Key) -> DepNode | |
| 145 | pub fn construct<'tcx, Key>(tcx: TyCtxt<'tcx>, kind: DepKind, key: &Key) -> DepNode | |
| 144 | 146 | where |
| 145 | 147 | Key: DepNodeKey<'tcx>, |
| 146 | 148 | { |
| 147 | let hash = arg.to_fingerprint(tcx); | |
| 148 | let dep_node = DepNode { kind, hash: hash.into() }; | |
| 149 | let dep_node = DepNode { kind, key_fingerprint: key.to_fingerprint(tcx).into() }; | |
| 149 | 150 | |
| 150 | 151 | #[cfg(debug_assertions)] |
| 151 | 152 | { |
| 152 | if !tcx.fingerprint_style(kind).reconstructible() | |
| 153 | if !tcx.key_fingerprint_style(kind).reconstructible() | |
| 153 | 154 | && (tcx.sess.opts.unstable_opts.incremental_info |
| 154 | 155 | || tcx.sess.opts.unstable_opts.query_dep_graph) |
| 155 | 156 | { |
| 156 | tcx.dep_graph.register_dep_node_debug_str(dep_node, || arg.to_debug_str(tcx)); | |
| 157 | tcx.dep_graph.register_dep_node_debug_str(dep_node, || key.to_debug_str(tcx)); | |
| 157 | 158 | } |
| 158 | 159 | } |
| 159 | 160 | |
| ... | ... | @@ -168,8 +169,8 @@ impl DepNode { |
| 168 | 169 | def_path_hash: DefPathHash, |
| 169 | 170 | kind: DepKind, |
| 170 | 171 | ) -> Self { |
| 171 | debug_assert!(tcx.fingerprint_style(kind) == FingerprintStyle::DefPathHash); | |
| 172 | DepNode { kind, hash: def_path_hash.0.into() } | |
| 172 | debug_assert!(tcx.key_fingerprint_style(kind) == KeyFingerprintStyle::DefPathHash); | |
| 173 | DepNode { kind, key_fingerprint: def_path_hash.0.into() } | |
| 173 | 174 | } |
| 174 | 175 | } |
| 175 | 176 | |
| ... | ... | @@ -184,10 +185,10 @@ impl fmt::Debug for DepNode { |
| 184 | 185 | } else if let Some(ref s) = tcx.dep_graph.dep_node_debug_str(*self) { |
| 185 | 186 | write!(f, "{s}")?; |
| 186 | 187 | } else { |
| 187 | write!(f, "{}", self.hash)?; | |
| 188 | write!(f, "{}", self.key_fingerprint)?; | |
| 188 | 189 | } |
| 189 | 190 | } else { |
| 190 | write!(f, "{}", self.hash)?; | |
| 191 | write!(f, "{}", self.key_fingerprint)?; | |
| 191 | 192 | } |
| 192 | 193 | Ok(()) |
| 193 | 194 | })?; |
| ... | ... | @@ -198,7 +199,7 @@ impl fmt::Debug for DepNode { |
| 198 | 199 | |
| 199 | 200 | /// Trait for query keys as seen by dependency-node tracking. |
| 200 | 201 | pub trait DepNodeKey<'tcx>: fmt::Debug + Sized { |
| 201 | fn fingerprint_style() -> FingerprintStyle; | |
| 202 | fn key_fingerprint_style() -> KeyFingerprintStyle; | |
| 202 | 203 | |
| 203 | 204 | /// This method turns a query key into an opaque `Fingerprint` to be used |
| 204 | 205 | /// in `DepNode`. |
| ... | ... | @@ -212,7 +213,7 @@ pub trait DepNodeKey<'tcx>: fmt::Debug + Sized { |
| 212 | 213 | /// `fingerprint_style()` is not `FingerprintStyle::Opaque`. |
| 213 | 214 | /// It is always valid to return `None` here, in which case incremental |
| 214 | 215 | /// compilation will treat the query as having changed instead of forcing it. |
| 215 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>; | |
| 216 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self>; | |
| 216 | 217 | } |
| 217 | 218 | |
| 218 | 219 | // Blanket impl of `DepNodeKey`, which is specialized by other impls elsewhere. |
| ... | ... | @@ -221,8 +222,8 @@ where |
| 221 | 222 | T: for<'a> HashStable<StableHashingContext<'a>> + fmt::Debug, |
| 222 | 223 | { |
| 223 | 224 | #[inline(always)] |
| 224 | default fn fingerprint_style() -> FingerprintStyle { | |
| 225 | FingerprintStyle::Opaque | |
| 225 | default fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 226 | KeyFingerprintStyle::Opaque | |
| 226 | 227 | } |
| 227 | 228 | |
| 228 | 229 | #[inline(always)] |
| ... | ... | @@ -243,7 +244,7 @@ where |
| 243 | 244 | } |
| 244 | 245 | |
| 245 | 246 | #[inline(always)] |
| 246 | default fn recover(_: TyCtxt<'tcx>, _: &DepNode) -> Option<Self> { | |
| 247 | default fn try_recover_key(_: TyCtxt<'tcx>, _: &DepNode) -> Option<Self> { | |
| 247 | 248 | None |
| 248 | 249 | } |
| 249 | 250 | } |
| ... | ... | @@ -264,10 +265,11 @@ pub struct DepKindVTable<'tcx> { |
| 264 | 265 | /// cached within one compiler invocation. |
| 265 | 266 | pub is_eval_always: bool, |
| 266 | 267 | |
| 267 | /// Indicates whether and how the query key can be recovered from its hashed fingerprint. | |
| 268 | /// Indicates whether and how a query key can be reconstructed from the | |
| 269 | /// key fingerprint of a dep node with this [`DepKind`]. | |
| 268 | 270 | /// |
| 269 | 271 | /// The [`DepNodeKey`] trait determines the fingerprint style for each key type. |
| 270 | pub fingerprint_style: FingerprintStyle, | |
| 272 | pub key_fingerprint_style: KeyFingerprintStyle, | |
| 271 | 273 | |
| 272 | 274 | /// The red/green evaluation system will try to mark a specific DepNode in the |
| 273 | 275 | /// dependency graph as green by recursively trying to mark the dependencies of |
| ... | ... | @@ -279,7 +281,7 @@ pub struct DepKindVTable<'tcx> { |
| 279 | 281 | /// `force_from_dep_node()` implements. |
| 280 | 282 | /// |
| 281 | 283 | /// In the general case, a `DepNode` consists of a `DepKind` and an opaque |
| 282 | /// GUID/fingerprint that will uniquely identify the node. This GUID/fingerprint | |
| 284 | /// "key fingerprint" that will uniquely identify the node. This key fingerprint | |
| 283 | 285 | /// is usually constructed by computing a stable hash of the query-key that the |
| 284 | 286 | /// `DepNode` corresponds to. Consequently, it is not in general possible to go |
| 285 | 287 | /// back from hash to query-key (since hash functions are not reversible). For |
| ... | ... | @@ -293,7 +295,7 @@ pub struct DepKindVTable<'tcx> { |
| 293 | 295 | /// Now, if `force_from_dep_node()` would always fail, it would be pretty useless. |
| 294 | 296 | /// Fortunately, we can use some contextual information that will allow us to |
| 295 | 297 | /// reconstruct query-keys for certain kinds of `DepNode`s. In particular, we |
| 296 | /// enforce by construction that the GUID/fingerprint of certain `DepNode`s is a | |
| 298 | /// enforce by construction that the key fingerprint of certain `DepNode`s is a | |
| 297 | 299 | /// valid `DefPathHash`. Since we also always build a huge table that maps every |
| 298 | 300 | /// `DefPathHash` in the current codebase to the corresponding `DefId`, we have |
| 299 | 301 | /// everything we need to re-run the query. |
| ... | ... | @@ -301,7 +303,7 @@ pub struct DepKindVTable<'tcx> { |
| 301 | 303 | /// Take the `mir_promoted` query as an example. Like many other queries, it |
| 302 | 304 | /// just has a single parameter: the `DefId` of the item it will compute the |
| 303 | 305 | /// validated MIR for. Now, when we call `force_from_dep_node()` on a `DepNode` |
| 304 | /// with kind `MirValidated`, we know that the GUID/fingerprint of the `DepNode` | |
| 306 | /// with kind `mir_promoted`, we know that the key fingerprint of the `DepNode` | |
| 305 | 307 | /// is actually a `DefPathHash`, and can therefore just look up the corresponding |
| 306 | 308 | /// `DefId` in `tcx.def_path_hash_to_def_id`. |
| 307 | 309 | pub force_from_dep_node: Option< |
| ... | ... | @@ -472,8 +474,8 @@ impl DepNode { |
| 472 | 474 | /// refers to something from the previous compilation session that |
| 473 | 475 | /// has been removed. |
| 474 | 476 | pub fn extract_def_id(&self, tcx: TyCtxt<'_>) -> Option<DefId> { |
| 475 | if tcx.fingerprint_style(self.kind) == FingerprintStyle::DefPathHash { | |
| 476 | tcx.def_path_hash_to_def_id(DefPathHash(self.hash.into())) | |
| 477 | if tcx.key_fingerprint_style(self.kind) == KeyFingerprintStyle::DefPathHash { | |
| 478 | tcx.def_path_hash_to_def_id(DefPathHash(self.key_fingerprint.into())) | |
| 477 | 479 | } else { |
| 478 | 480 | None |
| 479 | 481 | } |
| ... | ... | @@ -486,10 +488,10 @@ impl DepNode { |
| 486 | 488 | ) -> Result<DepNode, ()> { |
| 487 | 489 | let kind = dep_kind_from_label_string(label)?; |
| 488 | 490 | |
| 489 | match tcx.fingerprint_style(kind) { | |
| 490 | FingerprintStyle::Opaque | FingerprintStyle::HirId => Err(()), | |
| 491 | FingerprintStyle::Unit => Ok(DepNode::new_no_params(tcx, kind)), | |
| 492 | FingerprintStyle::DefPathHash => { | |
| 491 | match tcx.key_fingerprint_style(kind) { | |
| 492 | KeyFingerprintStyle::Opaque | KeyFingerprintStyle::HirId => Err(()), | |
| 493 | KeyFingerprintStyle::Unit => Ok(DepNode::new_no_params(tcx, kind)), | |
| 494 | KeyFingerprintStyle::DefPathHash => { | |
| 493 | 495 | Ok(DepNode::from_def_path_hash(tcx, def_path_hash, kind)) |
| 494 | 496 | } |
| 495 | 497 | } |
compiler/rustc_middle/src/dep_graph/dep_node_key.rs+31-31| ... | ... | @@ -3,13 +3,13 @@ use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId, LocalModDefId, |
| 3 | 3 | use rustc_hir::definitions::DefPathHash; |
| 4 | 4 | use rustc_hir::{HirId, ItemLocalId, OwnerId}; |
| 5 | 5 | |
| 6 | use crate::dep_graph::{DepNode, DepNodeKey, FingerprintStyle}; | |
| 6 | use crate::dep_graph::{DepNode, DepNodeKey, KeyFingerprintStyle}; | |
| 7 | 7 | use crate::ty::TyCtxt; |
| 8 | 8 | |
| 9 | 9 | impl<'tcx> DepNodeKey<'tcx> for () { |
| 10 | 10 | #[inline(always)] |
| 11 | fn fingerprint_style() -> FingerprintStyle { | |
| 12 | FingerprintStyle::Unit | |
| 11 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 12 | KeyFingerprintStyle::Unit | |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | #[inline(always)] |
| ... | ... | @@ -18,15 +18,15 @@ impl<'tcx> DepNodeKey<'tcx> for () { |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | #[inline(always)] |
| 21 | fn recover(_: TyCtxt<'tcx>, _: &DepNode) -> Option<Self> { | |
| 21 | fn try_recover_key(_: TyCtxt<'tcx>, _: &DepNode) -> Option<Self> { | |
| 22 | 22 | Some(()) |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | impl<'tcx> DepNodeKey<'tcx> for DefId { |
| 27 | 27 | #[inline(always)] |
| 28 | fn fingerprint_style() -> FingerprintStyle { | |
| 29 | FingerprintStyle::DefPathHash | |
| 28 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 29 | KeyFingerprintStyle::DefPathHash | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | #[inline(always)] |
| ... | ... | @@ -40,15 +40,15 @@ impl<'tcx> DepNodeKey<'tcx> for DefId { |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | #[inline(always)] |
| 43 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 43 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 44 | 44 | dep_node.extract_def_id(tcx) |
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | impl<'tcx> DepNodeKey<'tcx> for LocalDefId { |
| 49 | 49 | #[inline(always)] |
| 50 | fn fingerprint_style() -> FingerprintStyle { | |
| 51 | FingerprintStyle::DefPathHash | |
| 50 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 51 | KeyFingerprintStyle::DefPathHash | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | #[inline(always)] |
| ... | ... | @@ -62,15 +62,15 @@ impl<'tcx> DepNodeKey<'tcx> for LocalDefId { |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | #[inline(always)] |
| 65 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 65 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 66 | 66 | dep_node.extract_def_id(tcx).map(|id| id.expect_local()) |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | impl<'tcx> DepNodeKey<'tcx> for OwnerId { |
| 71 | 71 | #[inline(always)] |
| 72 | fn fingerprint_style() -> FingerprintStyle { | |
| 73 | FingerprintStyle::DefPathHash | |
| 72 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 73 | KeyFingerprintStyle::DefPathHash | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | #[inline(always)] |
| ... | ... | @@ -84,15 +84,15 @@ impl<'tcx> DepNodeKey<'tcx> for OwnerId { |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | #[inline(always)] |
| 87 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 87 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 88 | 88 | dep_node.extract_def_id(tcx).map(|id| OwnerId { def_id: id.expect_local() }) |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | impl<'tcx> DepNodeKey<'tcx> for CrateNum { |
| 93 | 93 | #[inline(always)] |
| 94 | fn fingerprint_style() -> FingerprintStyle { | |
| 95 | FingerprintStyle::DefPathHash | |
| 94 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 95 | KeyFingerprintStyle::DefPathHash | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | #[inline(always)] |
| ... | ... | @@ -107,15 +107,15 @@ impl<'tcx> DepNodeKey<'tcx> for CrateNum { |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | #[inline(always)] |
| 110 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 110 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 111 | 111 | dep_node.extract_def_id(tcx).map(|id| id.krate) |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | impl<'tcx> DepNodeKey<'tcx> for (DefId, DefId) { |
| 116 | 116 | #[inline(always)] |
| 117 | fn fingerprint_style() -> FingerprintStyle { | |
| 118 | FingerprintStyle::Opaque | |
| 117 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 118 | KeyFingerprintStyle::Opaque | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // We actually would not need to specialize the implementation of this |
| ... | ... | @@ -141,8 +141,8 @@ impl<'tcx> DepNodeKey<'tcx> for (DefId, DefId) { |
| 141 | 141 | |
| 142 | 142 | impl<'tcx> DepNodeKey<'tcx> for HirId { |
| 143 | 143 | #[inline(always)] |
| 144 | fn fingerprint_style() -> FingerprintStyle { | |
| 145 | FingerprintStyle::HirId | |
| 144 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 145 | KeyFingerprintStyle::HirId | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | // We actually would not need to specialize the implementation of this |
| ... | ... | @@ -166,9 +166,9 @@ impl<'tcx> DepNodeKey<'tcx> for HirId { |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | #[inline(always)] |
| 169 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 170 | if tcx.fingerprint_style(dep_node.kind) == FingerprintStyle::HirId { | |
| 171 | let (local_hash, local_id) = Fingerprint::from(dep_node.hash).split(); | |
| 169 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 170 | if tcx.key_fingerprint_style(dep_node.kind) == KeyFingerprintStyle::HirId { | |
| 171 | let (local_hash, local_id) = Fingerprint::from(dep_node.key_fingerprint).split(); | |
| 172 | 172 | let def_path_hash = DefPathHash::new(tcx.stable_crate_id(LOCAL_CRATE), local_hash); |
| 173 | 173 | let def_id = tcx.def_path_hash_to_def_id(def_path_hash)?.expect_local(); |
| 174 | 174 | let local_id = local_id |
| ... | ... | @@ -184,8 +184,8 @@ impl<'tcx> DepNodeKey<'tcx> for HirId { |
| 184 | 184 | |
| 185 | 185 | impl<'tcx> DepNodeKey<'tcx> for ModDefId { |
| 186 | 186 | #[inline(always)] |
| 187 | fn fingerprint_style() -> FingerprintStyle { | |
| 188 | FingerprintStyle::DefPathHash | |
| 187 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 188 | KeyFingerprintStyle::DefPathHash | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | #[inline(always)] |
| ... | ... | @@ -199,15 +199,15 @@ impl<'tcx> DepNodeKey<'tcx> for ModDefId { |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | #[inline(always)] |
| 202 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 203 | DefId::recover(tcx, dep_node).map(ModDefId::new_unchecked) | |
| 202 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 203 | DefId::try_recover_key(tcx, dep_node).map(ModDefId::new_unchecked) | |
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | impl<'tcx> DepNodeKey<'tcx> for LocalModDefId { |
| 208 | 208 | #[inline(always)] |
| 209 | fn fingerprint_style() -> FingerprintStyle { | |
| 210 | FingerprintStyle::DefPathHash | |
| 209 | fn key_fingerprint_style() -> KeyFingerprintStyle { | |
| 210 | KeyFingerprintStyle::DefPathHash | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | #[inline(always)] |
| ... | ... | @@ -221,7 +221,7 @@ impl<'tcx> DepNodeKey<'tcx> for LocalModDefId { |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | #[inline(always)] |
| 224 | fn recover(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 225 | LocalDefId::recover(tcx, dep_node).map(LocalModDefId::new_unchecked) | |
| 224 | fn try_recover_key(tcx: TyCtxt<'tcx>, dep_node: &DepNode) -> Option<Self> { | |
| 225 | LocalDefId::try_recover_key(tcx, dep_node).map(LocalModDefId::new_unchecked) | |
| 226 | 226 | } |
| 227 | 227 | } |
compiler/rustc_middle/src/dep_graph/graph.rs+40-30| ... | ... | @@ -142,15 +142,17 @@ impl DepGraph { |
| 142 | 142 | |
| 143 | 143 | // Instantiate a node with zero dependencies only once for anonymous queries. |
| 144 | 144 | let _green_node_index = current.alloc_new_node( |
| 145 | DepNode { kind: DepKind::ANON_ZERO_DEPS, hash: current.anon_id_seed.into() }, | |
| 145 | DepNode { kind: DepKind::ANON_ZERO_DEPS, key_fingerprint: current.anon_id_seed.into() }, | |
| 146 | 146 | EdgesVec::new(), |
| 147 | 147 | Fingerprint::ZERO, |
| 148 | 148 | ); |
| 149 | 149 | assert_eq!(_green_node_index, DepNodeIndex::SINGLETON_ZERO_DEPS_ANON_NODE); |
| 150 | 150 | |
| 151 | // Instantiate a dependy-less red node only once for anonymous queries. | |
| 151 | // Create a single always-red node, with no dependencies of its own. | |
| 152 | // Other nodes can use the always-red node as a fake dependency, to | |
| 153 | // ensure that their dependency list will never be all-green. | |
| 152 | 154 | let red_node_index = current.alloc_new_node( |
| 153 | DepNode { kind: DepKind::RED, hash: Fingerprint::ZERO.into() }, | |
| 155 | DepNode { kind: DepKind::RED, key_fingerprint: Fingerprint::ZERO.into() }, | |
| 154 | 156 | EdgesVec::new(), |
| 155 | 157 | Fingerprint::ZERO, |
| 156 | 158 | ); |
| ... | ... | @@ -418,7 +420,7 @@ impl DepGraphData { |
| 418 | 420 | // Fingerprint::combine() is faster than sending Fingerprint |
| 419 | 421 | // through the StableHasher (at least as long as StableHasher |
| 420 | 422 | // is so slow). |
| 421 | hash: self.current.anon_id_seed.combine(hasher.finish()).into(), | |
| 423 | key_fingerprint: self.current.anon_id_seed.combine(hasher.finish()).into(), | |
| 422 | 424 | }; |
| 423 | 425 | |
| 424 | 426 | // The DepNodes generated by the process above are not unique. 2 queries could |
| ... | ... | @@ -585,7 +587,7 @@ impl DepGraph { |
| 585 | 587 | data.current.record_edge( |
| 586 | 588 | dep_node_index, |
| 587 | 589 | node, |
| 588 | data.prev_fingerprint_of(prev_index), | |
| 590 | data.prev_value_fingerprint_of(prev_index), | |
| 589 | 591 | ); |
| 590 | 592 | } |
| 591 | 593 | |
| ... | ... | @@ -658,8 +660,8 @@ impl DepGraphData { |
| 658 | 660 | } |
| 659 | 661 | |
| 660 | 662 | #[inline] |
| 661 | pub fn prev_fingerprint_of(&self, prev_index: SerializedDepNodeIndex) -> Fingerprint { | |
| 662 | self.previous.fingerprint_by_index(prev_index) | |
| 663 | pub fn prev_value_fingerprint_of(&self, prev_index: SerializedDepNodeIndex) -> Fingerprint { | |
| 664 | self.previous.value_fingerprint_for_index(prev_index) | |
| 663 | 665 | } |
| 664 | 666 | |
| 665 | 667 | #[inline] |
| ... | ... | @@ -679,7 +681,7 @@ impl DepGraphData { |
| 679 | 681 | let dep_node_index = self.current.encoder.send_new( |
| 680 | 682 | DepNode { |
| 681 | 683 | kind: DepKind::SIDE_EFFECT, |
| 682 | hash: PackedFingerprint::from(Fingerprint::ZERO), | |
| 684 | key_fingerprint: PackedFingerprint::from(Fingerprint::ZERO), | |
| 683 | 685 | }, |
| 684 | 686 | Fingerprint::ZERO, |
| 685 | 687 | // We want the side effect node to always be red so it will be forced and emit the |
| ... | ... | @@ -712,7 +714,7 @@ impl DepGraphData { |
| 712 | 714 | &self.colors, |
| 713 | 715 | DepNode { |
| 714 | 716 | kind: DepKind::SIDE_EFFECT, |
| 715 | hash: PackedFingerprint::from(Fingerprint::ZERO), | |
| 717 | key_fingerprint: PackedFingerprint::from(Fingerprint::ZERO), | |
| 716 | 718 | }, |
| 717 | 719 | Fingerprint::ZERO, |
| 718 | 720 | std::iter::once(DepNodeIndex::FOREVER_RED_NODE).collect(), |
| ... | ... | @@ -727,12 +729,12 @@ impl DepGraphData { |
| 727 | 729 | &self, |
| 728 | 730 | key: DepNode, |
| 729 | 731 | edges: EdgesVec, |
| 730 | fingerprint: Option<Fingerprint>, | |
| 732 | value_fingerprint: Option<Fingerprint>, | |
| 731 | 733 | ) -> DepNodeIndex { |
| 732 | 734 | if let Some(prev_index) = self.previous.node_to_index_opt(&key) { |
| 733 | 735 | // Determine the color and index of the new `DepNode`. |
| 734 | let is_green = if let Some(fingerprint) = fingerprint { | |
| 735 | if fingerprint == self.previous.fingerprint_by_index(prev_index) { | |
| 736 | let is_green = if let Some(value_fingerprint) = value_fingerprint { | |
| 737 | if value_fingerprint == self.previous.value_fingerprint_for_index(prev_index) { | |
| 736 | 738 | // This is a green node: it existed in the previous compilation, |
| 737 | 739 | // its query was re-executed, and it has the same result as before. |
| 738 | 740 | true |
| ... | ... | @@ -749,22 +751,22 @@ impl DepGraphData { |
| 749 | 751 | false |
| 750 | 752 | }; |
| 751 | 753 | |
| 752 | let fingerprint = fingerprint.unwrap_or(Fingerprint::ZERO); | |
| 754 | let value_fingerprint = value_fingerprint.unwrap_or(Fingerprint::ZERO); | |
| 753 | 755 | |
| 754 | 756 | let dep_node_index = self.current.encoder.send_and_color( |
| 755 | 757 | prev_index, |
| 756 | 758 | &self.colors, |
| 757 | 759 | key, |
| 758 | fingerprint, | |
| 760 | value_fingerprint, | |
| 759 | 761 | edges, |
| 760 | 762 | is_green, |
| 761 | 763 | ); |
| 762 | 764 | |
| 763 | self.current.record_node(dep_node_index, key, fingerprint); | |
| 765 | self.current.record_node(dep_node_index, key, value_fingerprint); | |
| 764 | 766 | |
| 765 | 767 | dep_node_index |
| 766 | 768 | } else { |
| 767 | self.current.alloc_new_node(key, edges, fingerprint.unwrap_or(Fingerprint::ZERO)) | |
| 769 | self.current.alloc_new_node(key, edges, value_fingerprint.unwrap_or(Fingerprint::ZERO)) | |
| 768 | 770 | } |
| 769 | 771 | } |
| 770 | 772 | |
| ... | ... | @@ -781,7 +783,7 @@ impl DepGraphData { |
| 781 | 783 | self.current.record_edge( |
| 782 | 784 | dep_node_index, |
| 783 | 785 | *self.previous.index_to_node(prev_index), |
| 784 | self.previous.fingerprint_by_index(prev_index), | |
| 786 | self.previous.value_fingerprint_for_index(prev_index), | |
| 785 | 787 | ); |
| 786 | 788 | } |
| 787 | 789 | |
| ... | ... | @@ -925,7 +927,7 @@ impl DepGraphData { |
| 925 | 927 | if !tcx.is_eval_always(dep_dep_node.kind) { |
| 926 | 928 | debug!( |
| 927 | 929 | "state of dependency {:?} ({}) is unknown, trying to mark it green", |
| 928 | dep_dep_node, dep_dep_node.hash, | |
| 930 | dep_dep_node, dep_dep_node.key_fingerprint, | |
| 929 | 931 | ); |
| 930 | 932 | |
| 931 | 933 | let node_index = self.try_mark_previous_green(tcx, parent_dep_node_index, Some(frame)); |
| ... | ... | @@ -1154,10 +1156,10 @@ pub(super) struct CurrentDepGraph { |
| 1154 | 1156 | encoder: GraphEncoder, |
| 1155 | 1157 | anon_node_to_index: ShardedHashMap<DepNode, DepNodeIndex>, |
| 1156 | 1158 | |
| 1157 | /// This is used to verify that fingerprints do not change between the creation of a node | |
| 1158 | /// and its recomputation. | |
| 1159 | /// This is used to verify that value fingerprints do not change between the | |
| 1160 | /// creation of a node and its recomputation. | |
| 1159 | 1161 | #[cfg(debug_assertions)] |
| 1160 | fingerprints: Lock<IndexVec<DepNodeIndex, Option<Fingerprint>>>, | |
| 1162 | value_fingerprints: Lock<IndexVec<DepNodeIndex, Option<Fingerprint>>>, | |
| 1161 | 1163 | |
| 1162 | 1164 | /// Used to trap when a specific edge is added to the graph. |
| 1163 | 1165 | /// This is used for debug purposes and is only active with `debug_assertions`. |
| ... | ... | @@ -1224,7 +1226,7 @@ impl CurrentDepGraph { |
| 1224 | 1226 | #[cfg(debug_assertions)] |
| 1225 | 1227 | forbidden_edge, |
| 1226 | 1228 | #[cfg(debug_assertions)] |
| 1227 | fingerprints: Lock::new(IndexVec::from_elem_n(None, new_node_count_estimate)), | |
| 1229 | value_fingerprints: Lock::new(IndexVec::from_elem_n(None, new_node_count_estimate)), | |
| 1228 | 1230 | nodes_in_current_session: new_node_dbg.then(|| { |
| 1229 | 1231 | Lock::new(FxHashMap::with_capacity_and_hasher( |
| 1230 | 1232 | new_node_count_estimate, |
| ... | ... | @@ -1237,12 +1239,20 @@ impl CurrentDepGraph { |
| 1237 | 1239 | } |
| 1238 | 1240 | |
| 1239 | 1241 | #[cfg(debug_assertions)] |
| 1240 | fn record_edge(&self, dep_node_index: DepNodeIndex, key: DepNode, fingerprint: Fingerprint) { | |
| 1242 | fn record_edge( | |
| 1243 | &self, | |
| 1244 | dep_node_index: DepNodeIndex, | |
| 1245 | key: DepNode, | |
| 1246 | value_fingerprint: Fingerprint, | |
| 1247 | ) { | |
| 1241 | 1248 | if let Some(forbidden_edge) = &self.forbidden_edge { |
| 1242 | 1249 | forbidden_edge.index_to_node.lock().insert(dep_node_index, key); |
| 1243 | 1250 | } |
| 1244 | let previous = *self.fingerprints.lock().get_or_insert_with(dep_node_index, || fingerprint); | |
| 1245 | assert_eq!(previous, fingerprint, "Unstable fingerprints for {:?}", key); | |
| 1251 | let prior_value_fingerprint = *self | |
| 1252 | .value_fingerprints | |
| 1253 | .lock() | |
| 1254 | .get_or_insert_with(dep_node_index, || value_fingerprint); | |
| 1255 | assert_eq!(prior_value_fingerprint, value_fingerprint, "Unstable fingerprints for {key:?}"); | |
| 1246 | 1256 | } |
| 1247 | 1257 | |
| 1248 | 1258 | #[inline(always)] |
| ... | ... | @@ -1250,10 +1260,10 @@ impl CurrentDepGraph { |
| 1250 | 1260 | &self, |
| 1251 | 1261 | dep_node_index: DepNodeIndex, |
| 1252 | 1262 | key: DepNode, |
| 1253 | _current_fingerprint: Fingerprint, | |
| 1263 | _value_fingerprint: Fingerprint, | |
| 1254 | 1264 | ) { |
| 1255 | 1265 | #[cfg(debug_assertions)] |
| 1256 | self.record_edge(dep_node_index, key, _current_fingerprint); | |
| 1266 | self.record_edge(dep_node_index, key, _value_fingerprint); | |
| 1257 | 1267 | |
| 1258 | 1268 | if let Some(ref nodes_in_current_session) = self.nodes_in_current_session { |
| 1259 | 1269 | outline(|| { |
| ... | ... | @@ -1271,11 +1281,11 @@ impl CurrentDepGraph { |
| 1271 | 1281 | &self, |
| 1272 | 1282 | key: DepNode, |
| 1273 | 1283 | edges: EdgesVec, |
| 1274 | current_fingerprint: Fingerprint, | |
| 1284 | value_fingerprint: Fingerprint, | |
| 1275 | 1285 | ) -> DepNodeIndex { |
| 1276 | let dep_node_index = self.encoder.send_new(key, current_fingerprint, edges); | |
| 1286 | let dep_node_index = self.encoder.send_new(key, value_fingerprint, edges); | |
| 1277 | 1287 | |
| 1278 | self.record_node(dep_node_index, key, current_fingerprint); | |
| 1288 | self.record_node(dep_node_index, key, value_fingerprint); | |
| 1279 | 1289 | |
| 1280 | 1290 | dep_node_index |
| 1281 | 1291 | } |
compiler/rustc_middle/src/dep_graph/mod.rs+8-8| ... | ... | @@ -30,7 +30,7 @@ mod serialized; |
| 30 | 30 | /// This is mainly for determining whether and how we can reconstruct a key |
| 31 | 31 | /// from the fingerprint. |
| 32 | 32 | #[derive(Debug, PartialEq, Eq, Copy, Clone)] |
| 33 | pub enum FingerprintStyle { | |
| 33 | pub enum KeyFingerprintStyle { | |
| 34 | 34 | /// The fingerprint is actually a DefPathHash. |
| 35 | 35 | DefPathHash, |
| 36 | 36 | /// The fingerprint is actually a HirId. |
| ... | ... | @@ -41,14 +41,14 @@ pub enum FingerprintStyle { |
| 41 | 41 | Opaque, |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | impl FingerprintStyle { | |
| 44 | impl KeyFingerprintStyle { | |
| 45 | 45 | #[inline] |
| 46 | 46 | pub const fn reconstructible(self) -> bool { |
| 47 | 47 | match self { |
| 48 | FingerprintStyle::DefPathHash | FingerprintStyle::Unit | FingerprintStyle::HirId => { | |
| 49 | true | |
| 50 | } | |
| 51 | FingerprintStyle::Opaque => false, | |
| 48 | KeyFingerprintStyle::DefPathHash | |
| 49 | | KeyFingerprintStyle::Unit | |
| 50 | | KeyFingerprintStyle::HirId => true, | |
| 51 | KeyFingerprintStyle::Opaque => false, | |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | } |
| ... | ... | @@ -86,8 +86,8 @@ impl<'tcx> TyCtxt<'tcx> { |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | #[inline(always)] |
| 89 | pub fn fingerprint_style(self, kind: DepKind) -> FingerprintStyle { | |
| 90 | self.dep_kind_vtable(kind).fingerprint_style | |
| 89 | pub fn key_fingerprint_style(self, kind: DepKind) -> KeyFingerprintStyle { | |
| 90 | self.dep_kind_vtable(kind).key_fingerprint_style | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | /// Try to force a dep node to execute and see if it's green. |
compiler/rustc_middle/src/dep_graph/serialized.rs+57-41| ... | ... | @@ -90,9 +90,13 @@ const DEP_NODE_WIDTH_BITS: usize = DEP_NODE_SIZE / 2; |
| 90 | 90 | pub struct SerializedDepGraph { |
| 91 | 91 | /// The set of all DepNodes in the graph |
| 92 | 92 | nodes: IndexVec<SerializedDepNodeIndex, DepNode>, |
| 93 | /// The set of all Fingerprints in the graph. Each Fingerprint corresponds to | |
| 94 | /// the DepNode at the same index in the nodes vector. | |
| 95 | fingerprints: IndexVec<SerializedDepNodeIndex, Fingerprint>, | |
| 93 | /// A value fingerprint associated with each [`DepNode`] in [`Self::nodes`], | |
| 94 | /// typically a hash of the value returned by the node's query in the | |
| 95 | /// previous incremental-compilation session. | |
| 96 | /// | |
| 97 | /// Some nodes don't have a meaningful value hash (e.g. queries with `no_hash`), | |
| 98 | /// so they store a dummy value here instead (e.g. [`Fingerprint::ZERO`]). | |
| 99 | value_fingerprints: IndexVec<SerializedDepNodeIndex, Fingerprint>, | |
| 96 | 100 | /// For each DepNode, stores the list of edges originating from that |
| 97 | 101 | /// DepNode. Encoded as a [start, end) pair indexing into edge_list_data, |
| 98 | 102 | /// which holds the actual DepNodeIndices of the target nodes. |
| ... | ... | @@ -100,8 +104,8 @@ pub struct SerializedDepGraph { |
| 100 | 104 | /// A flattened list of all edge targets in the graph, stored in the same |
| 101 | 105 | /// varint encoding that we use on disk. Edge sources are implicit in edge_list_indices. |
| 102 | 106 | edge_list_data: Vec<u8>, |
| 103 | /// Stores a map from fingerprints to nodes per dep node kind. | |
| 104 | /// This is the reciprocal of `nodes`. | |
| 107 | /// For each dep kind, stores a map from key fingerprints back to the index | |
| 108 | /// of the corresponding node. This is the inverse of `nodes`. | |
| 105 | 109 | index: Vec<UnhashMap<PackedFingerprint, SerializedDepNodeIndex>>, |
| 106 | 110 | /// The number of previous compilation sessions. This is used to generate |
| 107 | 111 | /// unique anon dep nodes per session. |
| ... | ... | @@ -138,12 +142,15 @@ impl SerializedDepGraph { |
| 138 | 142 | |
| 139 | 143 | #[inline] |
| 140 | 144 | pub fn node_to_index_opt(&self, dep_node: &DepNode) -> Option<SerializedDepNodeIndex> { |
| 141 | self.index.get(dep_node.kind.as_usize())?.get(&dep_node.hash).cloned() | |
| 145 | self.index.get(dep_node.kind.as_usize())?.get(&dep_node.key_fingerprint).copied() | |
| 142 | 146 | } |
| 143 | 147 | |
| 144 | 148 | #[inline] |
| 145 | pub fn fingerprint_by_index(&self, dep_node_index: SerializedDepNodeIndex) -> Fingerprint { | |
| 146 | self.fingerprints[dep_node_index] | |
| 149 | pub fn value_fingerprint_for_index( | |
| 150 | &self, | |
| 151 | dep_node_index: SerializedDepNodeIndex, | |
| 152 | ) -> Fingerprint { | |
| 153 | self.value_fingerprints[dep_node_index] | |
| 147 | 154 | } |
| 148 | 155 | |
| 149 | 156 | #[inline] |
| ... | ... | @@ -212,10 +219,13 @@ impl SerializedDepGraph { |
| 212 | 219 | let graph_bytes = d.len() - (3 * IntEncodedWithFixedSize::ENCODED_SIZE) - d.position(); |
| 213 | 220 | |
| 214 | 221 | let mut nodes = IndexVec::from_elem_n( |
| 215 | DepNode { kind: DepKind::NULL, hash: PackedFingerprint::from(Fingerprint::ZERO) }, | |
| 222 | DepNode { | |
| 223 | kind: DepKind::NULL, | |
| 224 | key_fingerprint: PackedFingerprint::from(Fingerprint::ZERO), | |
| 225 | }, | |
| 216 | 226 | node_max, |
| 217 | 227 | ); |
| 218 | let mut fingerprints = IndexVec::from_elem_n(Fingerprint::ZERO, node_max); | |
| 228 | let mut value_fingerprints = IndexVec::from_elem_n(Fingerprint::ZERO, node_max); | |
| 219 | 229 | let mut edge_list_indices = |
| 220 | 230 | IndexVec::from_elem_n(EdgeHeader { repr: 0, num_edges: 0 }, node_max); |
| 221 | 231 | |
| ... | ... | @@ -243,7 +253,7 @@ impl SerializedDepGraph { |
| 243 | 253 | assert!(node_header.node().kind != DepKind::NULL && node.kind == DepKind::NULL); |
| 244 | 254 | *node = node_header.node(); |
| 245 | 255 | |
| 246 | fingerprints[index] = node_header.fingerprint(); | |
| 256 | value_fingerprints[index] = node_header.value_fingerprint(); | |
| 247 | 257 | |
| 248 | 258 | // If the length of this node's edge list is small, the length is stored in the header. |
| 249 | 259 | // If it is not, we fall back to another decoder call. |
| ... | ... | @@ -275,7 +285,7 @@ impl SerializedDepGraph { |
| 275 | 285 | let session_count = d.read_u64(); |
| 276 | 286 | |
| 277 | 287 | for (idx, node) in nodes.iter_enumerated() { |
| 278 | if index[node.kind.as_usize()].insert(node.hash, idx).is_some() { | |
| 288 | if index[node.kind.as_usize()].insert(node.key_fingerprint, idx).is_some() { | |
| 279 | 289 | // Empty nodes and side effect nodes can have duplicates |
| 280 | 290 | if node.kind != DepKind::NULL && node.kind != DepKind::SIDE_EFFECT { |
| 281 | 291 | let name = node.kind.name(); |
| ... | ... | @@ -291,7 +301,7 @@ impl SerializedDepGraph { |
| 291 | 301 | |
| 292 | 302 | Arc::new(SerializedDepGraph { |
| 293 | 303 | nodes, |
| 294 | fingerprints, | |
| 304 | value_fingerprints, | |
| 295 | 305 | edge_list_indices, |
| 296 | 306 | edge_list_data, |
| 297 | 307 | index, |
| ... | ... | @@ -303,8 +313,8 @@ impl SerializedDepGraph { |
| 303 | 313 | /// A packed representation of all the fixed-size fields in a `NodeInfo`. |
| 304 | 314 | /// |
| 305 | 315 | /// This stores in one byte array: |
| 306 | /// * The `Fingerprint` in the `NodeInfo` | |
| 307 | /// * The `Fingerprint` in `DepNode` that is in this `NodeInfo` | |
| 316 | /// * The value `Fingerprint` in the `NodeInfo` | |
| 317 | /// * The key `Fingerprint` in `DepNode` that is in this `NodeInfo` | |
| 308 | 318 | /// * The `DepKind`'s discriminant (a u16, but not all bits are used...) |
| 309 | 319 | /// * The byte width of the encoded edges for this node |
| 310 | 320 | /// * In whatever bits remain, the length of the edge list for this node, if it fits |
| ... | ... | @@ -323,8 +333,8 @@ struct Unpacked { |
| 323 | 333 | bytes_per_index: usize, |
| 324 | 334 | kind: DepKind, |
| 325 | 335 | index: SerializedDepNodeIndex, |
| 326 | hash: PackedFingerprint, | |
| 327 | fingerprint: Fingerprint, | |
| 336 | key_fingerprint: PackedFingerprint, | |
| 337 | value_fingerprint: Fingerprint, | |
| 328 | 338 | } |
| 329 | 339 | |
| 330 | 340 | // Bit fields, where |
| ... | ... | @@ -345,7 +355,7 @@ impl SerializedNodeHeader { |
| 345 | 355 | fn new( |
| 346 | 356 | node: &DepNode, |
| 347 | 357 | index: DepNodeIndex, |
| 348 | fingerprint: Fingerprint, | |
| 358 | value_fingerprint: Fingerprint, | |
| 349 | 359 | edge_max_index: u32, |
| 350 | 360 | edge_count: usize, |
| 351 | 361 | ) -> Self { |
| ... | ... | @@ -363,19 +373,19 @@ impl SerializedNodeHeader { |
| 363 | 373 | head |= (edge_count as u16 + 1) << (Self::KIND_BITS + Self::WIDTH_BITS); |
| 364 | 374 | } |
| 365 | 375 | |
| 366 | let hash: Fingerprint = node.hash.into(); | |
| 376 | let hash: Fingerprint = node.key_fingerprint.into(); | |
| 367 | 377 | |
| 368 | 378 | // Using half-open ranges ensures an unconditional panic if we get the magic numbers wrong. |
| 369 | 379 | let mut bytes = [0u8; 38]; |
| 370 | 380 | bytes[..2].copy_from_slice(&head.to_le_bytes()); |
| 371 | 381 | bytes[2..6].copy_from_slice(&index.as_u32().to_le_bytes()); |
| 372 | 382 | bytes[6..22].copy_from_slice(&hash.to_le_bytes()); |
| 373 | bytes[22..].copy_from_slice(&fingerprint.to_le_bytes()); | |
| 383 | bytes[22..].copy_from_slice(&value_fingerprint.to_le_bytes()); | |
| 374 | 384 | |
| 375 | 385 | #[cfg(debug_assertions)] |
| 376 | 386 | { |
| 377 | 387 | let res = Self { bytes }; |
| 378 | assert_eq!(fingerprint, res.fingerprint()); | |
| 388 | assert_eq!(value_fingerprint, res.value_fingerprint()); | |
| 379 | 389 | assert_eq!(*node, res.node()); |
| 380 | 390 | if let Some(len) = res.len() { |
| 381 | 391 | assert_eq!(edge_count, len as usize); |
| ... | ... | @@ -388,8 +398,8 @@ impl SerializedNodeHeader { |
| 388 | 398 | fn unpack(&self) -> Unpacked { |
| 389 | 399 | let head = u16::from_le_bytes(self.bytes[..2].try_into().unwrap()); |
| 390 | 400 | let index = u32::from_le_bytes(self.bytes[2..6].try_into().unwrap()); |
| 391 | let hash = self.bytes[6..22].try_into().unwrap(); | |
| 392 | let fingerprint = self.bytes[22..].try_into().unwrap(); | |
| 401 | let key_fingerprint = self.bytes[6..22].try_into().unwrap(); | |
| 402 | let value_fingerprint = self.bytes[22..].try_into().unwrap(); | |
| 393 | 403 | |
| 394 | 404 | let kind = head & mask(Self::KIND_BITS) as u16; |
| 395 | 405 | let bytes_per_index = (head >> Self::KIND_BITS) & mask(Self::WIDTH_BITS) as u16; |
| ... | ... | @@ -400,8 +410,8 @@ impl SerializedNodeHeader { |
| 400 | 410 | bytes_per_index: bytes_per_index as usize + 1, |
| 401 | 411 | kind: DepKind::new(kind), |
| 402 | 412 | index: SerializedDepNodeIndex::from_u32(index), |
| 403 | hash: Fingerprint::from_le_bytes(hash).into(), | |
| 404 | fingerprint: Fingerprint::from_le_bytes(fingerprint), | |
| 413 | key_fingerprint: Fingerprint::from_le_bytes(key_fingerprint).into(), | |
| 414 | value_fingerprint: Fingerprint::from_le_bytes(value_fingerprint), | |
| 405 | 415 | } |
| 406 | 416 | } |
| 407 | 417 | |
| ... | ... | @@ -421,14 +431,14 @@ impl SerializedNodeHeader { |
| 421 | 431 | } |
| 422 | 432 | |
| 423 | 433 | #[inline] |
| 424 | fn fingerprint(&self) -> Fingerprint { | |
| 425 | self.unpack().fingerprint | |
| 434 | fn value_fingerprint(&self) -> Fingerprint { | |
| 435 | self.unpack().value_fingerprint | |
| 426 | 436 | } |
| 427 | 437 | |
| 428 | 438 | #[inline] |
| 429 | 439 | fn node(&self) -> DepNode { |
| 430 | let Unpacked { kind, hash, .. } = self.unpack(); | |
| 431 | DepNode { kind, hash } | |
| 440 | let Unpacked { kind, key_fingerprint, .. } = self.unpack(); | |
| 441 | DepNode { kind, key_fingerprint } | |
| 432 | 442 | } |
| 433 | 443 | |
| 434 | 444 | #[inline] |
| ... | ... | @@ -443,15 +453,20 @@ impl SerializedNodeHeader { |
| 443 | 453 | #[derive(Debug)] |
| 444 | 454 | struct NodeInfo { |
| 445 | 455 | node: DepNode, |
| 446 | fingerprint: Fingerprint, | |
| 456 | value_fingerprint: Fingerprint, | |
| 447 | 457 | edges: EdgesVec, |
| 448 | 458 | } |
| 449 | 459 | |
| 450 | 460 | impl NodeInfo { |
| 451 | 461 | fn encode(&self, e: &mut MemEncoder, index: DepNodeIndex) { |
| 452 | let NodeInfo { ref node, fingerprint, ref edges } = *self; | |
| 453 | let header = | |
| 454 | SerializedNodeHeader::new(node, index, fingerprint, edges.max_index(), edges.len()); | |
| 462 | let NodeInfo { ref node, value_fingerprint, ref edges } = *self; | |
| 463 | let header = SerializedNodeHeader::new( | |
| 464 | node, | |
| 465 | index, | |
| 466 | value_fingerprint, | |
| 467 | edges.max_index(), | |
| 468 | edges.len(), | |
| 469 | ); | |
| 455 | 470 | e.write_array(header.bytes); |
| 456 | 471 | |
| 457 | 472 | if header.len().is_none() { |
| ... | ... | @@ -476,7 +491,7 @@ impl NodeInfo { |
| 476 | 491 | e: &mut MemEncoder, |
| 477 | 492 | node: &DepNode, |
| 478 | 493 | index: DepNodeIndex, |
| 479 | fingerprint: Fingerprint, | |
| 494 | value_fingerprint: Fingerprint, | |
| 480 | 495 | prev_index: SerializedDepNodeIndex, |
| 481 | 496 | colors: &DepNodeColorMap, |
| 482 | 497 | previous: &SerializedDepGraph, |
| ... | ... | @@ -488,7 +503,8 @@ impl NodeInfo { |
| 488 | 503 | let edge_max = |
| 489 | 504 | edges.clone().map(|i| colors.current(i).unwrap().as_u32()).max().unwrap_or(0); |
| 490 | 505 | |
| 491 | let header = SerializedNodeHeader::new(node, index, fingerprint, edge_max, edge_count); | |
| 506 | let header = | |
| 507 | SerializedNodeHeader::new(node, index, value_fingerprint, edge_max, edge_count); | |
| 492 | 508 | e.write_array(header.bytes); |
| 493 | 509 | |
| 494 | 510 | if header.len().is_none() { |
| ... | ... | @@ -676,12 +692,12 @@ impl EncoderState { |
| 676 | 692 | local: &mut LocalEncoderState, |
| 677 | 693 | ) { |
| 678 | 694 | let node = self.previous.index_to_node(prev_index); |
| 679 | let fingerprint = self.previous.fingerprint_by_index(prev_index); | |
| 695 | let value_fingerprint = self.previous.value_fingerprint_for_index(prev_index); | |
| 680 | 696 | let edge_count = NodeInfo::encode_promoted( |
| 681 | 697 | &mut local.encoder, |
| 682 | 698 | node, |
| 683 | 699 | index, |
| 684 | fingerprint, | |
| 700 | value_fingerprint, | |
| 685 | 701 | prev_index, |
| 686 | 702 | colors, |
| 687 | 703 | &self.previous, |
| ... | ... | @@ -857,11 +873,11 @@ impl GraphEncoder { |
| 857 | 873 | pub(crate) fn send_new( |
| 858 | 874 | &self, |
| 859 | 875 | node: DepNode, |
| 860 | fingerprint: Fingerprint, | |
| 876 | value_fingerprint: Fingerprint, | |
| 861 | 877 | edges: EdgesVec, |
| 862 | 878 | ) -> DepNodeIndex { |
| 863 | 879 | let _prof_timer = self.profiler.generic_activity("incr_comp_encode_dep_graph"); |
| 864 | let node = NodeInfo { node, fingerprint, edges }; | |
| 880 | let node = NodeInfo { node, value_fingerprint, edges }; | |
| 865 | 881 | let mut local = self.status.local.borrow_mut(); |
| 866 | 882 | let index = self.status.next_index(&mut *local); |
| 867 | 883 | self.status.bump_index(&mut *local); |
| ... | ... | @@ -877,12 +893,12 @@ impl GraphEncoder { |
| 877 | 893 | prev_index: SerializedDepNodeIndex, |
| 878 | 894 | colors: &DepNodeColorMap, |
| 879 | 895 | node: DepNode, |
| 880 | fingerprint: Fingerprint, | |
| 896 | value_fingerprint: Fingerprint, | |
| 881 | 897 | edges: EdgesVec, |
| 882 | 898 | is_green: bool, |
| 883 | 899 | ) -> DepNodeIndex { |
| 884 | 900 | let _prof_timer = self.profiler.generic_activity("incr_comp_encode_dep_graph"); |
| 885 | let node = NodeInfo { node, fingerprint, edges }; | |
| 901 | let node = NodeInfo { node, value_fingerprint, edges }; | |
| 886 | 902 | |
| 887 | 903 | let mut local = self.status.local.borrow_mut(); |
| 888 | 904 |
compiler/rustc_middle/src/mir/pretty.rs-4| ... | ... | @@ -1237,10 +1237,6 @@ impl<'tcx> Debug for Rvalue<'tcx> { |
| 1237 | 1237 | } |
| 1238 | 1238 | } |
| 1239 | 1239 | |
| 1240 | ShallowInitBox(ref place, ref ty) => { | |
| 1241 | with_no_trimmed_paths!(write!(fmt, "ShallowInitBox({place:?}, {ty})")) | |
| 1242 | } | |
| 1243 | ||
| 1244 | 1240 | WrapUnsafeBinder(ref op, ty) => { |
| 1245 | 1241 | with_no_trimmed_paths!(write!(fmt, "wrap_binder!({op:?}; {ty})")) |
| 1246 | 1242 | } |
compiler/rustc_middle/src/mir/statement.rs-17| ... | ... | @@ -747,11 +747,6 @@ impl<'tcx> ConstOperand<'tcx> { |
| 747 | 747 | /////////////////////////////////////////////////////////////////////////// |
| 748 | 748 | // Rvalues |
| 749 | 749 | |
| 750 | pub enum RvalueInitializationState { | |
| 751 | Shallow, | |
| 752 | Deep, | |
| 753 | } | |
| 754 | ||
| 755 | 750 | impl<'tcx> Rvalue<'tcx> { |
| 756 | 751 | /// Returns true if rvalue can be safely removed when the result is unused. |
| 757 | 752 | #[inline] |
| ... | ... | @@ -786,7 +781,6 @@ impl<'tcx> Rvalue<'tcx> { |
| 786 | 781 | | Rvalue::UnaryOp(_, _) |
| 787 | 782 | | Rvalue::Discriminant(_) |
| 788 | 783 | | Rvalue::Aggregate(_, _) |
| 789 | | Rvalue::ShallowInitBox(_, _) | |
| 790 | 784 | | Rvalue::WrapUnsafeBinder(_, _) => true, |
| 791 | 785 | } |
| 792 | 786 | } |
| ... | ... | @@ -833,21 +827,10 @@ impl<'tcx> Rvalue<'tcx> { |
| 833 | 827 | } |
| 834 | 828 | AggregateKind::RawPtr(ty, mutability) => Ty::new_ptr(tcx, ty, mutability), |
| 835 | 829 | }, |
| 836 | Rvalue::ShallowInitBox(_, ty) => Ty::new_box(tcx, ty), | |
| 837 | 830 | Rvalue::CopyForDeref(ref place) => place.ty(local_decls, tcx).ty, |
| 838 | 831 | Rvalue::WrapUnsafeBinder(_, ty) => ty, |
| 839 | 832 | } |
| 840 | 833 | } |
| 841 | ||
| 842 | #[inline] | |
| 843 | /// Returns `true` if this rvalue is deeply initialized (most rvalues) or | |
| 844 | /// whether its only shallowly initialized (`Rvalue::Box`). | |
| 845 | pub fn initialization_state(&self) -> RvalueInitializationState { | |
| 846 | match *self { | |
| 847 | Rvalue::ShallowInitBox(_, _) => RvalueInitializationState::Shallow, | |
| 848 | _ => RvalueInitializationState::Deep, | |
| 849 | } | |
| 850 | } | |
| 851 | 834 | } |
| 852 | 835 | |
| 853 | 836 | impl BorrowKind { |
compiler/rustc_middle/src/mir/syntax.rs-7| ... | ... | @@ -1458,13 +1458,6 @@ pub enum Rvalue<'tcx> { |
| 1458 | 1458 | /// coroutine lowering, `Coroutine` aggregate kinds are disallowed too. |
| 1459 | 1459 | Aggregate(Box<AggregateKind<'tcx>>, IndexVec<FieldIdx, Operand<'tcx>>), |
| 1460 | 1460 | |
| 1461 | /// Transmutes a `*mut u8` into shallow-initialized `Box<T>`. | |
| 1462 | /// | |
| 1463 | /// This is different from a normal transmute because dataflow analysis will treat the box as | |
| 1464 | /// initialized but its content as uninitialized. Like other pointer casts, this in general | |
| 1465 | /// affects alias analysis. | |
| 1466 | ShallowInitBox(Operand<'tcx>, Ty<'tcx>), | |
| 1467 | ||
| 1468 | 1461 | /// A CopyForDeref is equivalent to a read from a place at the |
| 1469 | 1462 | /// codegen level, but is treated specially by drop elaboration. When such a read happens, it |
| 1470 | 1463 | /// is guaranteed (via nature of the mir_opt `Derefer` in rustc_mir_transform/src/deref_separator) |
compiler/rustc_middle/src/mir/visit.rs-5| ... | ... | @@ -810,11 +810,6 @@ macro_rules! make_mir_visitor { |
| 810 | 810 | } |
| 811 | 811 | } |
| 812 | 812 | |
| 813 | Rvalue::ShallowInitBox(operand, ty) => { | |
| 814 | self.visit_operand(operand, location); | |
| 815 | self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)); | |
| 816 | } | |
| 817 | ||
| 818 | 813 | Rvalue::WrapUnsafeBinder(op, ty) => { |
| 819 | 814 | self.visit_operand(op, location); |
| 820 | 815 | self.visit_ty($(& $mutability)? *ty, TyContext::Location(location)); |
compiler/rustc_middle/src/query/caches.rs+1-1| ... | ... | @@ -67,7 +67,7 @@ where |
| 67 | 67 | #[inline] |
| 68 | 68 | fn complete(&self, key: K, value: V, index: DepNodeIndex) { |
| 69 | 69 | // We may be overwriting another value. This is all right, since the dep-graph |
| 70 | // will check that the fingerprint matches. | |
| 70 | // will check that the value fingerprint matches. | |
| 71 | 71 | self.cache.insert(key, (value, index)); |
| 72 | 72 | } |
| 73 | 73 |
compiler/rustc_middle/src/verify_ich.rs+1-1| ... | ... | @@ -25,7 +25,7 @@ pub fn incremental_verify_ich<'tcx, V>( |
| 25 | 25 | tcx.with_stable_hashing_context(|mut hcx| f(&mut hcx, result)) |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | let old_hash = dep_graph_data.prev_fingerprint_of(prev_index); | |
| 28 | let old_hash = dep_graph_data.prev_value_fingerprint_of(prev_index); | |
| 29 | 29 | |
| 30 | 30 | if new_hash != old_hash { |
| 31 | 31 | incremental_verify_ich_failed(tcx, prev_index, &|| format_value(result)); |
compiler/rustc_mir_dataflow/src/impls/borrowed_locals.rs-1| ... | ... | @@ -86,7 +86,6 @@ where |
| 86 | 86 | |
| 87 | 87 | Rvalue::Cast(..) |
| 88 | 88 | | Rvalue::Ref(_, BorrowKind::Fake(_), _) |
| 89 | | Rvalue::ShallowInitBox(..) | |
| 90 | 89 | | Rvalue::Use(..) |
| 91 | 90 | | Rvalue::ThreadLocalRef(..) |
| 92 | 91 | | Rvalue::Repeat(..) |
compiler/rustc_mir_dataflow/src/move_paths/builder.rs+1-10| ... | ... | @@ -391,15 +391,7 @@ impl<'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> MoveDataBuilder<'a, 'tcx, F> { |
| 391 | 391 | } |
| 392 | 392 | StatementKind::Assign(box (place, rval)) => { |
| 393 | 393 | self.create_move_path(*place); |
| 394 | if let RvalueInitializationState::Shallow = rval.initialization_state() { | |
| 395 | // Box starts out uninitialized - need to create a separate | |
| 396 | // move-path for the interior so it will be separate from | |
| 397 | // the exterior. | |
| 398 | self.create_move_path(self.tcx.mk_place_deref(*place)); | |
| 399 | self.gather_init(place.as_ref(), InitKind::Shallow); | |
| 400 | } else { | |
| 401 | self.gather_init(place.as_ref(), InitKind::Deep); | |
| 402 | } | |
| 394 | self.gather_init(place.as_ref(), InitKind::Deep); | |
| 403 | 395 | self.gather_rvalue(rval); |
| 404 | 396 | } |
| 405 | 397 | StatementKind::FakeRead(box (_, place)) => { |
| ... | ... | @@ -435,7 +427,6 @@ impl<'a, 'tcx, F: Fn(Ty<'tcx>) -> bool> MoveDataBuilder<'a, 'tcx, F> { |
| 435 | 427 | Rvalue::Use(ref operand) |
| 436 | 428 | | Rvalue::Repeat(ref operand, _) |
| 437 | 429 | | Rvalue::Cast(_, ref operand, _) |
| 438 | | Rvalue::ShallowInitBox(ref operand, _) | |
| 439 | 430 | | Rvalue::UnaryOp(_, ref operand) |
| 440 | 431 | | Rvalue::WrapUnsafeBinder(ref operand, _) => self.gather_operand(operand), |
| 441 | 432 | Rvalue::BinaryOp(ref _binop, box (ref lhs, ref rhs)) => { |
compiler/rustc_mir_transform/src/dataflow_const_prop.rs-1| ... | ... | @@ -467,7 +467,6 @@ impl<'a, 'tcx> ConstAnalysis<'a, 'tcx> { |
| 467 | 467 | Rvalue::Discriminant(place) => state.get_discr(place.as_ref(), &self.map), |
| 468 | 468 | Rvalue::Use(operand) => return self.handle_operand(operand, state), |
| 469 | 469 | Rvalue::CopyForDeref(_) => bug!("`CopyForDeref` in runtime MIR"), |
| 470 | Rvalue::ShallowInitBox(..) => bug!("`ShallowInitBox` in runtime MIR"), | |
| 471 | 470 | Rvalue::Ref(..) | Rvalue::RawPtr(..) => { |
| 472 | 471 | // We don't track such places. |
| 473 | 472 | return ValueOrPlace::TOP; |
compiler/rustc_mir_transform/src/elaborate_box_derefs.rs+1-67| ... | ... | @@ -1,12 +1,8 @@ |
| 1 | 1 | //! This pass transforms derefs of Box into a deref of the pointer inside Box. |
| 2 | 2 | //! |
| 3 | 3 | //! Box is not actually a pointer so it is incorrect to dereference it directly. |
| 4 | //! | |
| 5 | //! `ShallowInitBox` being a device for drop elaboration to understand deferred assignment to box | |
| 6 | //! contents, we do not need this any more on runtime MIR. | |
| 7 | 4 | |
| 8 | use rustc_abi::{FieldIdx, VariantIdx}; | |
| 9 | use rustc_index::{IndexVec, indexvec}; | |
| 5 | use rustc_abi::FieldIdx; | |
| 10 | 6 | use rustc_middle::mir::visit::MutVisitor; |
| 11 | 7 | use rustc_middle::mir::*; |
| 12 | 8 | use rustc_middle::span_bug; |
| ... | ... | @@ -89,68 +85,6 @@ impl<'a, 'tcx> MutVisitor<'tcx> for ElaborateBoxDerefVisitor<'a, 'tcx> { |
| 89 | 85 | |
| 90 | 86 | self.super_place(place, context, location); |
| 91 | 87 | } |
| 92 | ||
| 93 | fn visit_statement(&mut self, stmt: &mut Statement<'tcx>, location: Location) { | |
| 94 | self.super_statement(stmt, location); | |
| 95 | ||
| 96 | let tcx = self.tcx; | |
| 97 | let source_info = stmt.source_info; | |
| 98 | ||
| 99 | if let StatementKind::Assign(box (_, ref mut rvalue)) = stmt.kind | |
| 100 | && let Rvalue::ShallowInitBox(ref mut mutptr_to_u8, pointee) = *rvalue | |
| 101 | && let ty::Adt(box_adt, box_args) = Ty::new_box(tcx, pointee).kind() | |
| 102 | { | |
| 103 | let args = tcx.mk_args(&[pointee.into()]); | |
| 104 | let (unique_ty, nonnull_ty, ptr_ty) = | |
| 105 | build_ptr_tys(tcx, pointee, self.unique_def, self.nonnull_def); | |
| 106 | let adt_kind = |def: ty::AdtDef<'tcx>, args| { | |
| 107 | Box::new(AggregateKind::Adt(def.did(), VariantIdx::ZERO, args, None, None)) | |
| 108 | }; | |
| 109 | let zst = |ty| { | |
| 110 | Operand::Constant(Box::new(ConstOperand { | |
| 111 | span: source_info.span, | |
| 112 | user_ty: None, | |
| 113 | const_: Const::zero_sized(ty), | |
| 114 | })) | |
| 115 | }; | |
| 116 | ||
| 117 | let constptr = self.patch.new_temp(ptr_ty, source_info.span); | |
| 118 | self.patch.add_assign( | |
| 119 | location, | |
| 120 | constptr.into(), | |
| 121 | Rvalue::Cast(CastKind::Transmute, mutptr_to_u8.clone(), ptr_ty), | |
| 122 | ); | |
| 123 | ||
| 124 | let nonnull = self.patch.new_temp(nonnull_ty, source_info.span); | |
| 125 | self.patch.add_assign( | |
| 126 | location, | |
| 127 | nonnull.into(), | |
| 128 | Rvalue::Aggregate( | |
| 129 | adt_kind(self.nonnull_def, args), | |
| 130 | indexvec![Operand::Move(constptr.into())], | |
| 131 | ), | |
| 132 | ); | |
| 133 | ||
| 134 | let unique = self.patch.new_temp(unique_ty, source_info.span); | |
| 135 | let phantomdata_ty = | |
| 136 | self.unique_def.non_enum_variant().fields[FieldIdx::ONE].ty(tcx, args); | |
| 137 | self.patch.add_assign( | |
| 138 | location, | |
| 139 | unique.into(), | |
| 140 | Rvalue::Aggregate( | |
| 141 | adt_kind(self.unique_def, args), | |
| 142 | indexvec![Operand::Move(nonnull.into()), zst(phantomdata_ty)], | |
| 143 | ), | |
| 144 | ); | |
| 145 | ||
| 146 | let global_alloc_ty = | |
| 147 | box_adt.non_enum_variant().fields[FieldIdx::ONE].ty(tcx, box_args); | |
| 148 | *rvalue = Rvalue::Aggregate( | |
| 149 | adt_kind(*box_adt, box_args), | |
| 150 | indexvec![Operand::Move(unique.into()), zst(global_alloc_ty)], | |
| 151 | ); | |
| 152 | } | |
| 153 | } | |
| 154 | 88 | } |
| 155 | 89 | |
| 156 | 90 | pub(super) struct ElaborateBoxDerefs; |
compiler/rustc_mir_transform/src/gvn.rs+1-1| ... | ... | @@ -1069,7 +1069,7 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> { |
| 1069 | 1069 | |
| 1070 | 1070 | // Unsupported values. |
| 1071 | 1071 | Rvalue::ThreadLocalRef(..) => return None, |
| 1072 | Rvalue::CopyForDeref(_) | Rvalue::ShallowInitBox(..) => { | |
| 1072 | Rvalue::CopyForDeref(_) => { | |
| 1073 | 1073 | bug!("forbidden in runtime MIR: {rvalue:?}") |
| 1074 | 1074 | } |
| 1075 | 1075 | }; |
compiler/rustc_mir_transform/src/known_panics_lint.rs-3| ... | ... | @@ -443,7 +443,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { |
| 443 | 443 | | Rvalue::CopyForDeref(..) |
| 444 | 444 | | Rvalue::Repeat(..) |
| 445 | 445 | | Rvalue::Cast(..) |
| 446 | | Rvalue::ShallowInitBox(..) | |
| 447 | 446 | | Rvalue::Discriminant(..) |
| 448 | 447 | | Rvalue::WrapUnsafeBinder(..) => {} |
| 449 | 448 | } |
| ... | ... | @@ -605,8 +604,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { |
| 605 | 604 | |
| 606 | 605 | Ref(..) | RawPtr(..) => return None, |
| 607 | 606 | |
| 608 | ShallowInitBox(..) => return None, | |
| 609 | ||
| 610 | 607 | Cast(ref kind, ref value, to) => match kind { |
| 611 | 608 | CastKind::IntToInt | CastKind::IntToFloat => { |
| 612 | 609 | let value = self.eval_operand(value)?; |
compiler/rustc_mir_transform/src/lint.rs-1| ... | ... | @@ -85,7 +85,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Lint<'a, 'tcx> { |
| 85 | 85 | | Rvalue::Repeat(..) |
| 86 | 86 | | Rvalue::Aggregate(..) |
| 87 | 87 | | Rvalue::Cast(..) |
| 88 | | Rvalue::ShallowInitBox(..) | |
| 89 | 88 | | Rvalue::WrapUnsafeBinder(..) => true, |
| 90 | 89 | Rvalue::ThreadLocalRef(..) |
| 91 | 90 | | Rvalue::UnaryOp(..) |
compiler/rustc_mir_transform/src/pass_manager.rs+57| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | use std::cell::RefCell; |
| 2 | 2 | use std::collections::hash_map::Entry; |
| 3 | use std::sync::atomic::Ordering; | |
| 3 | 4 | |
| 4 | 5 | use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; |
| 5 | 6 | use rustc_middle::mir::{Body, MirDumper, MirPhase, RuntimePhase}; |
| ... | ... | @@ -285,6 +286,19 @@ fn run_passes_inner<'tcx>( |
| 285 | 286 | continue; |
| 286 | 287 | }; |
| 287 | 288 | |
| 289 | if is_optimization_stage(body, phase_change, optimizations) | |
| 290 | && let Some(limit) = &tcx.sess.opts.unstable_opts.mir_opt_bisect_limit | |
| 291 | { | |
| 292 | if limited_by_opt_bisect( | |
| 293 | tcx, | |
| 294 | tcx.def_path_debug_str(body.source.def_id()), | |
| 295 | *limit, | |
| 296 | *pass, | |
| 297 | ) { | |
| 298 | continue; | |
| 299 | } | |
| 300 | } | |
| 301 | ||
| 288 | 302 | let dumper = if pass.is_mir_dump_enabled() |
| 289 | 303 | && let Some(dumper) = MirDumper::new(tcx, pass_name, body) |
| 290 | 304 | { |
| ... | ... | @@ -356,3 +370,46 @@ pub(super) fn dump_mir_for_phase_change<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tc |
| 356 | 370 | dumper.set_show_pass_num().set_disambiguator(&"after").dump_mir(body) |
| 357 | 371 | } |
| 358 | 372 | } |
| 373 | ||
| 374 | fn is_optimization_stage( | |
| 375 | body: &Body<'_>, | |
| 376 | phase_change: Option<MirPhase>, | |
| 377 | optimizations: Optimizations, | |
| 378 | ) -> bool { | |
| 379 | optimizations == Optimizations::Allowed | |
| 380 | && body.phase == MirPhase::Runtime(RuntimePhase::PostCleanup) | |
| 381 | && phase_change == Some(MirPhase::Runtime(RuntimePhase::Optimized)) | |
| 382 | } | |
| 383 | ||
| 384 | fn limited_by_opt_bisect<'tcx, P>( | |
| 385 | tcx: TyCtxt<'tcx>, | |
| 386 | def_path: String, | |
| 387 | limit: usize, | |
| 388 | pass: &P, | |
| 389 | ) -> bool | |
| 390 | where | |
| 391 | P: MirPass<'tcx> + ?Sized, | |
| 392 | { | |
| 393 | let current_opt_bisect_count = | |
| 394 | tcx.sess.mir_opt_bisect_eval_count.fetch_add(1, Ordering::Relaxed); | |
| 395 | ||
| 396 | let can_run = current_opt_bisect_count < limit; | |
| 397 | ||
| 398 | if can_run { | |
| 399 | eprintln!( | |
| 400 | "BISECT: running pass ({}) {} on {}", | |
| 401 | current_opt_bisect_count + 1, | |
| 402 | pass.name(), | |
| 403 | def_path | |
| 404 | ); | |
| 405 | } else { | |
| 406 | eprintln!( | |
| 407 | "BISECT: NOT running pass ({}) {} on {}", | |
| 408 | current_opt_bisect_count + 1, | |
| 409 | pass.name(), | |
| 410 | def_path | |
| 411 | ); | |
| 412 | } | |
| 413 | ||
| 414 | !can_run | |
| 415 | } |
compiler/rustc_mir_transform/src/promote_consts.rs-2| ... | ... | @@ -449,8 +449,6 @@ impl<'tcx> Validator<'_, 'tcx> { |
| 449 | 449 | self.validate_operand(operand)?; |
| 450 | 450 | } |
| 451 | 451 | |
| 452 | Rvalue::ShallowInitBox(_, _) => return Err(Unpromotable), | |
| 453 | ||
| 454 | 452 | Rvalue::UnaryOp(op, operand) => { |
| 455 | 453 | match op { |
| 456 | 454 | // These operations can never fail. |
compiler/rustc_mir_transform/src/single_use_consts.rs+1-1| ... | ... | @@ -85,7 +85,7 @@ impl<'tcx> crate::MirPass<'tcx> for SingleUseConsts { |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | fn is_required(&self) -> bool { |
| 88 | true | |
| 88 | false | |
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 |
compiler/rustc_mir_transform/src/validate.rs-8| ... | ... | @@ -1259,14 +1259,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { |
| 1259 | 1259 | } |
| 1260 | 1260 | } |
| 1261 | 1261 | } |
| 1262 | Rvalue::ShallowInitBox(operand, _) => { | |
| 1263 | if self.body.phase >= MirPhase::Runtime(RuntimePhase::Initial) { | |
| 1264 | self.fail(location, format!("ShallowInitBox after ElaborateBoxDerefs")) | |
| 1265 | } | |
| 1266 | ||
| 1267 | let a = operand.ty(&self.body.local_decls, self.tcx); | |
| 1268 | check_kinds!(a, "Cannot shallow init type {:?}", ty::RawPtr(..)); | |
| 1269 | } | |
| 1270 | 1262 | Rvalue::Cast(kind, operand, target_type) => { |
| 1271 | 1263 | let op_ty = operand.ty(self.body, self.tcx); |
| 1272 | 1264 | match kind { |
compiler/rustc_public/src/mir/body.rs-8| ... | ... | @@ -567,13 +567,6 @@ pub enum Rvalue { |
| 567 | 567 | /// [#74836]: https://github.com/rust-lang/rust/issues/74836 |
| 568 | 568 | Repeat(Operand, TyConst), |
| 569 | 569 | |
| 570 | /// Transmutes a `*mut u8` into shallow-initialized `Box<T>`. | |
| 571 | /// | |
| 572 | /// This is different from a normal transmute because dataflow analysis will treat the box as | |
| 573 | /// initialized but its content as uninitialized. Like other pointer casts, this in general | |
| 574 | /// affects alias analysis. | |
| 575 | ShallowInitBox(Operand, Ty), | |
| 576 | ||
| 577 | 570 | /// Creates a pointer/reference to the given thread local. |
| 578 | 571 | /// |
| 579 | 572 | /// The yielded type is a `*mut T` if the static is mutable, otherwise if the static is extern a |
| ... | ... | @@ -651,7 +644,6 @@ impl Rvalue { |
| 651 | 644 | } |
| 652 | 645 | AggregateKind::RawPtr(ty, mutability) => Ok(Ty::new_ptr(ty, mutability)), |
| 653 | 646 | }, |
| 654 | Rvalue::ShallowInitBox(_, ty) => Ok(Ty::new_box(*ty)), | |
| 655 | 647 | Rvalue::CopyForDeref(place) => place.ty(locals), |
| 656 | 648 | } |
| 657 | 649 | } |
compiler/rustc_public/src/mir/pretty.rs-1| ... | ... | @@ -383,7 +383,6 @@ fn pretty_rvalue<W: Write>(writer: &mut W, rval: &Rvalue) -> io::Result<()> { |
| 383 | 383 | Rvalue::Repeat(op, cnst) => { |
| 384 | 384 | write!(writer, "[{}; {}]", pretty_operand(op), pretty_ty_const(cnst)) |
| 385 | 385 | } |
| 386 | Rvalue::ShallowInitBox(_, _) => Ok(()), | |
| 387 | 386 | Rvalue::ThreadLocalRef(item) => { |
| 388 | 387 | write!(writer, "thread_local_ref{item:?}") |
| 389 | 388 | } |
compiler/rustc_public/src/mir/visit.rs-4| ... | ... | @@ -277,10 +277,6 @@ macro_rules! make_mir_visitor { |
| 277 | 277 | self.visit_operand(op, location); |
| 278 | 278 | self.visit_ty_const(constant, location); |
| 279 | 279 | } |
| 280 | Rvalue::ShallowInitBox(op, ty) => { | |
| 281 | self.visit_ty(ty, location); | |
| 282 | self.visit_operand(op, location) | |
| 283 | } | |
| 284 | 280 | Rvalue::ThreadLocalRef(_) => {} |
| 285 | 281 | Rvalue::UnaryOp(_, op) | Rvalue::Use(op) => { |
| 286 | 282 | self.visit_operand(op, location); |
compiler/rustc_public/src/unstable/convert/stable/mir.rs-3| ... | ... | @@ -240,9 +240,6 @@ impl<'tcx> Stable<'tcx> for mir::Rvalue<'tcx> { |
| 240 | 240 | let operands = operands.iter().map(|op| op.stable(tables, cx)).collect(); |
| 241 | 241 | crate::mir::Rvalue::Aggregate(agg_kind.stable(tables, cx), operands) |
| 242 | 242 | } |
| 243 | ShallowInitBox(op, ty) => { | |
| 244 | crate::mir::Rvalue::ShallowInitBox(op.stable(tables, cx), ty.stable(tables, cx)) | |
| 245 | } | |
| 246 | 243 | CopyForDeref(place) => crate::mir::Rvalue::CopyForDeref(place.stable(tables, cx)), |
| 247 | 244 | WrapUnsafeBinder(..) => todo!("FIXME(unsafe_binders):"), |
| 248 | 245 | } |
compiler/rustc_query_impl/src/dep_kind_vtables.rs+15-15| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_middle::bug; |
| 2 | use rustc_middle::dep_graph::{DepKindVTable, DepNodeKey, FingerprintStyle}; | |
| 2 | use rustc_middle::dep_graph::{DepKindVTable, DepNodeKey, KeyFingerprintStyle}; | |
| 3 | 3 | use rustc_middle::query::QueryCache; |
| 4 | 4 | |
| 5 | 5 | use crate::plumbing::{force_from_dep_node_inner, try_load_from_on_disk_cache_inner}; |
| ... | ... | @@ -15,7 +15,7 @@ mod non_query { |
| 15 | 15 | DepKindVTable { |
| 16 | 16 | is_anon: false, |
| 17 | 17 | is_eval_always: false, |
| 18 | fingerprint_style: FingerprintStyle::Unit, | |
| 18 | key_fingerprint_style: KeyFingerprintStyle::Unit, | |
| 19 | 19 | force_from_dep_node: Some(|_, dep_node, _| { |
| 20 | 20 | bug!("force_from_dep_node: encountered {dep_node:?}") |
| 21 | 21 | }), |
| ... | ... | @@ -29,7 +29,7 @@ mod non_query { |
| 29 | 29 | DepKindVTable { |
| 30 | 30 | is_anon: false, |
| 31 | 31 | is_eval_always: false, |
| 32 | fingerprint_style: FingerprintStyle::Unit, | |
| 32 | key_fingerprint_style: KeyFingerprintStyle::Unit, | |
| 33 | 33 | force_from_dep_node: Some(|_, dep_node, _| { |
| 34 | 34 | bug!("force_from_dep_node: encountered {dep_node:?}") |
| 35 | 35 | }), |
| ... | ... | @@ -42,7 +42,7 @@ mod non_query { |
| 42 | 42 | DepKindVTable { |
| 43 | 43 | is_anon: false, |
| 44 | 44 | is_eval_always: false, |
| 45 | fingerprint_style: FingerprintStyle::Unit, | |
| 45 | key_fingerprint_style: KeyFingerprintStyle::Unit, | |
| 46 | 46 | force_from_dep_node: Some(|tcx, _, prev_index| { |
| 47 | 47 | tcx.dep_graph.force_diagnostic_node(tcx, prev_index); |
| 48 | 48 | true |
| ... | ... | @@ -56,7 +56,7 @@ mod non_query { |
| 56 | 56 | DepKindVTable { |
| 57 | 57 | is_anon: true, |
| 58 | 58 | is_eval_always: false, |
| 59 | fingerprint_style: FingerprintStyle::Opaque, | |
| 59 | key_fingerprint_style: KeyFingerprintStyle::Opaque, | |
| 60 | 60 | force_from_dep_node: Some(|_, _, _| bug!("cannot force an anon node")), |
| 61 | 61 | try_load_from_on_disk_cache: None, |
| 62 | 62 | name: &"AnonZeroDeps", |
| ... | ... | @@ -67,7 +67,7 @@ mod non_query { |
| 67 | 67 | DepKindVTable { |
| 68 | 68 | is_anon: true, |
| 69 | 69 | is_eval_always: false, |
| 70 | fingerprint_style: FingerprintStyle::Unit, | |
| 70 | key_fingerprint_style: KeyFingerprintStyle::Unit, | |
| 71 | 71 | force_from_dep_node: None, |
| 72 | 72 | try_load_from_on_disk_cache: None, |
| 73 | 73 | name: &"TraitSelect", |
| ... | ... | @@ -78,7 +78,7 @@ mod non_query { |
| 78 | 78 | DepKindVTable { |
| 79 | 79 | is_anon: false, |
| 80 | 80 | is_eval_always: false, |
| 81 | fingerprint_style: FingerprintStyle::Opaque, | |
| 81 | key_fingerprint_style: KeyFingerprintStyle::Opaque, | |
| 82 | 82 | force_from_dep_node: None, |
| 83 | 83 | try_load_from_on_disk_cache: None, |
| 84 | 84 | name: &"CompileCodegenUnit", |
| ... | ... | @@ -89,7 +89,7 @@ mod non_query { |
| 89 | 89 | DepKindVTable { |
| 90 | 90 | is_anon: false, |
| 91 | 91 | is_eval_always: false, |
| 92 | fingerprint_style: FingerprintStyle::Opaque, | |
| 92 | key_fingerprint_style: KeyFingerprintStyle::Opaque, | |
| 93 | 93 | force_from_dep_node: None, |
| 94 | 94 | try_load_from_on_disk_cache: None, |
| 95 | 95 | name: &"CompileMonoItem", |
| ... | ... | @@ -100,7 +100,7 @@ mod non_query { |
| 100 | 100 | DepKindVTable { |
| 101 | 101 | is_anon: false, |
| 102 | 102 | is_eval_always: false, |
| 103 | fingerprint_style: FingerprintStyle::Unit, | |
| 103 | key_fingerprint_style: KeyFingerprintStyle::Unit, | |
| 104 | 104 | force_from_dep_node: None, |
| 105 | 105 | try_load_from_on_disk_cache: None, |
| 106 | 106 | name: &"Metadata", |
| ... | ... | @@ -118,17 +118,17 @@ where |
| 118 | 118 | Cache: QueryCache + 'tcx, |
| 119 | 119 | { |
| 120 | 120 | let is_anon = FLAGS.is_anon; |
| 121 | let fingerprint_style = if is_anon { | |
| 122 | FingerprintStyle::Opaque | |
| 121 | let key_fingerprint_style = if is_anon { | |
| 122 | KeyFingerprintStyle::Opaque | |
| 123 | 123 | } else { |
| 124 | <Cache::Key as DepNodeKey<'tcx>>::fingerprint_style() | |
| 124 | <Cache::Key as DepNodeKey<'tcx>>::key_fingerprint_style() | |
| 125 | 125 | }; |
| 126 | 126 | |
| 127 | if is_anon || !fingerprint_style.reconstructible() { | |
| 127 | if is_anon || !key_fingerprint_style.reconstructible() { | |
| 128 | 128 | return DepKindVTable { |
| 129 | 129 | is_anon, |
| 130 | 130 | is_eval_always, |
| 131 | fingerprint_style, | |
| 131 | key_fingerprint_style, | |
| 132 | 132 | force_from_dep_node: None, |
| 133 | 133 | try_load_from_on_disk_cache: None, |
| 134 | 134 | name: Q::NAME, |
| ... | ... | @@ -138,7 +138,7 @@ where |
| 138 | 138 | DepKindVTable { |
| 139 | 139 | is_anon, |
| 140 | 140 | is_eval_always, |
| 141 | fingerprint_style, | |
| 141 | key_fingerprint_style, | |
| 142 | 142 | force_from_dep_node: Some(|tcx, dep_node, _| { |
| 143 | 143 | force_from_dep_node_inner(Q::query_dispatcher(tcx), tcx, dep_node) |
| 144 | 144 | }), |
compiler/rustc_query_impl/src/execution.rs+2-2| ... | ... | @@ -509,7 +509,7 @@ fn try_load_from_disk_and_cache_in_memory<'tcx, C: QueryCache, const FLAGS: Quer |
| 509 | 509 | dep_graph_data.mark_debug_loaded_from_disk(*dep_node) |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | let prev_fingerprint = dep_graph_data.prev_fingerprint_of(prev_dep_node_index); | |
| 512 | let prev_fingerprint = dep_graph_data.prev_value_fingerprint_of(prev_dep_node_index); | |
| 513 | 513 | // If `-Zincremental-verify-ich` is specified, re-hash results from |
| 514 | 514 | // the cache and make sure that they have the expected fingerprint. |
| 515 | 515 | // |
| ... | ... | @@ -538,7 +538,7 @@ fn try_load_from_disk_and_cache_in_memory<'tcx, C: QueryCache, const FLAGS: Quer |
| 538 | 538 | // can be forced from `DepNode`. |
| 539 | 539 | debug_assert!( |
| 540 | 540 | !query.will_cache_on_disk_for_key(tcx, key) |
| 541 | || !tcx.fingerprint_style(dep_node.kind).reconstructible(), | |
| 541 | || !tcx.key_fingerprint_style(dep_node.kind).reconstructible(), | |
| 542 | 542 | "missing on-disk cache entry for {dep_node:?}" |
| 543 | 543 | ); |
| 544 | 544 |
compiler/rustc_query_impl/src/plumbing.rs+6-3| ... | ... | @@ -396,8 +396,11 @@ pub(crate) fn try_load_from_on_disk_cache_inner<'tcx, C: QueryCache, const FLAGS |
| 396 | 396 | ) { |
| 397 | 397 | debug_assert!(tcx.dep_graph.is_green(&dep_node)); |
| 398 | 398 | |
| 399 | let key = C::Key::recover(tcx, &dep_node).unwrap_or_else(|| { | |
| 400 | panic!("Failed to recover key for {:?} with hash {}", dep_node, dep_node.hash) | |
| 399 | let key = C::Key::try_recover_key(tcx, &dep_node).unwrap_or_else(|| { | |
| 400 | panic!( | |
| 401 | "Failed to recover key for {dep_node:?} with key fingerprint {}", | |
| 402 | dep_node.key_fingerprint | |
| 403 | ) | |
| 401 | 404 | }); |
| 402 | 405 | if query.will_cache_on_disk_for_key(tcx, &key) { |
| 403 | 406 | // Call `tcx.$query(key)` for its side-effect of loading the disk-cached |
| ... | ... | @@ -462,7 +465,7 @@ pub(crate) fn force_from_dep_node_inner<'tcx, C: QueryCache, const FLAGS: QueryF |
| 462 | 465 | "calling force_from_dep_node() on dep_kinds::codegen_unit" |
| 463 | 466 | ); |
| 464 | 467 | |
| 465 | if let Some(key) = C::Key::recover(tcx, &dep_node) { | |
| 468 | if let Some(key) = C::Key::try_recover_key(tcx, &dep_node) { | |
| 466 | 469 | force_query(query, tcx, key, dep_node); |
| 467 | 470 | true |
| 468 | 471 | } else { |
compiler/rustc_resolve/src/build_reduced_graph.rs+9-3| ... | ... | @@ -469,9 +469,15 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> { |
| 469 | 469 | PathResult::NonModule(partial_res) => { |
| 470 | 470 | expected_found_error(partial_res.expect_full_res()) |
| 471 | 471 | } |
| 472 | PathResult::Failed { span, label, suggestion, .. } => { | |
| 473 | Err(VisResolutionError::FailedToResolve(span, label, suggestion)) | |
| 474 | } | |
| 472 | PathResult::Failed { | |
| 473 | span, label, suggestion, message, segment_name, .. | |
| 474 | } => Err(VisResolutionError::FailedToResolve( | |
| 475 | span, | |
| 476 | segment_name, | |
| 477 | label, | |
| 478 | suggestion, | |
| 479 | message, | |
| 480 | )), | |
| 475 | 481 | PathResult::Indeterminate => Err(VisResolutionError::Indeterminate(path.span)), |
| 476 | 482 | } |
| 477 | 483 | } |
compiler/rustc_resolve/src/diagnostics.rs+76-36| ... | ... | @@ -32,7 +32,7 @@ use rustc_span::edit_distance::find_best_match_for_name; |
| 32 | 32 | use rustc_span::edition::Edition; |
| 33 | 33 | use rustc_span::hygiene::MacroKind; |
| 34 | 34 | use rustc_span::source_map::{SourceMap, Spanned}; |
| 35 | use rustc_span::{BytePos, Ident, Span, Symbol, SyntaxContext, kw, sym}; | |
| 35 | use rustc_span::{BytePos, Ident, RemapPathScopeComponents, Span, Symbol, SyntaxContext, kw, sym}; | |
| 36 | 36 | use thin_vec::{ThinVec, thin_vec}; |
| 37 | 37 | use tracing::{debug, instrument}; |
| 38 | 38 | |
| ... | ... | @@ -899,9 +899,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 899 | 899 | ResolutionError::SelfImportOnlyInImportListWithNonEmptyPrefix => { |
| 900 | 900 | self.dcx().create_err(errs::SelfImportOnlyInImportListWithNonEmptyPrefix { span }) |
| 901 | 901 | } |
| 902 | ResolutionError::FailedToResolve { segment, label, suggestion, module } => { | |
| 903 | let mut err = | |
| 904 | struct_span_code_err!(self.dcx(), span, E0433, "failed to resolve: {label}"); | |
| 902 | ResolutionError::FailedToResolve { segment, label, suggestion, module, message } => { | |
| 903 | let mut err = struct_span_code_err!(self.dcx(), span, E0433, "{message}"); | |
| 905 | 904 | err.span_label(span, label); |
| 906 | 905 | |
| 907 | 906 | if let Some((suggestions, msg, applicability)) = suggestion { |
| ... | ... | @@ -909,16 +908,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 909 | 908 | err.help(msg); |
| 910 | 909 | return err; |
| 911 | 910 | } |
| 912 | err.multipart_suggestion(msg, suggestions, applicability); | |
| 911 | err.multipart_suggestion_verbose(msg, suggestions, applicability); | |
| 913 | 912 | } |
| 914 | 913 | |
| 915 | if let Some(segment) = segment { | |
| 916 | let module = match module { | |
| 917 | Some(ModuleOrUniformRoot::Module(m)) if let Some(id) = m.opt_def_id() => id, | |
| 918 | _ => CRATE_DEF_ID.to_def_id(), | |
| 919 | }; | |
| 920 | self.find_cfg_stripped(&mut err, &segment, module); | |
| 921 | } | |
| 914 | let module = match module { | |
| 915 | Some(ModuleOrUniformRoot::Module(m)) if let Some(id) = m.opt_def_id() => id, | |
| 916 | _ => CRATE_DEF_ID.to_def_id(), | |
| 917 | }; | |
| 918 | self.find_cfg_stripped(&mut err, &segment, module); | |
| 922 | 919 | |
| 923 | 920 | err |
| 924 | 921 | } |
| ... | ... | @@ -1108,10 +1105,17 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1108 | 1105 | VisResolutionError::AncestorOnly(span) => { |
| 1109 | 1106 | self.dcx().create_err(errs::AncestorOnly(span)) |
| 1110 | 1107 | } |
| 1111 | VisResolutionError::FailedToResolve(span, label, suggestion) => self.into_struct_error( | |
| 1112 | span, | |
| 1113 | ResolutionError::FailedToResolve { segment: None, label, suggestion, module: None }, | |
| 1114 | ), | |
| 1108 | VisResolutionError::FailedToResolve(span, segment, label, suggestion, message) => self | |
| 1109 | .into_struct_error( | |
| 1110 | span, | |
| 1111 | ResolutionError::FailedToResolve { | |
| 1112 | segment, | |
| 1113 | label, | |
| 1114 | suggestion, | |
| 1115 | module: None, | |
| 1116 | message, | |
| 1117 | }, | |
| 1118 | ), | |
| 1115 | 1119 | VisResolutionError::ExpectedFound(span, path_str, res) => { |
| 1116 | 1120 | self.dcx().create_err(errs::ExpectedModuleFound { span, res, path_str }) |
| 1117 | 1121 | } |
| ... | ... | @@ -2438,13 +2442,25 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2438 | 2442 | failed_segment_idx: usize, |
| 2439 | 2443 | ident: Ident, |
| 2440 | 2444 | diag_metadata: Option<&DiagMetadata<'_>>, |
| 2441 | ) -> (String, Option<Suggestion>) { | |
| 2445 | ) -> (String, String, Option<Suggestion>) { | |
| 2442 | 2446 | let is_last = failed_segment_idx == path.len() - 1; |
| 2443 | 2447 | let ns = if is_last { opt_ns.unwrap_or(TypeNS) } else { TypeNS }; |
| 2444 | 2448 | let module_res = match module { |
| 2445 | 2449 | Some(ModuleOrUniformRoot::Module(module)) => module.res(), |
| 2446 | 2450 | _ => None, |
| 2447 | 2451 | }; |
| 2452 | let scope = match &path[..failed_segment_idx] { | |
| 2453 | [.., prev] => { | |
| 2454 | if prev.ident.name == kw::PathRoot { | |
| 2455 | format!("the crate root") | |
| 2456 | } else { | |
| 2457 | format!("`{}`", prev.ident) | |
| 2458 | } | |
| 2459 | } | |
| 2460 | _ => format!("this scope"), | |
| 2461 | }; | |
| 2462 | let message = format!("cannot find `{ident}` in {scope}"); | |
| 2463 | ||
| 2448 | 2464 | if module_res == self.graph_root.res() { |
| 2449 | 2465 | let is_mod = |res| matches!(res, Res::Def(DefKind::Mod, _)); |
| 2450 | 2466 | let mut candidates = self.lookup_import_candidates(ident, TypeNS, parent_scope, is_mod); |
| ... | ... | @@ -2462,6 +2478,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2462 | 2478 | Path { segments, span: Span::default(), tokens: None } |
| 2463 | 2479 | }; |
| 2464 | 2480 | ( |
| 2481 | message, | |
| 2465 | 2482 | String::from("unresolved import"), |
| 2466 | 2483 | Some(( |
| 2467 | 2484 | vec![(ident.span, pprust::path_to_string(&path))], |
| ... | ... | @@ -2471,6 +2488,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2471 | 2488 | ) |
| 2472 | 2489 | } else if ident.name == sym::core { |
| 2473 | 2490 | ( |
| 2491 | message, | |
| 2474 | 2492 | format!("you might be missing crate `{ident}`"), |
| 2475 | 2493 | Some(( |
| 2476 | 2494 | vec![(ident.span, "std".to_string())], |
| ... | ... | @@ -2479,9 +2497,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2479 | 2497 | )), |
| 2480 | 2498 | ) |
| 2481 | 2499 | } else if ident.name == kw::Underscore { |
| 2482 | (format!("`_` is not a valid crate or module name"), None) | |
| 2500 | ( | |
| 2501 | "invalid crate or module name `_`".to_string(), | |
| 2502 | "`_` is not a valid crate or module name".to_string(), | |
| 2503 | None, | |
| 2504 | ) | |
| 2483 | 2505 | } else if self.tcx.sess.is_rust_2015() { |
| 2484 | 2506 | ( |
| 2507 | format!("cannot find module or crate `{ident}` in {scope}"), | |
| 2485 | 2508 | format!("use of unresolved module or unlinked crate `{ident}`"), |
| 2486 | 2509 | Some(( |
| 2487 | 2510 | vec![( |
| ... | ... | @@ -2490,8 +2513,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2490 | 2513 | )], |
| 2491 | 2514 | if was_invoked_from_cargo() { |
| 2492 | 2515 | format!( |
| 2493 | "if you wanted to use a crate named `{ident}`, use `cargo add {ident}` \ | |
| 2494 | to add it to your `Cargo.toml` and import it in your code", | |
| 2516 | "if you wanted to use a crate named `{ident}`, use `cargo add \ | |
| 2517 | {ident}` to add it to your `Cargo.toml` and import it in your \ | |
| 2518 | code", | |
| 2495 | 2519 | ) |
| 2496 | 2520 | } else { |
| 2497 | 2521 | format!( |
| ... | ... | @@ -2503,7 +2527,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2503 | 2527 | )), |
| 2504 | 2528 | ) |
| 2505 | 2529 | } else { |
| 2506 | (format!("could not find `{ident}` in the crate root"), None) | |
| 2530 | (message, format!("could not find `{ident}` in the crate root"), None) | |
| 2507 | 2531 | } |
| 2508 | 2532 | } else if failed_segment_idx > 0 { |
| 2509 | 2533 | let parent = path[failed_segment_idx - 1].ident.name; |
| ... | ... | @@ -2569,15 +2593,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2569 | 2593 | ); |
| 2570 | 2594 | }; |
| 2571 | 2595 | } |
| 2572 | (msg, None) | |
| 2596 | (message, msg, None) | |
| 2573 | 2597 | } else if ident.name == kw::SelfUpper { |
| 2574 | 2598 | // As mentioned above, `opt_ns` being `None` indicates a module path in import. |
| 2575 | 2599 | // We can use this to improve a confusing error for, e.g. `use Self::Variant` in an |
| 2576 | 2600 | // impl |
| 2577 | 2601 | if opt_ns.is_none() { |
| 2578 | ("`Self` cannot be used in imports".to_string(), None) | |
| 2602 | (message, "`Self` cannot be used in imports".to_string(), None) | |
| 2579 | 2603 | } else { |
| 2580 | 2604 | ( |
| 2605 | message, | |
| 2581 | 2606 | "`Self` is only available in impls, traits, and type definitions".to_string(), |
| 2582 | 2607 | None, |
| 2583 | 2608 | ) |
| ... | ... | @@ -2608,12 +2633,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2608 | 2633 | // } |
| 2609 | 2634 | // ``` |
| 2610 | 2635 | Some(LateDecl::RibDef(Res::Local(id))) => { |
| 2611 | Some(*self.pat_span_map.get(&id).unwrap()) | |
| 2636 | Some((*self.pat_span_map.get(&id).unwrap(), "a", "local binding")) | |
| 2612 | 2637 | } |
| 2613 | 2638 | // Name matches item from a local name binding |
| 2614 | 2639 | // created by `use` declaration. For example: |
| 2615 | 2640 | // ``` |
| 2616 | // pub Foo: &str = ""; | |
| 2641 | // pub const Foo: &str = ""; | |
| 2617 | 2642 | // |
| 2618 | 2643 | // mod submod { |
| 2619 | 2644 | // use super::Foo; |
| ... | ... | @@ -2621,18 +2646,27 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2621 | 2646 | // // binding `Foo`. |
| 2622 | 2647 | // } |
| 2623 | 2648 | // ``` |
| 2624 | Some(LateDecl::Decl(name_binding)) => Some(name_binding.span), | |
| 2649 | Some(LateDecl::Decl(name_binding)) => Some(( | |
| 2650 | name_binding.span, | |
| 2651 | name_binding.res().article(), | |
| 2652 | name_binding.res().descr(), | |
| 2653 | )), | |
| 2625 | 2654 | _ => None, |
| 2626 | 2655 | }; |
| 2627 | let suggestion = match_span.map(|span| { | |
| 2628 | ( | |
| 2629 | vec![(span, String::from(""))], | |
| 2630 | format!("`{ident}` is defined here, but is not a type"), | |
| 2631 | Applicability::MaybeIncorrect, | |
| 2632 | ) | |
| 2633 | }); | |
| 2634 | 2656 | |
| 2635 | (format!("use of undeclared type `{ident}`"), suggestion) | |
| 2657 | let message = format!("cannot find type `{ident}` in {scope}"); | |
| 2658 | let label = if let Some((span, article, descr)) = match_span { | |
| 2659 | format!( | |
| 2660 | "`{ident}` is declared as {article} {descr} at `{}`, not a type", | |
| 2661 | self.tcx | |
| 2662 | .sess | |
| 2663 | .source_map() | |
| 2664 | .span_to_short_string(span, RemapPathScopeComponents::DIAGNOSTICS) | |
| 2665 | ) | |
| 2666 | } else { | |
| 2667 | format!("use of undeclared type `{ident}`") | |
| 2668 | }; | |
| 2669 | (message, label, None) | |
| 2636 | 2670 | } else { |
| 2637 | 2671 | let mut suggestion = None; |
| 2638 | 2672 | if ident.name == sym::alloc { |
| ... | ... | @@ -2663,7 +2697,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2663 | 2697 | ignore_import, |
| 2664 | 2698 | ) { |
| 2665 | 2699 | let descr = binding.res().descr(); |
| 2666 | (format!("{descr} `{ident}` is not a crate or module"), suggestion) | |
| 2700 | let message = format!("cannot find module or crate `{ident}` in {scope}"); | |
| 2701 | (message, format!("{descr} `{ident}` is not a crate or module"), suggestion) | |
| 2667 | 2702 | } else { |
| 2668 | 2703 | let suggestion = if suggestion.is_some() { |
| 2669 | 2704 | suggestion |
| ... | ... | @@ -2685,7 +2720,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 2685 | 2720 | Applicability::MaybeIncorrect, |
| 2686 | 2721 | )) |
| 2687 | 2722 | }; |
| 2688 | (format!("use of unresolved module or unlinked crate `{ident}`"), suggestion) | |
| 2723 | let message = format!("cannot find module or crate `{ident}` in {scope}"); | |
| 2724 | ( | |
| 2725 | message, | |
| 2726 | format!("use of unresolved module or unlinked crate `{ident}`"), | |
| 2727 | suggestion, | |
| 2728 | ) | |
| 2689 | 2729 | } |
| 2690 | 2730 | } |
| 2691 | 2731 | } |
compiler/rustc_resolve/src/ident.rs+34-7| ... | ... | @@ -1775,7 +1775,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1775 | 1775 | finalize.is_some(), |
| 1776 | 1776 | module_had_parse_errors, |
| 1777 | 1777 | module, |
| 1778 | || ("there are too many leading `super` keywords".to_string(), None), | |
| 1778 | || { | |
| 1779 | ( | |
| 1780 | "too many leading `super` keywords".to_string(), | |
| 1781 | "there are too many leading `super` keywords".to_string(), | |
| 1782 | None, | |
| 1783 | ) | |
| 1784 | }, | |
| 1779 | 1785 | ); |
| 1780 | 1786 | } |
| 1781 | 1787 | if segment_idx == 0 { |
| ... | ... | @@ -1823,16 +1829,24 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1823 | 1829 | module, |
| 1824 | 1830 | || { |
| 1825 | 1831 | let name_str = if name == kw::PathRoot { |
| 1826 | "crate root".to_string() | |
| 1832 | "the crate root".to_string() | |
| 1827 | 1833 | } else { |
| 1828 | 1834 | format!("`{name}`") |
| 1829 | 1835 | }; |
| 1830 | let label = if segment_idx == 1 && path[0].ident.name == kw::PathRoot { | |
| 1831 | format!("global paths cannot start with {name_str}") | |
| 1836 | let (message, label) = if segment_idx == 1 | |
| 1837 | && path[0].ident.name == kw::PathRoot | |
| 1838 | { | |
| 1839 | ( | |
| 1840 | format!("global paths cannot start with {name_str}"), | |
| 1841 | "cannot start with this".to_string(), | |
| 1842 | ) | |
| 1832 | 1843 | } else { |
| 1833 | format!("{name_str} in paths can only be used in start position") | |
| 1844 | ( | |
| 1845 | format!("{name_str} in paths can only be used in start position"), | |
| 1846 | "can only be used in path start position".to_string(), | |
| 1847 | ) | |
| 1834 | 1848 | }; |
| 1835 | (label, None) | |
| 1849 | (message, label, None) | |
| 1836 | 1850 | }, |
| 1837 | 1851 | ); |
| 1838 | 1852 | } |
| ... | ... | @@ -1948,7 +1962,20 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1948 | 1962 | res.article(), |
| 1949 | 1963 | res.descr() |
| 1950 | 1964 | ); |
| 1951 | (label, None) | |
| 1965 | let scope = match &path[..segment_idx] { | |
| 1966 | [.., prev] => { | |
| 1967 | if prev.ident.name == kw::PathRoot { | |
| 1968 | format!("the crate root") | |
| 1969 | } else { | |
| 1970 | format!("`{}`", prev.ident) | |
| 1971 | } | |
| 1972 | } | |
| 1973 | _ => format!("this scope"), | |
| 1974 | }; | |
| 1975 | // FIXME: reword, as the reason we expected a module is because of | |
| 1976 | // the following path segment. | |
| 1977 | let message = format!("cannot find module `{ident}` in {scope}"); | |
| 1978 | (message, label, None) | |
| 1952 | 1979 | }, |
| 1953 | 1980 | ); |
| 1954 | 1981 | } |
compiler/rustc_resolve/src/imports.rs+7-2| ... | ... | @@ -371,6 +371,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 371 | 371 | // - A glob decl is overwritten by its clone after setting ambiguity in it. |
| 372 | 372 | // FIXME: avoid this by removing `warn_ambiguity`, or by triggering glob re-fetch |
| 373 | 373 | // with the same decl in some way. |
| 374 | // - A glob decl is overwritten by a glob decl with larger visibility. | |
| 375 | // FIXME: avoid this by updating this visibility in place. | |
| 374 | 376 | // - A glob decl is overwritten by a glob decl re-fetching an |
| 375 | 377 | // overwritten decl from other module (the recursive case). |
| 376 | 378 | // Here we are detecting all such re-fetches and overwrite old decls |
| ... | ... | @@ -384,7 +386,8 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 384 | 386 | // FIXME: reenable the asserts when `warn_ambiguity` is removed (#149195). |
| 385 | 387 | // assert_ne!(old_deep_decl, deep_decl); |
| 386 | 388 | // assert!(old_deep_decl.is_glob_import()); |
| 387 | assert!(!deep_decl.is_glob_import()); | |
| 389 | // FIXME: reenable the assert when visibility is updated in place. | |
| 390 | // assert!(!deep_decl.is_glob_import()); | |
| 388 | 391 | if old_glob_decl.ambiguity.get().is_some() && glob_decl.ambiguity.get().is_none() { |
| 389 | 392 | // Do not lose glob ambiguities when re-fetching the glob. |
| 390 | 393 | glob_decl.ambiguity.set_unchecked(old_glob_decl.ambiguity.get()); |
| ... | ... | @@ -1042,16 +1045,18 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1042 | 1045 | suggestion, |
| 1043 | 1046 | module, |
| 1044 | 1047 | error_implied_by_parse_error: _, |
| 1048 | message, | |
| 1045 | 1049 | } => { |
| 1046 | 1050 | if no_ambiguity { |
| 1047 | 1051 | assert!(import.imported_module.get().is_none()); |
| 1048 | 1052 | self.report_error( |
| 1049 | 1053 | span, |
| 1050 | 1054 | ResolutionError::FailedToResolve { |
| 1051 | segment: Some(segment_name), | |
| 1055 | segment: segment_name, | |
| 1052 | 1056 | label, |
| 1053 | 1057 | suggestion, |
| 1054 | 1058 | module, |
| 1059 | message, | |
| 1055 | 1060 | }, |
| 1056 | 1061 | ); |
| 1057 | 1062 | } |
compiler/rustc_resolve/src/late.rs+3-1| ... | ... | @@ -4890,14 +4890,16 @@ impl<'a, 'ast, 'ra, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { |
| 4890 | 4890 | module, |
| 4891 | 4891 | segment_name, |
| 4892 | 4892 | error_implied_by_parse_error: _, |
| 4893 | message, | |
| 4893 | 4894 | } => { |
| 4894 | 4895 | return Err(respan( |
| 4895 | 4896 | span, |
| 4896 | 4897 | ResolutionError::FailedToResolve { |
| 4897 | segment: Some(segment_name), | |
| 4898 | segment: segment_name, | |
| 4898 | 4899 | label, |
| 4899 | 4900 | suggestion, |
| 4900 | 4901 | module, |
| 4902 | message, | |
| 4901 | 4903 | }, |
| 4902 | 4904 | )); |
| 4903 | 4905 | } |
compiler/rustc_resolve/src/late/diagnostics.rs+65-13| ... | ... | @@ -4060,25 +4060,32 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { |
| 4060 | 4060 | "instead, you are more likely to want" |
| 4061 | 4061 | }; |
| 4062 | 4062 | let mut owned_sugg = lt.kind == MissingLifetimeKind::Ampersand; |
| 4063 | let mut sugg_is_str_to_string = false; | |
| 4063 | 4064 | let mut sugg = vec![(lt.span, String::new())]; |
| 4064 | 4065 | if let Some((kind, _span)) = self.diag_metadata.current_function |
| 4065 | 4066 | && let FnKind::Fn(_, _, ast::Fn { sig, .. }) = kind |
| 4066 | && let ast::FnRetTy::Ty(ty) = &sig.decl.output | |
| 4067 | 4067 | { |
| 4068 | 4068 | let mut lt_finder = |
| 4069 | 4069 | LifetimeFinder { lifetime: lt.span, found: None, seen: vec![] }; |
| 4070 | lt_finder.visit_ty(&ty); | |
| 4071 | ||
| 4072 | if let [Ty { span, kind: TyKind::Ref(_, mut_ty), .. }] = | |
| 4073 | &lt_finder.seen[..] | |
| 4074 | { | |
| 4075 | // We might have a situation like | |
| 4076 | // fn g(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> | |
| 4077 | // but `lt.span` only points at `'_`, so to suggest `-> Option<()>` | |
| 4078 | // we need to find a more accurate span to end up with | |
| 4079 | // fn g<'a>(mut x: impl Iterator<Item = &'_ ()>) -> Option<()> | |
| 4080 | sugg = vec![(span.with_hi(mut_ty.ty.span.lo()), String::new())]; | |
| 4081 | owned_sugg = true; | |
| 4070 | for param in &sig.decl.inputs { | |
| 4071 | lt_finder.visit_ty(&param.ty); | |
| 4072 | } | |
| 4073 | if let ast::FnRetTy::Ty(ret_ty) = &sig.decl.output { | |
| 4074 | lt_finder.visit_ty(ret_ty); | |
| 4075 | let mut ret_lt_finder = | |
| 4076 | LifetimeFinder { lifetime: lt.span, found: None, seen: vec![] }; | |
| 4077 | ret_lt_finder.visit_ty(ret_ty); | |
| 4078 | if let [Ty { span, kind: TyKind::Ref(_, mut_ty), .. }] = | |
| 4079 | &ret_lt_finder.seen[..] | |
| 4080 | { | |
| 4081 | // We might have a situation like | |
| 4082 | // fn g(mut x: impl Iterator<Item = &'_ ()>) -> Option<&'_ ()> | |
| 4083 | // but `lt.span` only points at `'_`, so to suggest `-> Option<()>` | |
| 4084 | // we need to find a more accurate span to end up with | |
| 4085 | // fn g<'a>(mut x: impl Iterator<Item = &'_ ()>) -> Option<()> | |
| 4086 | sugg = vec![(span.with_hi(mut_ty.ty.span.lo()), String::new())]; | |
| 4087 | owned_sugg = true; | |
| 4088 | } | |
| 4082 | 4089 | } |
| 4083 | 4090 | if let Some(ty) = lt_finder.found { |
| 4084 | 4091 | if let TyKind::Path(None, path) = &ty.kind { |
| ... | ... | @@ -4098,6 +4105,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { |
| 4098 | 4105 | lt.span.with_hi(ty.span.hi()), |
| 4099 | 4106 | "String".to_string(), |
| 4100 | 4107 | )]; |
| 4108 | sugg_is_str_to_string = true; | |
| 4101 | 4109 | } |
| 4102 | 4110 | Some(Res::PrimTy(..)) => {} |
| 4103 | 4111 | Some(Res::Def( |
| ... | ... | @@ -4124,6 +4132,7 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { |
| 4124 | 4132 | lt.span.with_hi(ty.span.hi()), |
| 4125 | 4133 | "String".to_string(), |
| 4126 | 4134 | )]; |
| 4135 | sugg_is_str_to_string = true; | |
| 4127 | 4136 | } |
| 4128 | 4137 | Res::PrimTy(..) => {} |
| 4129 | 4138 | Res::Def( |
| ... | ... | @@ -4158,6 +4167,12 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { |
| 4158 | 4167 | } |
| 4159 | 4168 | } |
| 4160 | 4169 | if owned_sugg { |
| 4170 | if let Some(span) = | |
| 4171 | self.find_ref_prefix_span_for_owned_suggestion(lt.span) | |
| 4172 | && !sugg_is_str_to_string | |
| 4173 | { | |
| 4174 | sugg = vec![(span, String::new())]; | |
| 4175 | } | |
| 4161 | 4176 | err.multipart_suggestion_verbose( |
| 4162 | 4177 | format!("{pre} to return an owned value"), |
| 4163 | 4178 | sugg, |
| ... | ... | @@ -4184,6 +4199,23 @@ impl<'ast, 'ra, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { |
| 4184 | 4199 | } |
| 4185 | 4200 | } |
| 4186 | 4201 | } |
| 4202 | ||
| 4203 | fn find_ref_prefix_span_for_owned_suggestion(&self, lifetime: Span) -> Option<Span> { | |
| 4204 | let mut finder = RefPrefixSpanFinder { lifetime, span: None }; | |
| 4205 | if let Some(item) = self.diag_metadata.current_item { | |
| 4206 | finder.visit_item(item); | |
| 4207 | } else if let Some((kind, _span)) = self.diag_metadata.current_function | |
| 4208 | && let FnKind::Fn(_, _, ast::Fn { sig, .. }) = kind | |
| 4209 | { | |
| 4210 | for param in &sig.decl.inputs { | |
| 4211 | finder.visit_ty(&param.ty); | |
| 4212 | } | |
| 4213 | if let ast::FnRetTy::Ty(ret_ty) = &sig.decl.output { | |
| 4214 | finder.visit_ty(ret_ty); | |
| 4215 | } | |
| 4216 | } | |
| 4217 | finder.span | |
| 4218 | } | |
| 4187 | 4219 | } |
| 4188 | 4220 | |
| 4189 | 4221 | fn mk_where_bound_predicate( |
| ... | ... | @@ -4285,6 +4317,26 @@ impl<'ast> Visitor<'ast> for LifetimeFinder<'ast> { |
| 4285 | 4317 | } |
| 4286 | 4318 | } |
| 4287 | 4319 | |
| 4320 | struct RefPrefixSpanFinder { | |
| 4321 | lifetime: Span, | |
| 4322 | span: Option<Span>, | |
| 4323 | } | |
| 4324 | ||
| 4325 | impl<'ast> Visitor<'ast> for RefPrefixSpanFinder { | |
| 4326 | fn visit_ty(&mut self, t: &'ast Ty) { | |
| 4327 | if self.span.is_some() { | |
| 4328 | return; | |
| 4329 | } | |
| 4330 | if let TyKind::Ref(_, mut_ty) | TyKind::PinnedRef(_, mut_ty) = &t.kind | |
| 4331 | && t.span.lo() == self.lifetime.lo() | |
| 4332 | { | |
| 4333 | self.span = Some(t.span.with_hi(mut_ty.ty.span.lo())); | |
| 4334 | return; | |
| 4335 | } | |
| 4336 | walk_ty(self, t); | |
| 4337 | } | |
| 4338 | } | |
| 4339 | ||
| 4288 | 4340 | /// Shadowing involving a label is only a warning for historical reasons. |
| 4289 | 4341 | //FIXME: make this a proper lint. |
| 4290 | 4342 | pub(super) fn signal_label_shadowing(sess: &Session, orig: Span, shadower: Ident) { |
compiler/rustc_resolve/src/lib.rs+12-5| ... | ... | @@ -280,10 +280,11 @@ enum ResolutionError<'ra> { |
| 280 | 280 | SelfImportOnlyInImportListWithNonEmptyPrefix, |
| 281 | 281 | /// Error E0433: failed to resolve. |
| 282 | 282 | FailedToResolve { |
| 283 | segment: Option<Symbol>, | |
| 283 | segment: Symbol, | |
| 284 | 284 | label: String, |
| 285 | 285 | suggestion: Option<Suggestion>, |
| 286 | 286 | module: Option<ModuleOrUniformRoot<'ra>>, |
| 287 | message: String, | |
| 287 | 288 | }, |
| 288 | 289 | /// Error E0434: can't capture dynamic environment in a fn item. |
| 289 | 290 | CannotCaptureDynamicEnvironmentInFnItem, |
| ... | ... | @@ -342,7 +343,7 @@ enum ResolutionError<'ra> { |
| 342 | 343 | enum VisResolutionError<'a> { |
| 343 | 344 | Relative2018(Span, &'a ast::Path), |
| 344 | 345 | AncestorOnly(Span), |
| 345 | FailedToResolve(Span, String, Option<Suggestion>), | |
| 346 | FailedToResolve(Span, Symbol, String, Option<Suggestion>, String), | |
| 346 | 347 | ExpectedFound(Span, String, Res), |
| 347 | 348 | Indeterminate(Span), |
| 348 | 349 | ModuleOnly(Span), |
| ... | ... | @@ -486,6 +487,7 @@ enum PathResult<'ra> { |
| 486 | 487 | /// The segment name of target |
| 487 | 488 | segment_name: Symbol, |
| 488 | 489 | error_implied_by_parse_error: bool, |
| 490 | message: String, | |
| 489 | 491 | }, |
| 490 | 492 | } |
| 491 | 493 | |
| ... | ... | @@ -496,10 +498,14 @@ impl<'ra> PathResult<'ra> { |
| 496 | 498 | finalize: bool, |
| 497 | 499 | error_implied_by_parse_error: bool, |
| 498 | 500 | module: Option<ModuleOrUniformRoot<'ra>>, |
| 499 | label_and_suggestion: impl FnOnce() -> (String, Option<Suggestion>), | |
| 501 | label_and_suggestion: impl FnOnce() -> (String, String, Option<Suggestion>), | |
| 500 | 502 | ) -> PathResult<'ra> { |
| 501 | let (label, suggestion) = | |
| 502 | if finalize { label_and_suggestion() } else { (String::new(), None) }; | |
| 503 | let (message, label, suggestion) = if finalize { | |
| 504 | label_and_suggestion() | |
| 505 | } else { | |
| 506 | // FIXME: this output isn't actually present in the test suite. | |
| 507 | (format!("cannot find `{ident}` in this scope"), String::new(), None) | |
| 508 | }; | |
| 503 | 509 | PathResult::Failed { |
| 504 | 510 | span: ident.span, |
| 505 | 511 | segment_name: ident.name, |
| ... | ... | @@ -508,6 +514,7 @@ impl<'ra> PathResult<'ra> { |
| 508 | 514 | is_error_from_last_segment, |
| 509 | 515 | module, |
| 510 | 516 | error_implied_by_parse_error, |
| 517 | message, | |
| 511 | 518 | } |
| 512 | 519 | } |
| 513 | 520 | } |
compiler/rustc_resolve/src/macros.rs+37-11| ... | ... | @@ -908,10 +908,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 908 | 908 | ), |
| 909 | 909 | path_res @ (PathResult::NonModule(..) | PathResult::Failed { .. }) => { |
| 910 | 910 | let mut suggestion = None; |
| 911 | let (span, label, module, segment) = | |
| 912 | if let PathResult::Failed { span, label, module, segment_name, .. } = | |
| 913 | path_res | |
| 914 | { | |
| 911 | let (span, message, label, module, segment) = match path_res { | |
| 912 | PathResult::Failed { | |
| 913 | span, label, module, segment_name, message, .. | |
| 914 | } => { | |
| 915 | 915 | // try to suggest if it's not a macro, maybe a function |
| 916 | 916 | if let PathResult::NonModule(partial_res) = self |
| 917 | 917 | .cm() |
| ... | ... | @@ -930,26 +930,52 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 930 | 930 | Applicability::MaybeIncorrect, |
| 931 | 931 | )); |
| 932 | 932 | } |
| 933 | (span, label, module, segment_name) | |
| 934 | } else { | |
| 933 | (span, message, label, module, segment_name) | |
| 934 | } | |
| 935 | PathResult::NonModule(partial_res) => { | |
| 936 | let found_an = partial_res.base_res().article(); | |
| 937 | let found_descr = partial_res.base_res().descr(); | |
| 938 | let scope = match &path[..partial_res.unresolved_segments()] { | |
| 939 | [.., prev] => { | |
| 940 | format!("{found_descr} `{}`", prev.ident) | |
| 941 | } | |
| 942 | _ => found_descr.to_string(), | |
| 943 | }; | |
| 944 | let expected_an = kind.article(); | |
| 945 | let expected_descr = kind.descr(); | |
| 946 | let expected_name = path[partial_res.unresolved_segments()].ident; | |
| 947 | ||
| 935 | 948 | ( |
| 936 | 949 | path_span, |
| 937 | 950 | format!( |
| 938 | "partially resolved path in {} {}", | |
| 939 | kind.article(), | |
| 940 | kind.descr() | |
| 951 | "cannot find {expected_descr} `{expected_name}` in {scope}" | |
| 941 | 952 | ), |
| 953 | match partial_res.base_res() { | |
| 954 | Res::Def( | |
| 955 | DefKind::Mod | DefKind::Macro(..) | DefKind::ExternCrate, | |
| 956 | _, | |
| 957 | ) => format!( | |
| 958 | "partially resolved path in {expected_an} {expected_descr}", | |
| 959 | ), | |
| 960 | _ => format!( | |
| 961 | "{expected_an} {expected_descr} can't exist within \ | |
| 962 | {found_an} {found_descr}" | |
| 963 | ), | |
| 964 | }, | |
| 942 | 965 | None, |
| 943 | 966 | path.last().map(|segment| segment.ident.name).unwrap(), |
| 944 | 967 | ) |
| 945 | }; | |
| 968 | } | |
| 969 | _ => unreachable!(), | |
| 970 | }; | |
| 946 | 971 | self.report_error( |
| 947 | 972 | span, |
| 948 | 973 | ResolutionError::FailedToResolve { |
| 949 | segment: Some(segment), | |
| 974 | segment, | |
| 950 | 975 | label, |
| 951 | 976 | suggestion, |
| 952 | 977 | module, |
| 978 | message, | |
| 953 | 979 | }, |
| 954 | 980 | ); |
| 955 | 981 | } |
compiler/rustc_session/src/options.rs+3| ... | ... | @@ -2481,6 +2481,9 @@ options! { |
| 2481 | 2481 | mir_include_spans: MirIncludeSpans = (MirIncludeSpans::default(), parse_mir_include_spans, [UNTRACKED], |
| 2482 | 2482 | "include extra comments in mir pretty printing, like line numbers and statement indices, \ |
| 2483 | 2483 | details about types, etc. (boolean for all passes, 'nll' to enable in NLL MIR only, default: 'nll')"), |
| 2484 | mir_opt_bisect_limit: Option<usize> = (None, parse_opt_number, [TRACKED], | |
| 2485 | "limit the number of MIR optimization pass executions (global across all bodies). \ | |
| 2486 | Pass executions after this limit are skipped and reported. (default: no limit)"), | |
| 2484 | 2487 | #[rustc_lint_opt_deny_field_access("use `Session::mir_opt_level` instead of this field")] |
| 2485 | 2488 | mir_opt_level: Option<usize> = (None, parse_opt_number, [TRACKED], |
| 2486 | 2489 | "MIR optimization level (0-4; default: 1 in non optimized builds and 2 in optimized builds)"), |
compiler/rustc_session/src/session.rs+8-1| ... | ... | @@ -2,7 +2,7 @@ use std::any::Any; |
| 2 | 2 | use std::path::PathBuf; |
| 3 | 3 | use std::str::FromStr; |
| 4 | 4 | use std::sync::Arc; |
| 5 | use std::sync::atomic::AtomicBool; | |
| 5 | use std::sync::atomic::{AtomicBool, AtomicUsize}; | |
| 6 | 6 | use std::{env, io}; |
| 7 | 7 | |
| 8 | 8 | use rand::{RngCore, rng}; |
| ... | ... | @@ -161,6 +161,12 @@ pub struct Session { |
| 161 | 161 | |
| 162 | 162 | /// Does the codegen backend support ThinLTO? |
| 163 | 163 | pub thin_lto_supported: bool, |
| 164 | ||
| 165 | /// Global per-session counter for MIR optimization pass applications. | |
| 166 | /// | |
| 167 | /// Used by `-Zmir-opt-bisect-limit` to assign an index to each | |
| 168 | /// optimization-pass execution candidate during this compilation. | |
| 169 | pub mir_opt_bisect_eval_count: AtomicUsize, | |
| 164 | 170 | } |
| 165 | 171 | |
| 166 | 172 | #[derive(Clone, Copy)] |
| ... | ... | @@ -1101,6 +1107,7 @@ pub fn build_session( |
| 1101 | 1107 | invocation_temp, |
| 1102 | 1108 | replaced_intrinsics: FxHashSet::default(), // filled by `run_compiler` |
| 1103 | 1109 | thin_lto_supported: true, // filled by `run_compiler` |
| 1110 | mir_opt_bisect_eval_count: AtomicUsize::new(0), | |
| 1104 | 1111 | }; |
| 1105 | 1112 | |
| 1106 | 1113 | validate_commandline_args_with_session_available(&sess); |
compiler/rustc_span/src/symbol.rs-1| ... | ... | @@ -327,7 +327,6 @@ symbols! { |
| 327 | 327 | Pointer, |
| 328 | 328 | Poll, |
| 329 | 329 | ProcMacro, |
| 330 | ProceduralMasqueradeDummyType, | |
| 331 | 330 | Range, |
| 332 | 331 | RangeBounds, |
| 333 | 332 | RangeCopy, |
compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs+3| ... | ... | @@ -300,6 +300,9 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 300 | 300 | let rebased_args = alias.args.rebase_onto(tcx, trait_def_id, impl_substs); |
| 301 | 301 | |
| 302 | 302 | let impl_item_def_id = leaf_def.item.def_id; |
| 303 | if !tcx.check_args_compatible(impl_item_def_id, rebased_args) { | |
| 304 | return false; | |
| 305 | } | |
| 303 | 306 | let impl_assoc_ty = tcx.type_of(impl_item_def_id).instantiate(tcx, rebased_args); |
| 304 | 307 | |
| 305 | 308 | self.infcx.can_eq(param_env, impl_assoc_ty, concrete) |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/trait_impl_difference.rs+117-3| ... | ... | @@ -11,7 +11,7 @@ use rustc_middle::traits::ObligationCauseCode; |
| 11 | 11 | use rustc_middle::ty::error::ExpectedFound; |
| 12 | 12 | use rustc_middle::ty::print::RegionHighlightMode; |
| 13 | 13 | use rustc_middle::ty::{self, TyCtxt, TypeVisitable}; |
| 14 | use rustc_span::Span; | |
| 14 | use rustc_span::{Ident, Span}; | |
| 15 | 15 | use tracing::debug; |
| 16 | 16 | |
| 17 | 17 | use crate::error_reporting::infer::nice_region_error::NiceRegionError; |
| ... | ... | @@ -99,7 +99,8 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { |
| 99 | 99 | |
| 100 | 100 | // Get the span of all the used type parameters in the method. |
| 101 | 101 | let assoc_item = self.tcx().associated_item(trait_item_def_id); |
| 102 | let mut visitor = TypeParamSpanVisitor { tcx: self.tcx(), types: vec![] }; | |
| 102 | let mut visitor = | |
| 103 | TypeParamSpanVisitor { tcx: self.tcx(), types: vec![], elided_lifetime_paths: vec![] }; | |
| 103 | 104 | match assoc_item.kind { |
| 104 | 105 | ty::AssocKind::Fn { .. } => { |
| 105 | 106 | if let Some(hir_id) = |
| ... | ... | @@ -122,13 +123,49 @@ impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { |
| 122 | 123 | found, |
| 123 | 124 | }; |
| 124 | 125 | |
| 125 | self.tcx().dcx().emit_err(diag) | |
| 126 | let mut diag = self.tcx().dcx().create_err(diag); | |
| 127 | // A limit not to make diag verbose. | |
| 128 | const ELIDED_LIFETIME_NOTE_LIMIT: usize = 5; | |
| 129 | let elided_lifetime_paths = visitor.elided_lifetime_paths; | |
| 130 | let total_elided_lifetime_paths = elided_lifetime_paths.len(); | |
| 131 | let shown_elided_lifetime_paths = if tcx.sess.opts.verbose { | |
| 132 | total_elided_lifetime_paths | |
| 133 | } else { | |
| 134 | ELIDED_LIFETIME_NOTE_LIMIT | |
| 135 | }; | |
| 136 | ||
| 137 | for elided in elided_lifetime_paths.into_iter().take(shown_elided_lifetime_paths) { | |
| 138 | diag.span_note( | |
| 139 | elided.span, | |
| 140 | format!("`{}` here is elided as `{}`", elided.ident, elided.shorthand), | |
| 141 | ); | |
| 142 | } | |
| 143 | if total_elided_lifetime_paths > shown_elided_lifetime_paths { | |
| 144 | diag.note(format!( | |
| 145 | "and {} more elided lifetime{} in type paths", | |
| 146 | total_elided_lifetime_paths - shown_elided_lifetime_paths, | |
| 147 | if total_elided_lifetime_paths - shown_elided_lifetime_paths == 1 { | |
| 148 | "" | |
| 149 | } else { | |
| 150 | "s" | |
| 151 | }, | |
| 152 | )); | |
| 153 | } | |
| 154 | diag.emit() | |
| 126 | 155 | } |
| 127 | 156 | } |
| 128 | 157 | |
| 158 | #[derive(Clone)] | |
| 159 | struct ElidedLifetimeInPath { | |
| 160 | span: Span, | |
| 161 | ident: Ident, | |
| 162 | shorthand: String, | |
| 163 | } | |
| 164 | ||
| 129 | 165 | struct TypeParamSpanVisitor<'tcx> { |
| 130 | 166 | tcx: TyCtxt<'tcx>, |
| 131 | 167 | types: Vec<Span>, |
| 168 | elided_lifetime_paths: Vec<ElidedLifetimeInPath>, | |
| 132 | 169 | } |
| 133 | 170 | |
| 134 | 171 | impl<'tcx> Visitor<'tcx> for TypeParamSpanVisitor<'tcx> { |
| ... | ... | @@ -138,6 +175,83 @@ impl<'tcx> Visitor<'tcx> for TypeParamSpanVisitor<'tcx> { |
| 138 | 175 | self.tcx |
| 139 | 176 | } |
| 140 | 177 | |
| 178 | fn visit_qpath(&mut self, qpath: &'tcx hir::QPath<'tcx>, id: hir::HirId, _span: Span) { | |
| 179 | fn record_elided_lifetimes( | |
| 180 | tcx: TyCtxt<'_>, | |
| 181 | elided_lifetime_paths: &mut Vec<ElidedLifetimeInPath>, | |
| 182 | segment: &hir::PathSegment<'_>, | |
| 183 | ) { | |
| 184 | let Some(args) = segment.args else { return }; | |
| 185 | if args.parenthesized != hir::GenericArgsParentheses::No { | |
| 186 | // Our diagnostic rendering below uses `<...>` syntax; skip cases like `Fn(..) -> ..`. | |
| 187 | return; | |
| 188 | } | |
| 189 | let elided_count = args | |
| 190 | .args | |
| 191 | .iter() | |
| 192 | .filter(|arg| { | |
| 193 | let hir::GenericArg::Lifetime(l) = arg else { return false }; | |
| 194 | l.syntax == hir::LifetimeSyntax::Implicit | |
| 195 | && matches!(l.source, hir::LifetimeSource::Path { .. }) | |
| 196 | }) | |
| 197 | .count(); | |
| 198 | if elided_count == 0 | |
| 199 | || elided_lifetime_paths.iter().any(|p| p.span == segment.ident.span) | |
| 200 | { | |
| 201 | return; | |
| 202 | } | |
| 203 | ||
| 204 | let sm = tcx.sess.source_map(); | |
| 205 | let mut parts = args | |
| 206 | .args | |
| 207 | .iter() | |
| 208 | .map(|arg| match arg { | |
| 209 | hir::GenericArg::Lifetime(l) => { | |
| 210 | if l.syntax == hir::LifetimeSyntax::Implicit | |
| 211 | && matches!(l.source, hir::LifetimeSource::Path { .. }) | |
| 212 | { | |
| 213 | "'_".to_string() | |
| 214 | } else { | |
| 215 | sm.span_to_snippet(l.ident.span) | |
| 216 | .unwrap_or_else(|_| format!("'{}", l.ident.name)) | |
| 217 | } | |
| 218 | } | |
| 219 | hir::GenericArg::Type(ty) => { | |
| 220 | sm.span_to_snippet(ty.span).unwrap_or_else(|_| "..".to_string()) | |
| 221 | } | |
| 222 | hir::GenericArg::Const(ct) => { | |
| 223 | sm.span_to_snippet(ct.span).unwrap_or_else(|_| "..".to_string()) | |
| 224 | } | |
| 225 | hir::GenericArg::Infer(_) => "_".to_string(), | |
| 226 | }) | |
| 227 | .collect::<Vec<_>>(); | |
| 228 | parts.extend(args.constraints.iter().map(|constraint| { | |
| 229 | sm.span_to_snippet(constraint.span) | |
| 230 | .unwrap_or_else(|_| format!("{} = ..", constraint.ident)) | |
| 231 | })); | |
| 232 | let shorthand = format!("{}<{}>", segment.ident, parts.join(", ")); | |
| 233 | ||
| 234 | elided_lifetime_paths.push(ElidedLifetimeInPath { | |
| 235 | span: segment.ident.span, | |
| 236 | ident: segment.ident, | |
| 237 | shorthand, | |
| 238 | }); | |
| 239 | } | |
| 240 | ||
| 241 | match qpath { | |
| 242 | hir::QPath::Resolved(_, path) => { | |
| 243 | for segment in path.segments { | |
| 244 | record_elided_lifetimes(self.tcx, &mut self.elided_lifetime_paths, segment); | |
| 245 | } | |
| 246 | } | |
| 247 | hir::QPath::TypeRelative(_, segment) => { | |
| 248 | record_elided_lifetimes(self.tcx, &mut self.elided_lifetime_paths, segment); | |
| 249 | } | |
| 250 | } | |
| 251 | ||
| 252 | hir::intravisit::walk_qpath(self, qpath, id); | |
| 253 | } | |
| 254 | ||
| 141 | 255 | fn visit_ty(&mut self, arg: &'tcx hir::Ty<'tcx, AmbigArg>) { |
| 142 | 256 | match arg.kind { |
| 143 | 257 | hir::TyKind::Ref(_, ref mut_ty) => { |
library/alloc/src/lib.rs-1| ... | ... | @@ -182,7 +182,6 @@ |
| 182 | 182 | #![feature(negative_impls)] |
| 183 | 183 | #![feature(never_type)] |
| 184 | 184 | #![feature(optimize_attribute)] |
| 185 | #![feature(rustc_allow_const_fn_unstable)] | |
| 186 | 185 | #![feature(rustc_attrs)] |
| 187 | 186 | #![feature(slice_internals)] |
| 188 | 187 | #![feature(staged_api)] |
library/core/src/lib.rs-1| ... | ... | @@ -159,7 +159,6 @@ |
| 159 | 159 | #![feature(pattern_types)] |
| 160 | 160 | #![feature(prelude_import)] |
| 161 | 161 | #![feature(repr_simd)] |
| 162 | #![feature(rustc_allow_const_fn_unstable)] | |
| 163 | 162 | #![feature(rustc_attrs)] |
| 164 | 163 | #![feature(rustdoc_internals)] |
| 165 | 164 | #![feature(simd_ffi)] |
library/core/src/num/int_macros.rs+10-2| ... | ... | @@ -2481,7 +2481,8 @@ macro_rules! int_impl { |
| 2481 | 2481 | /// |
| 2482 | 2482 | /// Returns a tuple of the addition along with a boolean indicating |
| 2483 | 2483 | /// whether an arithmetic overflow would occur. If an overflow would have |
| 2484 | /// occurred then the wrapped value is returned. | |
| 2484 | /// occurred then the wrapped value is returned (negative if overflowed | |
| 2485 | /// above [`MAX`](Self::MAX), non-negative if below [`MIN`](Self::MIN)). | |
| 2485 | 2486 | /// |
| 2486 | 2487 | /// # Examples |
| 2487 | 2488 | /// |
| ... | ... | @@ -2516,6 +2517,9 @@ macro_rules! int_impl { |
| 2516 | 2517 | /// The output boolean returned by this method is *not* a carry flag, |
| 2517 | 2518 | /// and should *not* be added to a more significant word. |
| 2518 | 2519 | /// |
| 2520 | /// If overflow occurred, the wrapped value is returned (negative if overflowed | |
| 2521 | /// above [`MAX`](Self::MAX), non-negative if below [`MIN`](Self::MIN)). | |
| 2522 | /// | |
| 2519 | 2523 | /// If the input carry is false, this method is equivalent to |
| 2520 | 2524 | /// [`overflowing_add`](Self::overflowing_add). |
| 2521 | 2525 | /// |
| ... | ... | @@ -2583,7 +2587,8 @@ macro_rules! int_impl { |
| 2583 | 2587 | /// Calculates `self` - `rhs`. |
| 2584 | 2588 | /// |
| 2585 | 2589 | /// Returns a tuple of the subtraction along with a boolean indicating whether an arithmetic overflow |
| 2586 | /// would occur. If an overflow would have occurred then the wrapped value is returned. | |
| 2590 | /// would occur. If an overflow would have occurred then the wrapped value is returned | |
| 2591 | /// (negative if overflowed above [`MAX`](Self::MAX), non-negative if below [`MIN`](Self::MIN)). | |
| 2587 | 2592 | /// |
| 2588 | 2593 | /// # Examples |
| 2589 | 2594 | /// |
| ... | ... | @@ -2619,6 +2624,9 @@ macro_rules! int_impl { |
| 2619 | 2624 | /// The output boolean returned by this method is *not* a borrow flag, |
| 2620 | 2625 | /// and should *not* be subtracted from a more significant word. |
| 2621 | 2626 | /// |
| 2627 | /// If overflow occurred, the wrapped value is returned (negative if overflowed | |
| 2628 | /// above [`MAX`](Self::MAX), non-negative if below [`MIN`](Self::MIN)). | |
| 2629 | /// | |
| 2622 | 2630 | /// If the input borrow is false, this method is equivalent to |
| 2623 | 2631 | /// [`overflowing_sub`](Self::overflowing_sub). |
| 2624 | 2632 | /// |
library/core/src/num/uint_macros.rs+2-2| ... | ... | @@ -487,8 +487,8 @@ macro_rules! uint_impl { |
| 487 | 487 | |
| 488 | 488 | /// Performs a carry-less multiplication, returning the lower bits. |
| 489 | 489 | /// |
| 490 | /// This operation is similar to long multiplication, except that exclusive or is used | |
| 491 | /// instead of addition. The implementation is equivalent to: | |
| 490 | /// This operation is similar to long multiplication in base 2, except that exclusive or is | |
| 491 | /// used instead of addition. The implementation is equivalent to: | |
| 492 | 492 | /// |
| 493 | 493 | /// ```no_run |
| 494 | 494 | #[doc = concat!("pub fn carryless_mul(lhs: ", stringify!($SelfT), ", rhs: ", stringify!($SelfT), ") -> ", stringify!($SelfT), "{")] |
library/std/src/sys/args/unix.rs+3-9| ... | ... | @@ -164,7 +164,7 @@ mod imp { |
| 164 | 164 | // of this used `[[NSProcessInfo processInfo] arguments]`. |
| 165 | 165 | #[cfg(target_vendor = "apple")] |
| 166 | 166 | mod imp { |
| 167 | use crate::ffi::{c_char, c_int}; | |
| 167 | use crate::ffi::c_char; | |
| 168 | 168 | |
| 169 | 169 | pub unsafe fn init(_argc: isize, _argv: *const *const u8) { |
| 170 | 170 | // No need to initialize anything in here, `libdyld.dylib` has already |
| ... | ... | @@ -172,12 +172,6 @@ mod imp { |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | pub fn argc_argv() -> (isize, *const *const c_char) { |
| 175 | unsafe extern "C" { | |
| 176 | // These functions are in crt_externs.h. | |
| 177 | fn _NSGetArgc() -> *mut c_int; | |
| 178 | fn _NSGetArgv() -> *mut *mut *mut c_char; | |
| 179 | } | |
| 180 | ||
| 181 | 175 | // SAFETY: The returned pointer points to a static initialized early |
| 182 | 176 | // in the program lifetime by `libdyld.dylib`, and as such is always |
| 183 | 177 | // valid. |
| ... | ... | @@ -187,9 +181,9 @@ mod imp { |
| 187 | 181 | // doesn't exist a lock that we can take. Instead, it is generally |
| 188 | 182 | // expected that it's only modified in `main` / before other code |
| 189 | 183 | // runs, so reading this here should be fine. |
| 190 | let argc = unsafe { _NSGetArgc().read() }; | |
| 184 | let argc = unsafe { libc::_NSGetArgc().read() }; | |
| 191 | 185 | // SAFETY: Same as above. |
| 192 | let argv = unsafe { _NSGetArgv().read() }; | |
| 186 | let argv = unsafe { libc::_NSGetArgv().read() }; | |
| 193 | 187 | |
| 194 | 188 | // Cast from `*mut *mut c_char` to `*const *const c_char` |
| 195 | 189 | (argc as isize, argv.cast()) |
src/doc/rustc/src/lints/levels.md+1-1| ... | ... | @@ -393,7 +393,7 @@ Here’s how these different lint controls interact: |
| 393 | 393 | warning: 1 warning emitted |
| 394 | 394 | ``` |
| 395 | 395 | |
| 396 | 3. [CLI level flags](#via-compiler-flag) take precedence over attributes. | |
| 396 | 3. [CLI level flags](#via-compiler-flag) override the default level of a lint. They essentially behave like crate-level attributes. Attributes within the source code take precedence over CLI flags, except for `-F`/`--forbid`, which cannot be overridden. | |
| 397 | 397 | |
| 398 | 398 | The order of the flags matter; flags on the right take precedence over earlier flags. |
| 399 | 399 |
src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs-1| ... | ... | @@ -194,7 +194,6 @@ fn check_rvalue<'tcx>( |
| 194 | 194 | )) |
| 195 | 195 | } |
| 196 | 196 | }, |
| 197 | Rvalue::ShallowInitBox(_, _) => Ok(()), | |
| 198 | 197 | Rvalue::UnaryOp(_, operand) => { |
| 199 | 198 | let ty = operand.ty(body, cx.tcx); |
| 200 | 199 | if ty.is_integral() || ty.is_bool() { |
src/tools/clippy/tests/ui/crashes/unreachable-array-or-slice.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ struct Foo(isize, isize, isize, isize); |
| 2 | 2 | |
| 3 | 3 | pub fn main() { |
| 4 | 4 | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5); |
| 5 | //~^ ERROR: failed to resolve | |
| 5 | //~^ ERROR: cannot find `Self` in this scope | |
| 6 | 6 | match [5, 5, 5, 5] { |
| 7 | 7 | [..] => {}, |
| 8 | 8 | } |
src/tools/clippy/tests/ui/crashes/unreachable-array-or-slice.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 1 | error[E0433]: cannot find `Self` in this scope | |
| 2 | 2 | --> tests/ui/crashes/unreachable-array-or-slice.rs:4:9 |
| 3 | 3 | | |
| 4 | 4 | LL | let Self::anything_here_kills_it(a, b, ..) = Foo(5, 5, 5, 5); |
src/tools/miri/src/concurrency/thread.rs+1-1| ... | ... | @@ -343,8 +343,8 @@ impl VisitProvenance for Thread<'_> { |
| 343 | 343 | |
| 344 | 344 | impl VisitProvenance for Frame<'_, Provenance, FrameExtra<'_>> { |
| 345 | 345 | fn visit_provenance(&self, visit: &mut VisitWith<'_>) { |
| 346 | let return_place = self.return_place(); | |
| 346 | 347 | let Frame { |
| 347 | return_place, | |
| 348 | 348 | locals, |
| 349 | 349 | extra, |
| 350 | 350 | // There are some private fields we cannot access; they contain no tags. |
src/tools/miri/src/diagnostics.rs+1-1| ... | ... | @@ -493,7 +493,7 @@ pub fn report_result<'tcx>( |
| 493 | 493 | for (i, frame) in ecx.active_thread_stack().iter().enumerate() { |
| 494 | 494 | trace!("-------------------"); |
| 495 | 495 | trace!("Frame {}", i); |
| 496 | trace!(" return: {:?}", frame.return_place); | |
| 496 | trace!(" return: {:?}", frame.return_place()); | |
| 497 | 497 | for (i, local) in frame.locals.iter().enumerate() { |
| 498 | 498 | trace!(" local {}: {:?}", i, local); |
| 499 | 499 | } |
src/tools/miri/src/machine.rs+2-2| ... | ... | @@ -1235,7 +1235,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> { |
| 1235 | 1235 | // to run extra MIR), and Ok(Some(body)) if we found MIR to run for the |
| 1236 | 1236 | // foreign function |
| 1237 | 1237 | // Any needed call to `goto_block` will be performed by `emulate_foreign_item`. |
| 1238 | let args = ecx.copy_fn_args(args); // FIXME: Should `InPlace` arguments be reset to uninit? | |
| 1238 | let args = MiriInterpCx::copy_fn_args(args); // FIXME: Should `InPlace` arguments be reset to uninit? | |
| 1239 | 1239 | let link_name = Symbol::intern(ecx.tcx.symbol_name(instance).name); |
| 1240 | 1240 | return ecx.emulate_foreign_item(link_name, abi, &args, dest, ret, unwind); |
| 1241 | 1241 | } |
| ... | ... | @@ -1262,7 +1262,7 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> { |
| 1262 | 1262 | ret: Option<mir::BasicBlock>, |
| 1263 | 1263 | unwind: mir::UnwindAction, |
| 1264 | 1264 | ) -> InterpResult<'tcx> { |
| 1265 | let args = ecx.copy_fn_args(args); // FIXME: Should `InPlace` arguments be reset to uninit? | |
| 1265 | let args = MiriInterpCx::copy_fn_args(args); // FIXME: Should `InPlace` arguments be reset to uninit? | |
| 1266 | 1266 | ecx.emulate_dyn_sym(fn_val, abi, &args, dest, ret, unwind) |
| 1267 | 1267 | } |
| 1268 | 1268 |
src/tools/miri/tests/fail/rustc-error2.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ struct Struct<T>(T); |
| 4 | 4 | impl<T> std::ops::Deref for Struct<T> { |
| 5 | 5 | type Target = dyn Fn(T); |
| 6 | 6 | fn deref(&self) -> &assert_mem_uninitialized_valid::Target { |
| 7 | //~^ERROR: use of unresolved module or unlinked crate | |
| 7 | //~^ERROR: cannot find module or crate `assert_mem_uninitialized_valid` in this scope | |
| 8 | 8 | unimplemented!() |
| 9 | 9 | } |
| 10 | 10 | } |
src/tools/miri/tests/fail/rustc-error2.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `assert_mem_uninitialized_valid` | |
| 1 | error[E0433]: cannot find module or crate `assert_mem_uninitialized_valid` in this scope | |
| 2 | 2 | --> tests/fail/rustc-error2.rs:LL:CC |
| 3 | 3 | | |
| 4 | 4 | LL | fn deref(&self) -> &assert_mem_uninitialized_valid::Target { |
src/tools/miri/tests/fail/tail_calls/dangling-local-var.stderr+2-2| ... | ... | @@ -14,8 +14,8 @@ LL | let local = 0; |
| 14 | 14 | help: ALLOC was deallocated here: |
| 15 | 15 | --> tests/fail/tail_calls/dangling-local-var.rs:LL:CC |
| 16 | 16 | | |
| 17 | LL | f(std::ptr::null()); | |
| 18 | | ^^^^^^^^^^^^^^^^^^^ | |
| 17 | LL | let _val = unsafe { *x }; | |
| 18 | | ^^^^ | |
| 19 | 19 | = note: stack backtrace: |
| 20 | 20 | 0: g |
| 21 | 21 | at tests/fail/tail_calls/dangling-local-var.rs:LL:CC |
src/tools/miri/tests/fail/validity/recursive-validity-box-bool.rs created+8| ... | ... | @@ -0,0 +1,8 @@ |
| 1 | //@compile-flags: -Zmiri-recursive-validation | |
| 2 | ||
| 3 | fn main() { | |
| 4 | let x = 3u8; | |
| 5 | let xref = &x; | |
| 6 | let xref_wrong_type: Box<bool> = unsafe { std::mem::transmute(xref) }; //~ERROR: encountered 0x03, but expected a boolean | |
| 7 | let _val = *xref_wrong_type; | |
| 8 | } |
src/tools/miri/tests/fail/validity/recursive-validity-box-bool.stderr created+13| ... | ... | @@ -0,0 +1,13 @@ |
| 1 | error: Undefined Behavior: constructing invalid value at .<deref>: encountered 0x03, but expected a boolean | |
| 2 | --> tests/fail/validity/recursive-validity-box-bool.rs:LL:CC | |
| 3 | | | |
| 4 | LL | let xref_wrong_type: Box<bool> = unsafe { std::mem::transmute(xref) }; | |
| 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ Undefined Behavior occurred here | |
| 6 | | | |
| 7 | = help: this indicates a bug in the program: it performed an invalid operation, and caused Undefined Behavior | |
| 8 | = help: see https://doc.rust-lang.org/nightly/reference/behavior-considered-undefined.html for further information | |
| 9 | ||
| 10 | note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace | |
| 11 | ||
| 12 | error: aborting due to 1 previous error | |
| 13 |
src/tools/miri/tests/pass/function_calls/tail_call.rs created+51| ... | ... | @@ -0,0 +1,51 @@ |
| 1 | #![allow(incomplete_features)] | |
| 2 | #![feature(explicit_tail_calls)] | |
| 3 | ||
| 4 | fn main() { | |
| 5 | assert_eq!(factorial(10), 3_628_800); | |
| 6 | assert_eq!(mutually_recursive_identity(1000), 1000); | |
| 7 | non_scalar(); | |
| 8 | } | |
| 9 | ||
| 10 | fn factorial(n: u32) -> u32 { | |
| 11 | fn factorial_acc(n: u32, acc: u32) -> u32 { | |
| 12 | match n { | |
| 13 | 0 => acc, | |
| 14 | _ => become factorial_acc(n - 1, acc * n), | |
| 15 | } | |
| 16 | } | |
| 17 | ||
| 18 | factorial_acc(n, 1) | |
| 19 | } | |
| 20 | ||
| 21 | // this is of course very silly, but we need to demonstrate mutual recursion somehow so... | |
| 22 | fn mutually_recursive_identity(x: u32) -> u32 { | |
| 23 | fn switch(src: u32, tgt: u32) -> u32 { | |
| 24 | match src { | |
| 25 | 0 => tgt, | |
| 26 | _ if src % 7 == 0 => become advance_with_extra_steps(src, tgt), | |
| 27 | _ => become advance(src, tgt), | |
| 28 | } | |
| 29 | } | |
| 30 | ||
| 31 | fn advance(src: u32, tgt: u32) -> u32 { | |
| 32 | become switch(src - 1, tgt + 1) | |
| 33 | } | |
| 34 | ||
| 35 | fn advance_with_extra_steps(src: u32, tgt: u32) -> u32 { | |
| 36 | become advance(src, tgt) | |
| 37 | } | |
| 38 | ||
| 39 | switch(x, 0) | |
| 40 | } | |
| 41 | ||
| 42 | fn non_scalar() { | |
| 43 | fn f(x: [usize; 2], i: u32) { | |
| 44 | if i == 0 { | |
| 45 | return; | |
| 46 | } | |
| 47 | become f(x, i - 1); | |
| 48 | } | |
| 49 | ||
| 50 | f([5, 5], 2); | |
| 51 | } |
src/tools/miri/tests/pass/tail_call.rs deleted-39| ... | ... | @@ -1,39 +0,0 @@ |
| 1 | #![allow(incomplete_features)] | |
| 2 | #![feature(explicit_tail_calls)] | |
| 3 | ||
| 4 | fn main() { | |
| 5 | assert_eq!(factorial(10), 3_628_800); | |
| 6 | assert_eq!(mutually_recursive_identity(1000), 1000); | |
| 7 | } | |
| 8 | ||
| 9 | fn factorial(n: u32) -> u32 { | |
| 10 | fn factorial_acc(n: u32, acc: u32) -> u32 { | |
| 11 | match n { | |
| 12 | 0 => acc, | |
| 13 | _ => become factorial_acc(n - 1, acc * n), | |
| 14 | } | |
| 15 | } | |
| 16 | ||
| 17 | factorial_acc(n, 1) | |
| 18 | } | |
| 19 | ||
| 20 | // this is of course very silly, but we need to demonstrate mutual recursion somehow so... | |
| 21 | fn mutually_recursive_identity(x: u32) -> u32 { | |
| 22 | fn switch(src: u32, tgt: u32) -> u32 { | |
| 23 | match src { | |
| 24 | 0 => tgt, | |
| 25 | _ if src % 7 == 0 => become advance_with_extra_steps(src, tgt), | |
| 26 | _ => become advance(src, tgt), | |
| 27 | } | |
| 28 | } | |
| 29 | ||
| 30 | fn advance(src: u32, tgt: u32) -> u32 { | |
| 31 | become switch(src - 1, tgt + 1) | |
| 32 | } | |
| 33 | ||
| 34 | fn advance_with_extra_steps(src: u32, tgt: u32) -> u32 { | |
| 35 | become advance(src, tgt) | |
| 36 | } | |
| 37 | ||
| 38 | switch(x, 0) | |
| 39 | } |
tests/codegen-llvm/intrinsics/likely_assert.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | //@ compile-flags: -Copt-level=3 |
| 2 | #![feature(panic_internals, const_eval_select, rustc_allow_const_fn_unstable, core_intrinsics)] | |
| 2 | #![feature(panic_internals, const_eval_select, rustc_attrs, core_intrinsics)] | |
| 3 | 3 | #![crate_type = "lib"] |
| 4 | 4 | |
| 5 | 5 | // check that assert! and const_assert! emit branch weights |
tests/mir-opt/optimize_none.rs+4-3| ... | ... | @@ -15,13 +15,14 @@ pub fn add_noopt() -> i32 { |
| 15 | 15 | #[optimize(none)] |
| 16 | 16 | pub fn const_branch() -> i32 { |
| 17 | 17 | // CHECK-LABEL: fn const_branch( |
| 18 | // CHECK: switchInt(const true) -> [0: [[FALSE:bb[0-9]+]], otherwise: [[TRUE:bb[0-9]+]]]; | |
| 18 | // CHECK: [[BOOL:_[0-9]+]] = const true; | |
| 19 | // CHECK: switchInt(move [[BOOL]]) -> [0: [[BB_FALSE:bb[0-9]+]], otherwise: [[BB_TRUE:bb[0-9]+]]]; | |
| 19 | 20 | // CHECK-NEXT: } |
| 20 | // CHECK: [[FALSE]]: { | |
| 21 | // CHECK: [[BB_FALSE]]: { | |
| 21 | 22 | // CHECK-NEXT: _0 = const 0 |
| 22 | 23 | // CHECK-NEXT: goto |
| 23 | 24 | // CHECK-NEXT: } |
| 24 | // CHECK: [[TRUE]]: { | |
| 25 | // CHECK: [[BB_TRUE]]: { | |
| 25 | 26 | // CHECK-NEXT: _0 = const 1 |
| 26 | 27 | // CHECK-NEXT: goto |
| 27 | 28 | // CHECK-NEXT: } |
tests/run-make/issue-149402-suggest-unresolve/nightly.err+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `Complete` | |
| 1 | error[E0433]: cannot find type `Complete` in this scope | |
| 2 | 2 | --> foo.rs:3:12 |
| 3 | 3 | | |
| 4 | 4 | 3 | x.push(Complete::Item { name: "hello" }); |
tests/run-make/issue-149402-suggest-unresolve/stable.err+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `Complete` | |
| 1 | error[E0433]: cannot find type `Complete` in this scope | |
| 2 | 2 | --> foo.rs:3:12 |
| 3 | 3 | | |
| 4 | 4 | 3 | x.push(Complete::Item { name: "hello" }); |
tests/run-make/mir-opt-bisect-limit/main.rs created+11| ... | ... | @@ -0,0 +1,11 @@ |
| 1 | #![crate_type = "lib"] | |
| 2 | #![no_std] | |
| 3 | ||
| 4 | #[inline(never)] | |
| 5 | pub fn callee(x: u64) -> u64 { | |
| 6 | x.wrapping_mul(3).wrapping_add(7) | |
| 7 | } | |
| 8 | ||
| 9 | pub fn caller(a: u64, b: u64) -> u64 { | |
| 10 | callee(a) + callee(b) | |
| 11 | } |
tests/run-make/mir-opt-bisect-limit/rmake.rs created+119| ... | ... | @@ -0,0 +1,119 @@ |
| 1 | use std::path::Path; | |
| 2 | ||
| 3 | use run_make_support::{CompletedProcess, rfs, rustc}; | |
| 4 | ||
| 5 | struct Case { | |
| 6 | name: &'static str, | |
| 7 | flags: &'static [&'static str], | |
| 8 | expect_inline_dump: bool, | |
| 9 | expect_running: ExpectedCount, | |
| 10 | expect_not_running: ExpectedCount, | |
| 11 | } | |
| 12 | ||
| 13 | enum ExpectedCount { | |
| 14 | Exactly(usize), | |
| 15 | AtLeastOne, | |
| 16 | Zero, | |
| 17 | } | |
| 18 | ||
| 19 | fn main() { | |
| 20 | let cases = [ | |
| 21 | Case { | |
| 22 | name: "limit0", | |
| 23 | flags: &["-Zmir-opt-bisect-limit=0"], | |
| 24 | expect_inline_dump: false, | |
| 25 | expect_running: ExpectedCount::Exactly(0), | |
| 26 | expect_not_running: ExpectedCount::AtLeastOne, | |
| 27 | }, | |
| 28 | Case { | |
| 29 | name: "limit1", | |
| 30 | flags: &["-Zmir-opt-bisect-limit=1"], | |
| 31 | expect_inline_dump: false, | |
| 32 | expect_running: ExpectedCount::Exactly(1), | |
| 33 | expect_not_running: ExpectedCount::AtLeastOne, | |
| 34 | }, | |
| 35 | Case { | |
| 36 | name: "huge_limit", | |
| 37 | flags: &["-Zmir-opt-bisect-limit=1000000000"], | |
| 38 | expect_inline_dump: true, | |
| 39 | expect_running: ExpectedCount::AtLeastOne, | |
| 40 | expect_not_running: ExpectedCount::Zero, | |
| 41 | }, | |
| 42 | Case { | |
| 43 | name: "limit0_with_force_enable_inline", | |
| 44 | flags: &["-Zmir-opt-bisect-limit=0", "-Zmir-enable-passes=+Inline"], | |
| 45 | expect_inline_dump: false, | |
| 46 | expect_running: ExpectedCount::Exactly(0), | |
| 47 | expect_not_running: ExpectedCount::AtLeastOne, | |
| 48 | }, | |
| 49 | ]; | |
| 50 | ||
| 51 | for case in cases { | |
| 52 | let (inline_dumped, running_count, not_running_count, output) = | |
| 53 | compile_case(case.name, case.flags); | |
| 54 | ||
| 55 | assert_eq!( | |
| 56 | inline_dumped, case.expect_inline_dump, | |
| 57 | "{}: unexpected Inline dump presence", | |
| 58 | case.name | |
| 59 | ); | |
| 60 | ||
| 61 | assert_expected_count( | |
| 62 | running_count, | |
| 63 | case.expect_running, | |
| 64 | &format!("{}: running count", case.name), | |
| 65 | ); | |
| 66 | assert_expected_count( | |
| 67 | not_running_count, | |
| 68 | case.expect_not_running, | |
| 69 | &format!("{}: NOT running count", case.name), | |
| 70 | ); | |
| 71 | } | |
| 72 | } | |
| 73 | ||
| 74 | fn compile_case(dump_dir: &str, extra_flags: &[&str]) -> (bool, usize, usize, CompletedProcess) { | |
| 75 | if Path::new(dump_dir).exists() { | |
| 76 | rfs::remove_dir_all(dump_dir); | |
| 77 | } | |
| 78 | rfs::create_dir_all(dump_dir); | |
| 79 | ||
| 80 | let mut cmd = rustc(); | |
| 81 | cmd.input("main.rs") | |
| 82 | .arg("--emit=mir") | |
| 83 | .arg("-Zmir-opt-level=2") | |
| 84 | .arg("-Copt-level=2") | |
| 85 | .arg("-Zthreads=1") | |
| 86 | .arg("-Zdump-mir=Inline") | |
| 87 | .arg(format!("-Zdump-mir-dir={dump_dir}")); | |
| 88 | ||
| 89 | for &flag in extra_flags { | |
| 90 | cmd.arg(flag); | |
| 91 | } | |
| 92 | ||
| 93 | let output = cmd.run(); | |
| 94 | let (running_count, not_running_count) = bisect_line_counts(&output); | |
| 95 | (has_inline_dump_file(dump_dir), running_count, not_running_count, output) | |
| 96 | } | |
| 97 | ||
| 98 | fn assert_expected_count(actual: usize, expected: ExpectedCount, context: &str) { | |
| 99 | match expected { | |
| 100 | ExpectedCount::Exactly(n) => assert_eq!(actual, n, "{context}"), | |
| 101 | ExpectedCount::AtLeastOne => assert!(actual > 0, "{context}"), | |
| 102 | ExpectedCount::Zero => assert_eq!(actual, 0, "{context}"), | |
| 103 | } | |
| 104 | } | |
| 105 | ||
| 106 | fn has_inline_dump_file(dir: &str) -> bool { | |
| 107 | rfs::read_dir(dir) | |
| 108 | .flatten() | |
| 109 | .any(|entry| entry.file_name().to_string_lossy().contains(".Inline.")) | |
| 110 | } | |
| 111 | ||
| 112 | fn bisect_line_counts(output: &CompletedProcess) -> (usize, usize) { | |
| 113 | let stderr = output.stderr_utf8(); | |
| 114 | let running_count = | |
| 115 | stderr.lines().filter(|line| line.starts_with("BISECT: running pass (")).count(); | |
| 116 | let not_running_count = | |
| 117 | stderr.lines().filter(|line| line.starts_with("BISECT: NOT running pass (")).count(); | |
| 118 | (running_count, not_running_count) | |
| 119 | } |
tests/rustdoc-ui/intra-doc/unresolved-import-recovery.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Regression test for issue #95879. |
| 2 | 2 | |
| 3 | use unresolved_crate::module::Name; //~ ERROR failed to resolve | |
| 3 | use unresolved_crate::module::Name; //~ ERROR cannot find | |
| 4 | 4 | |
| 5 | 5 | /// [Name] |
| 6 | 6 | pub struct S; |
tests/rustdoc-ui/intra-doc/unresolved-import-recovery.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_crate` | |
| 1 | error[E0433]: cannot find module or crate `unresolved_crate` in the crate root | |
| 2 | 2 | --> $DIR/unresolved-import-recovery.rs:3:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use unresolved_crate::module::Name; |
tests/rustdoc-ui/issues/issue-61732.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | 1 | // This previously triggered an ICE. |
| 2 | 2 | |
| 3 | 3 | pub(in crate::r#mod) fn main() {} |
| 4 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `r#mod` | |
| 4 | //~^ ERROR cannot find module or crate `r#mod` in `crate` |
tests/rustdoc-ui/issues/issue-61732.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `r#mod` | |
| 1 | error[E0433]: cannot find module or crate `r#mod` in `crate` | |
| 2 | 2 | --> $DIR/issue-61732.rs:3:15 |
| 3 | 3 | | |
| 4 | 4 | LL | pub(in crate::r#mod) fn main() {} |
tests/ui-fulldeps/session-diagnostic/diagnostic-derive-inline.rs+1-1| ... | ... | @@ -137,7 +137,7 @@ struct MessageWrongType { |
| 137 | 137 | struct InvalidPathFieldAttr { |
| 138 | 138 | #[nonsense] |
| 139 | 139 | //~^ ERROR `#[nonsense]` is not a valid attribute |
| 140 | //~^^ ERROR cannot find attribute `nonsense` in this scope | |
| 140 | //~| ERROR cannot find attribute `nonsense` in this scope | |
| 141 | 141 | foo: String, |
| 142 | 142 | } |
| 143 | 143 |
tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive-inline.rs+8| ... | ... | @@ -90,6 +90,14 @@ struct G { |
| 90 | 90 | var: String, |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | #[derive(Subdiagnostic)] | |
| 94 | #[label("...")] | |
| 95 | struct H { | |
| 96 | #[primary_span] | |
| 97 | span: Span, | |
| 98 | var: String, | |
| 99 | } | |
| 100 | ||
| 93 | 101 | #[derive(Subdiagnostic)] |
| 94 | 102 | #[label(slug = 4)] |
| 95 | 103 | //~^ ERROR no nested attribute expected here |
tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive-inline.stderr+80-80| ... | ... | @@ -35,109 +35,109 @@ LL | #[label(bug = "...")] |
| 35 | 35 | | ^ |
| 36 | 36 | |
| 37 | 37 | error: derive(Diagnostic): no nested attribute expected here |
| 38 | --> $DIR/subdiagnostic-derive-inline.rs:94:9 | |
| 38 | --> $DIR/subdiagnostic-derive-inline.rs:102:9 | |
| 39 | 39 | | |
| 40 | 40 | LL | #[label(slug = 4)] |
| 41 | 41 | | ^^^^ |
| 42 | 42 | |
| 43 | 43 | error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute |
| 44 | --> $DIR/subdiagnostic-derive-inline.rs:94:1 | |
| 44 | --> $DIR/subdiagnostic-derive-inline.rs:102:1 | |
| 45 | 45 | | |
| 46 | 46 | LL | #[label(slug = 4)] |
| 47 | 47 | | ^ |
| 48 | 48 | |
| 49 | 49 | error: derive(Diagnostic): no nested attribute expected here |
| 50 | --> $DIR/subdiagnostic-derive-inline.rs:104:9 | |
| 50 | --> $DIR/subdiagnostic-derive-inline.rs:112:9 | |
| 51 | 51 | | |
| 52 | 52 | LL | #[label(slug("..."))] |
| 53 | 53 | | ^^^^ |
| 54 | 54 | |
| 55 | 55 | error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute |
| 56 | --> $DIR/subdiagnostic-derive-inline.rs:104:1 | |
| 56 | --> $DIR/subdiagnostic-derive-inline.rs:112:1 | |
| 57 | 57 | | |
| 58 | 58 | LL | #[label(slug("..."))] |
| 59 | 59 | | ^ |
| 60 | 60 | |
| 61 | 61 | error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute |
| 62 | --> $DIR/subdiagnostic-derive-inline.rs:114:1 | |
| 62 | --> $DIR/subdiagnostic-derive-inline.rs:122:1 | |
| 63 | 63 | | |
| 64 | 64 | LL | #[label()] |
| 65 | 65 | | ^ |
| 66 | 66 | |
| 67 | 67 | error: derive(Diagnostic): no nested attribute expected here |
| 68 | --> $DIR/subdiagnostic-derive-inline.rs:123:28 | |
| 68 | --> $DIR/subdiagnostic-derive-inline.rs:131:28 | |
| 69 | 69 | | |
| 70 | 70 | LL | #[label("example message", code = "...")] |
| 71 | 71 | | ^^^^ |
| 72 | 72 | |
| 73 | 73 | error: derive(Diagnostic): no nested attribute expected here |
| 74 | --> $DIR/subdiagnostic-derive-inline.rs:132:28 | |
| 74 | --> $DIR/subdiagnostic-derive-inline.rs:140:28 | |
| 75 | 75 | | |
| 76 | 76 | LL | #[label("example message", applicability = "machine-applicable")] |
| 77 | 77 | | ^^^^^^^^^^^^^ |
| 78 | 78 | |
| 79 | 79 | error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum |
| 80 | --> $DIR/subdiagnostic-derive-inline.rs:141:1 | |
| 80 | --> $DIR/subdiagnostic-derive-inline.rs:149:1 | |
| 81 | 81 | | |
| 82 | 82 | LL | #[foo] |
| 83 | 83 | | ^ |
| 84 | 84 | |
| 85 | 85 | error: derive(Diagnostic): `#[bar]` is not a valid attribute |
| 86 | --> $DIR/subdiagnostic-derive-inline.rs:155:5 | |
| 86 | --> $DIR/subdiagnostic-derive-inline.rs:163:5 | |
| 87 | 87 | | |
| 88 | 88 | LL | #[bar] |
| 89 | 89 | | ^ |
| 90 | 90 | |
| 91 | 91 | error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute |
| 92 | --> $DIR/subdiagnostic-derive-inline.rs:167:5 | |
| 92 | --> $DIR/subdiagnostic-derive-inline.rs:175:5 | |
| 93 | 93 | | |
| 94 | 94 | LL | #[bar = "..."] |
| 95 | 95 | | ^ |
| 96 | 96 | |
| 97 | 97 | error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute |
| 98 | --> $DIR/subdiagnostic-derive-inline.rs:179:5 | |
| 98 | --> $DIR/subdiagnostic-derive-inline.rs:187:5 | |
| 99 | 99 | | |
| 100 | 100 | LL | #[bar = 4] |
| 101 | 101 | | ^ |
| 102 | 102 | |
| 103 | 103 | error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute |
| 104 | --> $DIR/subdiagnostic-derive-inline.rs:191:5 | |
| 104 | --> $DIR/subdiagnostic-derive-inline.rs:199:5 | |
| 105 | 105 | | |
| 106 | 106 | LL | #[bar("...")] |
| 107 | 107 | | ^ |
| 108 | 108 | |
| 109 | 109 | error: derive(Diagnostic): no nested attribute expected here |
| 110 | --> $DIR/subdiagnostic-derive-inline.rs:203:13 | |
| 110 | --> $DIR/subdiagnostic-derive-inline.rs:211:13 | |
| 111 | 111 | | |
| 112 | 112 | LL | #[label(code = "...")] |
| 113 | 113 | | ^^^^ |
| 114 | 114 | |
| 115 | 115 | error: derive(Diagnostic): diagnostic message must be first argument of a `#[label(...)]` attribute |
| 116 | --> $DIR/subdiagnostic-derive-inline.rs:203:5 | |
| 116 | --> $DIR/subdiagnostic-derive-inline.rs:211:5 | |
| 117 | 117 | | |
| 118 | 118 | LL | #[label(code = "...")] |
| 119 | 119 | | ^ |
| 120 | 120 | |
| 121 | 121 | error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan` |
| 122 | --> $DIR/subdiagnostic-derive-inline.rs:232:5 | |
| 122 | --> $DIR/subdiagnostic-derive-inline.rs:240:5 | |
| 123 | 123 | | |
| 124 | 124 | LL | #[primary_span] |
| 125 | 125 | | ^ |
| 126 | 126 | |
| 127 | 127 | error: derive(Diagnostic): label without `#[primary_span]` field |
| 128 | --> $DIR/subdiagnostic-derive-inline.rs:229:1 | |
| 128 | --> $DIR/subdiagnostic-derive-inline.rs:237:1 | |
| 129 | 129 | | |
| 130 | 130 | LL | #[label("example message")] |
| 131 | 131 | | ^ |
| 132 | 132 | |
| 133 | 133 | error: derive(Diagnostic): `#[applicability]` is only valid on suggestions |
| 134 | --> $DIR/subdiagnostic-derive-inline.rs:242:5 | |
| 134 | --> $DIR/subdiagnostic-derive-inline.rs:250:5 | |
| 135 | 135 | | |
| 136 | 136 | LL | #[applicability] |
| 137 | 137 | | ^ |
| 138 | 138 | |
| 139 | 139 | error: derive(Diagnostic): `#[bar]` is not a valid attribute |
| 140 | --> $DIR/subdiagnostic-derive-inline.rs:252:5 | |
| 140 | --> $DIR/subdiagnostic-derive-inline.rs:260:5 | |
| 141 | 141 | | |
| 142 | 142 | LL | #[bar] |
| 143 | 143 | | ^ |
| ... | ... | @@ -145,13 +145,13 @@ LL | #[bar] |
| 145 | 145 | = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes |
| 146 | 146 | |
| 147 | 147 | error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute |
| 148 | --> $DIR/subdiagnostic-derive-inline.rs:263:5 | |
| 148 | --> $DIR/subdiagnostic-derive-inline.rs:271:5 | |
| 149 | 149 | | |
| 150 | 150 | LL | #[bar = "..."] |
| 151 | 151 | | ^ |
| 152 | 152 | |
| 153 | 153 | error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute |
| 154 | --> $DIR/subdiagnostic-derive-inline.rs:274:5 | |
| 154 | --> $DIR/subdiagnostic-derive-inline.rs:282:5 | |
| 155 | 155 | | |
| 156 | 156 | LL | #[bar("...")] |
| 157 | 157 | | ^ |
| ... | ... | @@ -159,7 +159,7 @@ LL | #[bar("...")] |
| 159 | 159 | = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes |
| 160 | 160 | |
| 161 | 161 | error: unexpected unsupported untagged union |
| 162 | --> $DIR/subdiagnostic-derive-inline.rs:290:1 | |
| 162 | --> $DIR/subdiagnostic-derive-inline.rs:298:1 | |
| 163 | 163 | | |
| 164 | 164 | LL | / union AC { |
| 165 | 165 | LL | | |
| ... | ... | @@ -169,97 +169,97 @@ LL | | } |
| 169 | 169 | | |_^ |
| 170 | 170 | |
| 171 | 171 | error: expected this path to be an identifier |
| 172 | --> $DIR/subdiagnostic-derive-inline.rs:305:28 | |
| 172 | --> $DIR/subdiagnostic-derive-inline.rs:313:28 | |
| 173 | 173 | | |
| 174 | 174 | LL | #[label("example message", no_crate::example)] |
| 175 | 175 | | ^^^^^^^^^^^^^^^^^ |
| 176 | 176 | |
| 177 | 177 | error: derive(Diagnostic): attribute specified multiple times |
| 178 | --> $DIR/subdiagnostic-derive-inline.rs:318:5 | |
| 178 | --> $DIR/subdiagnostic-derive-inline.rs:326:5 | |
| 179 | 179 | | |
| 180 | 180 | LL | #[primary_span] |
| 181 | 181 | | ^ |
| 182 | 182 | | |
| 183 | 183 | note: previously specified here |
| 184 | --> $DIR/subdiagnostic-derive-inline.rs:315:5 | |
| 184 | --> $DIR/subdiagnostic-derive-inline.rs:323:5 | |
| 185 | 185 | | |
| 186 | 186 | LL | #[primary_span] |
| 187 | 187 | | ^ |
| 188 | 188 | |
| 189 | 189 | error: derive(Diagnostic): subdiagnostic kind not specified |
| 190 | --> $DIR/subdiagnostic-derive-inline.rs:324:8 | |
| 190 | --> $DIR/subdiagnostic-derive-inline.rs:332:8 | |
| 191 | 191 | | |
| 192 | 192 | LL | struct AG { |
| 193 | 193 | | ^^ |
| 194 | 194 | |
| 195 | 195 | error: derive(Diagnostic): attribute specified multiple times |
| 196 | --> $DIR/subdiagnostic-derive-inline.rs:361:47 | |
| 196 | --> $DIR/subdiagnostic-derive-inline.rs:369:47 | |
| 197 | 197 | | |
| 198 | 198 | LL | #[suggestion("example message", code = "...", code = "...")] |
| 199 | 199 | | ^^^^ |
| 200 | 200 | | |
| 201 | 201 | note: previously specified here |
| 202 | --> $DIR/subdiagnostic-derive-inline.rs:361:33 | |
| 202 | --> $DIR/subdiagnostic-derive-inline.rs:369:33 | |
| 203 | 203 | | |
| 204 | 204 | LL | #[suggestion("example message", code = "...", code = "...")] |
| 205 | 205 | | ^^^^ |
| 206 | 206 | |
| 207 | 207 | error: derive(Diagnostic): attribute specified multiple times |
| 208 | --> $DIR/subdiagnostic-derive-inline.rs:379:5 | |
| 208 | --> $DIR/subdiagnostic-derive-inline.rs:387:5 | |
| 209 | 209 | | |
| 210 | 210 | LL | #[applicability] |
| 211 | 211 | | ^ |
| 212 | 212 | | |
| 213 | 213 | note: previously specified here |
| 214 | --> $DIR/subdiagnostic-derive-inline.rs:376:5 | |
| 214 | --> $DIR/subdiagnostic-derive-inline.rs:384:5 | |
| 215 | 215 | | |
| 216 | 216 | LL | #[applicability] |
| 217 | 217 | | ^ |
| 218 | 218 | |
| 219 | 219 | error: derive(Diagnostic): the `#[applicability]` attribute can only be applied to fields of type `Applicability` |
| 220 | --> $DIR/subdiagnostic-derive-inline.rs:389:5 | |
| 220 | --> $DIR/subdiagnostic-derive-inline.rs:397:5 | |
| 221 | 221 | | |
| 222 | 222 | LL | #[applicability] |
| 223 | 223 | | ^ |
| 224 | 224 | |
| 225 | 225 | error: derive(Diagnostic): suggestion without `code = "..."` |
| 226 | --> $DIR/subdiagnostic-derive-inline.rs:402:1 | |
| 226 | --> $DIR/subdiagnostic-derive-inline.rs:410:1 | |
| 227 | 227 | | |
| 228 | 228 | LL | #[suggestion("example message")] |
| 229 | 229 | | ^ |
| 230 | 230 | |
| 231 | 231 | error: derive(Diagnostic): invalid applicability |
| 232 | --> $DIR/subdiagnostic-derive-inline.rs:412:63 | |
| 232 | --> $DIR/subdiagnostic-derive-inline.rs:420:63 | |
| 233 | 233 | | |
| 234 | 234 | LL | #[suggestion("example message", code = "...", applicability = "foo")] |
| 235 | 235 | | ^^^^^ |
| 236 | 236 | |
| 237 | 237 | error: derive(Diagnostic): suggestion without `#[primary_span]` field |
| 238 | --> $DIR/subdiagnostic-derive-inline.rs:430:1 | |
| 238 | --> $DIR/subdiagnostic-derive-inline.rs:438:1 | |
| 239 | 239 | | |
| 240 | 240 | LL | #[suggestion("example message", code = "...")] |
| 241 | 241 | | ^ |
| 242 | 242 | |
| 243 | 243 | error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum |
| 244 | --> $DIR/subdiagnostic-derive-inline.rs:444:1 | |
| 244 | --> $DIR/subdiagnostic-derive-inline.rs:452:1 | |
| 245 | 245 | | |
| 246 | 246 | LL | #[label] |
| 247 | 247 | | ^ |
| 248 | 248 | |
| 249 | 249 | error: derive(Diagnostic): `var` doesn't refer to a field on this type |
| 250 | --> $DIR/subdiagnostic-derive-inline.rs:464:40 | |
| 250 | --> $DIR/subdiagnostic-derive-inline.rs:472:40 | |
| 251 | 251 | | |
| 252 | 252 | LL | #[suggestion("example message", code = "{var}", applicability = "machine-applicable")] |
| 253 | 253 | | ^^^^^^^ |
| 254 | 254 | |
| 255 | 255 | error: derive(Diagnostic): `var` doesn't refer to a field on this type |
| 256 | --> $DIR/subdiagnostic-derive-inline.rs:483:44 | |
| 256 | --> $DIR/subdiagnostic-derive-inline.rs:491:44 | |
| 257 | 257 | | |
| 258 | 258 | LL | #[suggestion("example message", code = "{var}", applicability = "machine-applicable")] |
| 259 | 259 | | ^^^^^^^ |
| 260 | 260 | |
| 261 | 261 | error: derive(Diagnostic): `#[suggestion_part]` is not a valid attribute |
| 262 | --> $DIR/subdiagnostic-derive-inline.rs:506:5 | |
| 262 | --> $DIR/subdiagnostic-derive-inline.rs:514:5 | |
| 263 | 263 | | |
| 264 | 264 | LL | #[suggestion_part] |
| 265 | 265 | | ^ |
| ... | ... | @@ -267,7 +267,7 @@ LL | #[suggestion_part] |
| 267 | 267 | = help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead |
| 268 | 268 | |
| 269 | 269 | error: derive(Diagnostic): `#[suggestion_part(...)]` is not a valid attribute |
| 270 | --> $DIR/subdiagnostic-derive-inline.rs:509:5 | |
| 270 | --> $DIR/subdiagnostic-derive-inline.rs:517:5 | |
| 271 | 271 | | |
| 272 | 272 | LL | #[suggestion_part(code = "...")] |
| 273 | 273 | | ^ |
| ... | ... | @@ -275,13 +275,13 @@ LL | #[suggestion_part(code = "...")] |
| 275 | 275 | = help: `#[suggestion_part(...)]` is only valid in multipart suggestions |
| 276 | 276 | |
| 277 | 277 | error: derive(Diagnostic): suggestion without `#[primary_span]` field |
| 278 | --> $DIR/subdiagnostic-derive-inline.rs:503:1 | |
| 278 | --> $DIR/subdiagnostic-derive-inline.rs:511:1 | |
| 279 | 279 | | |
| 280 | 280 | LL | #[suggestion("example message", code = "...")] |
| 281 | 281 | | ^ |
| 282 | 282 | |
| 283 | 283 | error: derive(Diagnostic): invalid nested attribute |
| 284 | --> $DIR/subdiagnostic-derive-inline.rs:518:43 | |
| 284 | --> $DIR/subdiagnostic-derive-inline.rs:526:43 | |
| 285 | 285 | | |
| 286 | 286 | LL | #[multipart_suggestion("example message", code = "...", applicability = "machine-applicable")] |
| 287 | 287 | | ^^^^ |
| ... | ... | @@ -289,25 +289,25 @@ LL | #[multipart_suggestion("example message", code = "...", applicability = "ma |
| 289 | 289 | = help: only `style` and `applicability` are valid nested attributes |
| 290 | 290 | |
| 291 | 291 | error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields |
| 292 | --> $DIR/subdiagnostic-derive-inline.rs:518:1 | |
| 292 | --> $DIR/subdiagnostic-derive-inline.rs:526:1 | |
| 293 | 293 | | |
| 294 | 294 | LL | #[multipart_suggestion("example message", code = "...", applicability = "machine-applicable")] |
| 295 | 295 | | ^ |
| 296 | 296 | |
| 297 | 297 | error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` |
| 298 | --> $DIR/subdiagnostic-derive-inline.rs:528:5 | |
| 298 | --> $DIR/subdiagnostic-derive-inline.rs:536:5 | |
| 299 | 299 | | |
| 300 | 300 | LL | #[suggestion_part] |
| 301 | 301 | | ^ |
| 302 | 302 | |
| 303 | 303 | error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` |
| 304 | --> $DIR/subdiagnostic-derive-inline.rs:536:5 | |
| 304 | --> $DIR/subdiagnostic-derive-inline.rs:544:5 | |
| 305 | 305 | | |
| 306 | 306 | LL | #[suggestion_part()] |
| 307 | 307 | | ^ |
| 308 | 308 | |
| 309 | 309 | error: derive(Diagnostic): `#[primary_span]` is not a valid attribute |
| 310 | --> $DIR/subdiagnostic-derive-inline.rs:545:5 | |
| 310 | --> $DIR/subdiagnostic-derive-inline.rs:553:5 | |
| 311 | 311 | | |
| 312 | 312 | LL | #[primary_span] |
| 313 | 313 | | ^ |
| ... | ... | @@ -315,127 +315,127 @@ LL | #[primary_span] |
| 315 | 315 | = help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]` |
| 316 | 316 | |
| 317 | 317 | error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields |
| 318 | --> $DIR/subdiagnostic-derive-inline.rs:542:1 | |
| 318 | --> $DIR/subdiagnostic-derive-inline.rs:550:1 | |
| 319 | 319 | | |
| 320 | 320 | LL | #[multipart_suggestion("example message")] |
| 321 | 321 | | ^ |
| 322 | 322 | |
| 323 | 323 | error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` |
| 324 | --> $DIR/subdiagnostic-derive-inline.rs:553:5 | |
| 324 | --> $DIR/subdiagnostic-derive-inline.rs:561:5 | |
| 325 | 325 | | |
| 326 | 326 | LL | #[suggestion_part] |
| 327 | 327 | | ^ |
| 328 | 328 | |
| 329 | 329 | error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."` |
| 330 | --> $DIR/subdiagnostic-derive-inline.rs:556:5 | |
| 330 | --> $DIR/subdiagnostic-derive-inline.rs:564:5 | |
| 331 | 331 | | |
| 332 | 332 | LL | #[suggestion_part()] |
| 333 | 333 | | ^ |
| 334 | 334 | |
| 335 | 335 | error: derive(Diagnostic): `code` is the only valid nested attribute |
| 336 | --> $DIR/subdiagnostic-derive-inline.rs:559:23 | |
| 336 | --> $DIR/subdiagnostic-derive-inline.rs:567:23 | |
| 337 | 337 | | |
| 338 | 338 | LL | #[suggestion_part(foo = "bar")] |
| 339 | 339 | | ^^^ |
| 340 | 340 | |
| 341 | 341 | error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` |
| 342 | --> $DIR/subdiagnostic-derive-inline.rs:563:5 | |
| 342 | --> $DIR/subdiagnostic-derive-inline.rs:571:5 | |
| 343 | 343 | | |
| 344 | 344 | LL | #[suggestion_part(code = "...")] |
| 345 | 345 | | ^ |
| 346 | 346 | |
| 347 | 347 | error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` |
| 348 | --> $DIR/subdiagnostic-derive-inline.rs:566:5 | |
| 348 | --> $DIR/subdiagnostic-derive-inline.rs:574:5 | |
| 349 | 349 | | |
| 350 | 350 | LL | #[suggestion_part()] |
| 351 | 351 | | ^ |
| 352 | 352 | |
| 353 | 353 | error: expected `,` |
| 354 | --> $DIR/subdiagnostic-derive-inline.rs:559:27 | |
| 354 | --> $DIR/subdiagnostic-derive-inline.rs:567:27 | |
| 355 | 355 | | |
| 356 | 356 | LL | #[suggestion_part(foo = "bar")] |
| 357 | 357 | | ^ |
| 358 | 358 | |
| 359 | 359 | error: derive(Diagnostic): attribute specified multiple times |
| 360 | --> $DIR/subdiagnostic-derive-inline.rs:574:37 | |
| 360 | --> $DIR/subdiagnostic-derive-inline.rs:582:37 | |
| 361 | 361 | | |
| 362 | 362 | LL | #[suggestion_part(code = "...", code = ",,,")] |
| 363 | 363 | | ^^^^ |
| 364 | 364 | | |
| 365 | 365 | note: previously specified here |
| 366 | --> $DIR/subdiagnostic-derive-inline.rs:574:23 | |
| 366 | --> $DIR/subdiagnostic-derive-inline.rs:582:23 | |
| 367 | 367 | | |
| 368 | 368 | LL | #[suggestion_part(code = "...", code = ",,,")] |
| 369 | 369 | | ^^^^ |
| 370 | 370 | |
| 371 | 371 | error: derive(Diagnostic): `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."` |
| 372 | --> $DIR/subdiagnostic-derive-inline.rs:603:5 | |
| 372 | --> $DIR/subdiagnostic-derive-inline.rs:611:5 | |
| 373 | 373 | | |
| 374 | 374 | LL | #[applicability] |
| 375 | 375 | | ^ |
| 376 | 376 | |
| 377 | 377 | error: derive(Diagnostic): expected exactly one string literal for `code = ...` |
| 378 | --> $DIR/subdiagnostic-derive-inline.rs:651:28 | |
| 378 | --> $DIR/subdiagnostic-derive-inline.rs:659:28 | |
| 379 | 379 | | |
| 380 | 380 | LL | #[suggestion_part(code("foo"))] |
| 381 | 381 | | ^^^^^ |
| 382 | 382 | |
| 383 | 383 | error: unexpected token, expected `)` |
| 384 | --> $DIR/subdiagnostic-derive-inline.rs:651:28 | |
| 384 | --> $DIR/subdiagnostic-derive-inline.rs:659:28 | |
| 385 | 385 | | |
| 386 | 386 | LL | #[suggestion_part(code("foo"))] |
| 387 | 387 | | ^^^^^ |
| 388 | 388 | |
| 389 | 389 | error: derive(Diagnostic): expected exactly one string literal for `code = ...` |
| 390 | --> $DIR/subdiagnostic-derive-inline.rs:661:28 | |
| 390 | --> $DIR/subdiagnostic-derive-inline.rs:669:28 | |
| 391 | 391 | | |
| 392 | 392 | LL | #[suggestion_part(code("foo", "bar"))] |
| 393 | 393 | | ^^^^^ |
| 394 | 394 | |
| 395 | 395 | error: unexpected token, expected `)` |
| 396 | --> $DIR/subdiagnostic-derive-inline.rs:661:28 | |
| 396 | --> $DIR/subdiagnostic-derive-inline.rs:669:28 | |
| 397 | 397 | | |
| 398 | 398 | LL | #[suggestion_part(code("foo", "bar"))] |
| 399 | 399 | | ^^^^^ |
| 400 | 400 | |
| 401 | 401 | error: derive(Diagnostic): expected exactly one string literal for `code = ...` |
| 402 | --> $DIR/subdiagnostic-derive-inline.rs:671:28 | |
| 402 | --> $DIR/subdiagnostic-derive-inline.rs:679:28 | |
| 403 | 403 | | |
| 404 | 404 | LL | #[suggestion_part(code(3))] |
| 405 | 405 | | ^ |
| 406 | 406 | |
| 407 | 407 | error: unexpected token, expected `)` |
| 408 | --> $DIR/subdiagnostic-derive-inline.rs:671:28 | |
| 408 | --> $DIR/subdiagnostic-derive-inline.rs:679:28 | |
| 409 | 409 | | |
| 410 | 410 | LL | #[suggestion_part(code(3))] |
| 411 | 411 | | ^ |
| 412 | 412 | |
| 413 | 413 | error: derive(Diagnostic): expected exactly one string literal for `code = ...` |
| 414 | --> $DIR/subdiagnostic-derive-inline.rs:681:28 | |
| 414 | --> $DIR/subdiagnostic-derive-inline.rs:689:28 | |
| 415 | 415 | | |
| 416 | 416 | LL | #[suggestion_part(code())] |
| 417 | 417 | | ^ |
| 418 | 418 | |
| 419 | 419 | error: expected string literal |
| 420 | --> $DIR/subdiagnostic-derive-inline.rs:690:30 | |
| 420 | --> $DIR/subdiagnostic-derive-inline.rs:698:30 | |
| 421 | 421 | | |
| 422 | 422 | LL | #[suggestion_part(code = 3)] |
| 423 | 423 | | ^ |
| 424 | 424 | |
| 425 | 425 | error: derive(Diagnostic): attribute specified multiple times |
| 426 | --> $DIR/subdiagnostic-derive-inline.rs:732:1 | |
| 426 | --> $DIR/subdiagnostic-derive-inline.rs:740:1 | |
| 427 | 427 | | |
| 428 | 428 | LL | #[suggestion("example message", code = "", style = "hidden", style = "normal")] |
| 429 | 429 | | ^ |
| 430 | 430 | | |
| 431 | 431 | note: previously specified here |
| 432 | --> $DIR/subdiagnostic-derive-inline.rs:732:1 | |
| 432 | --> $DIR/subdiagnostic-derive-inline.rs:740:1 | |
| 433 | 433 | | |
| 434 | 434 | LL | #[suggestion("example message", code = "", style = "hidden", style = "normal")] |
| 435 | 435 | | ^ |
| 436 | 436 | |
| 437 | 437 | error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute |
| 438 | --> $DIR/subdiagnostic-derive-inline.rs:741:1 | |
| 438 | --> $DIR/subdiagnostic-derive-inline.rs:749:1 | |
| 439 | 439 | | |
| 440 | 440 | LL | #[suggestion_hidden("example message", code = "")] |
| 441 | 441 | | ^ |
| ... | ... | @@ -443,7 +443,7 @@ LL | #[suggestion_hidden("example message", code = "")] |
| 443 | 443 | = help: Use `#[suggestion(..., style = "hidden")]` instead |
| 444 | 444 | |
| 445 | 445 | error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute |
| 446 | --> $DIR/subdiagnostic-derive-inline.rs:749:1 | |
| 446 | --> $DIR/subdiagnostic-derive-inline.rs:757:1 | |
| 447 | 447 | | |
| 448 | 448 | LL | #[suggestion_hidden("example message", code = "", style = "normal")] |
| 449 | 449 | | ^ |
| ... | ... | @@ -451,7 +451,7 @@ LL | #[suggestion_hidden("example message", code = "", style = "normal")] |
| 451 | 451 | = help: Use `#[suggestion(..., style = "hidden")]` instead |
| 452 | 452 | |
| 453 | 453 | error: derive(Diagnostic): invalid suggestion style |
| 454 | --> $DIR/subdiagnostic-derive-inline.rs:757:52 | |
| 454 | --> $DIR/subdiagnostic-derive-inline.rs:765:52 | |
| 455 | 455 | | |
| 456 | 456 | LL | #[suggestion("example message", code = "", style = "foo")] |
| 457 | 457 | | ^^^^^ |
| ... | ... | @@ -459,25 +459,25 @@ LL | #[suggestion("example message", code = "", style = "foo")] |
| 459 | 459 | = help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only` |
| 460 | 460 | |
| 461 | 461 | error: expected string literal |
| 462 | --> $DIR/subdiagnostic-derive-inline.rs:765:52 | |
| 462 | --> $DIR/subdiagnostic-derive-inline.rs:773:52 | |
| 463 | 463 | | |
| 464 | 464 | LL | #[suggestion("example message", code = "", style = 42)] |
| 465 | 465 | | ^^ |
| 466 | 466 | |
| 467 | 467 | error: expected `=` |
| 468 | --> $DIR/subdiagnostic-derive-inline.rs:773:49 | |
| 468 | --> $DIR/subdiagnostic-derive-inline.rs:781:49 | |
| 469 | 469 | | |
| 470 | 470 | LL | #[suggestion("example message", code = "", style)] |
| 471 | 471 | | ^ |
| 472 | 472 | |
| 473 | 473 | error: expected `=` |
| 474 | --> $DIR/subdiagnostic-derive-inline.rs:781:49 | |
| 474 | --> $DIR/subdiagnostic-derive-inline.rs:789:49 | |
| 475 | 475 | | |
| 476 | 476 | LL | #[suggestion("example message", code = "", style("foo"))] |
| 477 | 477 | | ^ |
| 478 | 478 | |
| 479 | 479 | error: derive(Diagnostic): `#[primary_span]` is not a valid attribute |
| 480 | --> $DIR/subdiagnostic-derive-inline.rs:792:5 | |
| 480 | --> $DIR/subdiagnostic-derive-inline.rs:800:5 | |
| 481 | 481 | | |
| 482 | 482 | LL | #[primary_span] |
| 483 | 483 | | ^ |
| ... | ... | @@ -486,7 +486,7 @@ LL | #[primary_span] |
| 486 | 486 | = help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead |
| 487 | 487 | |
| 488 | 488 | error: derive(Diagnostic): suggestion without `#[primary_span]` field |
| 489 | --> $DIR/subdiagnostic-derive-inline.rs:789:1 | |
| 489 | --> $DIR/subdiagnostic-derive-inline.rs:797:1 | |
| 490 | 490 | | |
| 491 | 491 | LL | #[suggestion("example message", code = "")] |
| 492 | 492 | | ^ |
| ... | ... | @@ -498,49 +498,49 @@ LL | #[foo] |
| 498 | 498 | | ^^^ |
| 499 | 499 | |
| 500 | 500 | error: cannot find attribute `foo` in this scope |
| 501 | --> $DIR/subdiagnostic-derive-inline.rs:141:3 | |
| 501 | --> $DIR/subdiagnostic-derive-inline.rs:149:3 | |
| 502 | 502 | | |
| 503 | 503 | LL | #[foo] |
| 504 | 504 | | ^^^ |
| 505 | 505 | |
| 506 | 506 | error: cannot find attribute `bar` in this scope |
| 507 | --> $DIR/subdiagnostic-derive-inline.rs:155:7 | |
| 507 | --> $DIR/subdiagnostic-derive-inline.rs:163:7 | |
| 508 | 508 | | |
| 509 | 509 | LL | #[bar] |
| 510 | 510 | | ^^^ |
| 511 | 511 | |
| 512 | 512 | error: cannot find attribute `bar` in this scope |
| 513 | --> $DIR/subdiagnostic-derive-inline.rs:167:7 | |
| 513 | --> $DIR/subdiagnostic-derive-inline.rs:175:7 | |
| 514 | 514 | | |
| 515 | 515 | LL | #[bar = "..."] |
| 516 | 516 | | ^^^ |
| 517 | 517 | |
| 518 | 518 | error: cannot find attribute `bar` in this scope |
| 519 | --> $DIR/subdiagnostic-derive-inline.rs:179:7 | |
| 519 | --> $DIR/subdiagnostic-derive-inline.rs:187:7 | |
| 520 | 520 | | |
| 521 | 521 | LL | #[bar = 4] |
| 522 | 522 | | ^^^ |
| 523 | 523 | |
| 524 | 524 | error: cannot find attribute `bar` in this scope |
| 525 | --> $DIR/subdiagnostic-derive-inline.rs:191:7 | |
| 525 | --> $DIR/subdiagnostic-derive-inline.rs:199:7 | |
| 526 | 526 | | |
| 527 | 527 | LL | #[bar("...")] |
| 528 | 528 | | ^^^ |
| 529 | 529 | |
| 530 | 530 | error: cannot find attribute `bar` in this scope |
| 531 | --> $DIR/subdiagnostic-derive-inline.rs:252:7 | |
| 531 | --> $DIR/subdiagnostic-derive-inline.rs:260:7 | |
| 532 | 532 | | |
| 533 | 533 | LL | #[bar] |
| 534 | 534 | | ^^^ |
| 535 | 535 | |
| 536 | 536 | error: cannot find attribute `bar` in this scope |
| 537 | --> $DIR/subdiagnostic-derive-inline.rs:263:7 | |
| 537 | --> $DIR/subdiagnostic-derive-inline.rs:271:7 | |
| 538 | 538 | | |
| 539 | 539 | LL | #[bar = "..."] |
| 540 | 540 | | ^^^ |
| 541 | 541 | |
| 542 | 542 | error: cannot find attribute `bar` in this scope |
| 543 | --> $DIR/subdiagnostic-derive-inline.rs:274:7 | |
| 543 | --> $DIR/subdiagnostic-derive-inline.rs:282:7 | |
| 544 | 544 | | |
| 545 | 545 | LL | #[bar("...")] |
| 546 | 546 | | ^^^ |
tests/ui/asm/naked-invalid-attr.rs+1-1| ... | ... | @@ -56,7 +56,7 @@ fn main() { |
| 56 | 56 | // Check that the path of an attribute without a name is printed correctly (issue #140082) |
| 57 | 57 | #[::a] |
| 58 | 58 | //~^ ERROR attribute incompatible with `#[unsafe(naked)]` |
| 59 | //~| ERROR failed to resolve: use of unresolved module or unlinked crate `a` | |
| 59 | //~| ERROR cannot find module or crate `a` in the crate root | |
| 60 | 60 | #[unsafe(naked)] |
| 61 | 61 | extern "C" fn issue_140082() { |
| 62 | 62 | naked_asm!("") |
tests/ui/asm/naked-invalid-attr.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a` | |
| 1 | error[E0433]: cannot find module or crate `a` in the crate root | |
| 2 | 2 | --> $DIR/naked-invalid-attr.rs:57:5 |
| 3 | 3 | | |
| 4 | 4 | LL | #[::a] |
tests/ui/associated-types/suggest-param-env-shadowing-incompatible-args.rs created+18| ... | ... | @@ -0,0 +1,18 @@ |
| 1 | //@ compile-flags: -Znext-solver=globally | |
| 2 | ||
| 3 | // Regression test for https://github.com/rust-lang/rust/issues/152684. | |
| 4 | ||
| 5 | #![feature(associated_type_defaults)] | |
| 6 | ||
| 7 | trait Foo { | |
| 8 | type Assoc<T = u8> = T; | |
| 9 | //~^ ERROR defaults for generic parameters are not allowed here | |
| 10 | fn foo() -> Self::Assoc; | |
| 11 | } | |
| 12 | impl Foo for () { | |
| 13 | fn foo() -> Self::Assoc { | |
| 14 | [] //~ ERROR mismatched types | |
| 15 | } | |
| 16 | } | |
| 17 | ||
| 18 | fn main() {} |
tests/ui/associated-types/suggest-param-env-shadowing-incompatible-args.stderr created+20| ... | ... | @@ -0,0 +1,20 @@ |
| 1 | error: defaults for generic parameters are not allowed here | |
| 2 | --> $DIR/suggest-param-env-shadowing-incompatible-args.rs:8:16 | |
| 3 | | | |
| 4 | LL | type Assoc<T = u8> = T; | |
| 5 | | ^^^^^^ | |
| 6 | ||
| 7 | error[E0308]: mismatched types | |
| 8 | --> $DIR/suggest-param-env-shadowing-incompatible-args.rs:14:9 | |
| 9 | | | |
| 10 | LL | fn foo() -> Self::Assoc { | |
| 11 | | ----------- expected `<() as Foo>::Assoc` because of return type | |
| 12 | LL | [] | |
| 13 | | ^^ expected `u8`, found `[_; 0]` | |
| 14 | | | |
| 15 | = note: expected type `u8` | |
| 16 | found array `[_; 0]` | |
| 17 | ||
| 18 | error: aborting due to 2 previous errors | |
| 19 | ||
| 20 | For more information about this error, try `rustc --explain E0308`. |
tests/ui/attributes/builtin-attribute-prefix.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | // Regression test for https://github.com/rust-lang/rust/issues/143789 |
| 2 | 2 | #[must_use::skip] |
| 3 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `must_use` | |
| 3 | //~^ ERROR: cannot find module or crate `must_use` | |
| 4 | 4 | fn main() { } |
| 5 | 5 | |
| 6 | 6 | // Regression test for https://github.com/rust-lang/rust/issues/137590 |
| 7 | 7 | struct S(#[stable::skip] u8, u16, u32); |
| 8 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `stable` | |
| 8 | //~^ ERROR: cannot find module or crate `stable` |
tests/ui/attributes/builtin-attribute-prefix.stderr+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `stable` | |
| 1 | error[E0433]: cannot find module or crate `stable` in this scope | |
| 2 | 2 | --> $DIR/builtin-attribute-prefix.rs:7:12 |
| 3 | 3 | | |
| 4 | 4 | LL | struct S(#[stable::skip] u8, u16, u32); |
| 5 | 5 | | ^^^^^^ use of unresolved module or unlinked crate `stable` |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `must_use` | |
| 7 | error[E0433]: cannot find module or crate `must_use` in this scope | |
| 8 | 8 | --> $DIR/builtin-attribute-prefix.rs:2:3 |
| 9 | 9 | | |
| 10 | 10 | LL | #[must_use::skip] |
tests/ui/attributes/check-builtin-attr-ice.rs+3-3| ... | ... | @@ -43,11 +43,11 @@ |
| 43 | 43 | |
| 44 | 44 | struct Foo { |
| 45 | 45 | #[should_panic::skip] |
| 46 | //~^ ERROR failed to resolve | |
| 46 | //~^ ERROR cannot find | |
| 47 | 47 | pub field: u8, |
| 48 | 48 | |
| 49 | 49 | #[should_panic::a::b::c] |
| 50 | //~^ ERROR failed to resolve | |
| 50 | //~^ ERROR cannot find | |
| 51 | 51 | pub field2: u8, |
| 52 | 52 | } |
| 53 | 53 | |
| ... | ... | @@ -55,6 +55,6 @@ fn foo() {} |
| 55 | 55 | |
| 56 | 56 | fn main() { |
| 57 | 57 | #[deny::skip] |
| 58 | //~^ ERROR failed to resolve | |
| 58 | //~^ ERROR cannot find | |
| 59 | 59 | foo(); |
| 60 | 60 | } |
tests/ui/attributes/check-builtin-attr-ice.stderr+3-3| ... | ... | @@ -1,16 +1,16 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic` | |
| 1 | error[E0433]: cannot find module or crate `should_panic` in this scope | |
| 2 | 2 | --> $DIR/check-builtin-attr-ice.rs:45:7 |
| 3 | 3 | | |
| 4 | 4 | LL | #[should_panic::skip] |
| 5 | 5 | | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic` |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `should_panic` | |
| 7 | error[E0433]: cannot find module or crate `should_panic` in this scope | |
| 8 | 8 | --> $DIR/check-builtin-attr-ice.rs:49:7 |
| 9 | 9 | | |
| 10 | 10 | LL | #[should_panic::a::b::c] |
| 11 | 11 | | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `should_panic` |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `deny` | |
| 13 | error[E0433]: cannot find module or crate `deny` in this scope | |
| 14 | 14 | --> $DIR/check-builtin-attr-ice.rs:57:7 |
| 15 | 15 | | |
| 16 | 16 | LL | #[deny::skip] |
tests/ui/attributes/check-cfg_attr-ice.rs+13-13| ... | ... | @@ -10,27 +10,27 @@ |
| 10 | 10 | #![crate_type = "lib"] |
| 11 | 11 | |
| 12 | 12 | #[cfg_attr::no_such_thing] |
| 13 | //~^ ERROR failed to resolve | |
| 13 | //~^ ERROR cannot find | |
| 14 | 14 | mod we_are_no_strangers_to_love {} |
| 15 | 15 | |
| 16 | 16 | #[cfg_attr::no_such_thing] |
| 17 | //~^ ERROR failed to resolve | |
| 17 | //~^ ERROR cannot find | |
| 18 | 18 | struct YouKnowTheRules { |
| 19 | 19 | #[cfg_attr::no_such_thing] |
| 20 | //~^ ERROR failed to resolve | |
| 20 | //~^ ERROR cannot find | |
| 21 | 21 | and_so_do_i: u8, |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | #[cfg_attr::no_such_thing] |
| 25 | //~^ ERROR failed to resolve | |
| 25 | //~^ ERROR cannot find | |
| 26 | 26 | fn a_full_commitment() { |
| 27 | 27 | #[cfg_attr::no_such_thing] |
| 28 | //~^ ERROR failed to resolve | |
| 28 | //~^ ERROR cannot find | |
| 29 | 29 | let is_what_i_am_thinking_of = (); |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | #[cfg_attr::no_such_thing] |
| 33 | //~^ ERROR failed to resolve | |
| 33 | //~^ ERROR cannot find | |
| 34 | 34 | union AnyOtherGuy { |
| 35 | 35 | owo: () |
| 36 | 36 | } |
| ... | ... | @@ -39,30 +39,30 @@ struct This; |
| 39 | 39 | #[cfg_attr(FALSE, doc = "you wouldn't get this")] |
| 40 | 40 | impl From<AnyOtherGuy> for This { |
| 41 | 41 | #[cfg_attr::no_such_thing] |
| 42 | //~^ ERROR failed to resolve | |
| 42 | //~^ ERROR cannot find | |
| 43 | 43 | fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This { |
| 44 | //~^ ERROR failed to resolve | |
| 44 | //~^ ERROR cannot find | |
| 45 | 45 | #[cfg_attr::no_such_thing] |
| 46 | 46 | //~^ ERROR attributes on expressions are experimental |
| 47 | //~| ERROR failed to resolve | |
| 47 | //~| ERROR cannot find | |
| 48 | 48 | unreachable!() |
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | #[cfg_attr::no_such_thing] |
| 53 | //~^ ERROR failed to resolve | |
| 53 | //~^ ERROR cannot find | |
| 54 | 54 | enum NeverGonna { |
| 55 | 55 | #[cfg_attr::no_such_thing] |
| 56 | //~^ ERROR failed to resolve | |
| 56 | //~^ ERROR cannot find | |
| 57 | 57 | GiveYouUp(#[cfg_attr::no_such_thing] u8), |
| 58 | //~^ ERROR failed to resolve | |
| 58 | //~^ ERROR cannot find | |
| 59 | 59 | LetYouDown { |
| 60 | 60 | #![cfg_attr::no_such_thing] |
| 61 | 61 | //~^ ERROR an inner attribute is not permitted in this context |
| 62 | 62 | never_gonna: (), |
| 63 | 63 | round_around: (), |
| 64 | 64 | #[cfg_attr::no_such_thing] |
| 65 | //~^ ERROR failed to resolve | |
| 65 | //~^ ERROR cannot find | |
| 66 | 66 | and_desert_you: (), |
| 67 | 67 | }, |
| 68 | 68 | } |
tests/ui/attributes/check-cfg_attr-ice.stderr+13-13| ... | ... | @@ -17,79 +17,79 @@ LL | #[cfg_attr::no_such_thing] |
| 17 | 17 | = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable |
| 18 | 18 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 19 | 19 | |
| 20 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 20 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 21 | 21 | --> $DIR/check-cfg_attr-ice.rs:52:3 |
| 22 | 22 | | |
| 23 | 23 | LL | #[cfg_attr::no_such_thing] |
| 24 | 24 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 25 | 25 | |
| 26 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 26 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 27 | 27 | --> $DIR/check-cfg_attr-ice.rs:55:7 |
| 28 | 28 | | |
| 29 | 29 | LL | #[cfg_attr::no_such_thing] |
| 30 | 30 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 31 | 31 | |
| 32 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 32 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 33 | 33 | --> $DIR/check-cfg_attr-ice.rs:57:17 |
| 34 | 34 | | |
| 35 | 35 | LL | GiveYouUp(#[cfg_attr::no_such_thing] u8), |
| 36 | 36 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 37 | 37 | |
| 38 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 38 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 39 | 39 | --> $DIR/check-cfg_attr-ice.rs:64:11 |
| 40 | 40 | | |
| 41 | 41 | LL | #[cfg_attr::no_such_thing] |
| 42 | 42 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 43 | 43 | |
| 44 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 44 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 45 | 45 | --> $DIR/check-cfg_attr-ice.rs:41:7 |
| 46 | 46 | | |
| 47 | 47 | LL | #[cfg_attr::no_such_thing] |
| 48 | 48 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 49 | 49 | |
| 50 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 50 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 51 | 51 | --> $DIR/check-cfg_attr-ice.rs:43:15 |
| 52 | 52 | | |
| 53 | 53 | LL | fn from(#[cfg_attr::no_such_thing] any_other_guy: AnyOtherGuy) -> This { |
| 54 | 54 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 55 | 55 | |
| 56 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 56 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 57 | 57 | --> $DIR/check-cfg_attr-ice.rs:45:11 |
| 58 | 58 | | |
| 59 | 59 | LL | #[cfg_attr::no_such_thing] |
| 60 | 60 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 61 | 61 | |
| 62 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 62 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 63 | 63 | --> $DIR/check-cfg_attr-ice.rs:32:3 |
| 64 | 64 | | |
| 65 | 65 | LL | #[cfg_attr::no_such_thing] |
| 66 | 66 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 67 | 67 | |
| 68 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 68 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 69 | 69 | --> $DIR/check-cfg_attr-ice.rs:24:3 |
| 70 | 70 | | |
| 71 | 71 | LL | #[cfg_attr::no_such_thing] |
| 72 | 72 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 73 | 73 | |
| 74 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 74 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 75 | 75 | --> $DIR/check-cfg_attr-ice.rs:27:7 |
| 76 | 76 | | |
| 77 | 77 | LL | #[cfg_attr::no_such_thing] |
| 78 | 78 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 79 | 79 | |
| 80 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 80 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 81 | 81 | --> $DIR/check-cfg_attr-ice.rs:16:3 |
| 82 | 82 | | |
| 83 | 83 | LL | #[cfg_attr::no_such_thing] |
| 84 | 84 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 85 | 85 | |
| 86 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 86 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 87 | 87 | --> $DIR/check-cfg_attr-ice.rs:19:7 |
| 88 | 88 | | |
| 89 | 89 | LL | #[cfg_attr::no_such_thing] |
| 90 | 90 | | ^^^^^^^^ use of unresolved module or unlinked crate `cfg_attr` |
| 91 | 91 | |
| 92 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `cfg_attr` | |
| 92 | error[E0433]: cannot find module or crate `cfg_attr` in this scope | |
| 93 | 93 | --> $DIR/check-cfg_attr-ice.rs:12:3 |
| 94 | 94 | | |
| 95 | 95 | LL | #[cfg_attr::no_such_thing] |
tests/ui/attributes/custom_attr_multisegment_error.rs+1-1| ... | ... | @@ -2,5 +2,5 @@ |
| 2 | 2 | |
| 3 | 3 | mod existent {} |
| 4 | 4 | |
| 5 | #[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent` | |
| 5 | #[existent::nonexistent] //~ ERROR cannot find `nonexistent` in `existent` | |
| 6 | 6 | fn main() {} |
tests/ui/attributes/custom_attr_multisegment_error.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `nonexistent` in `existent` | |
| 1 | error[E0433]: cannot find `nonexistent` in `existent` | |
| 2 | 2 | --> $DIR/custom_attr_multisegment_error.rs:5:13 |
| 3 | 3 | | |
| 4 | 4 | LL | #[existent::nonexistent] |
tests/ui/attributes/field-attributes-vis-unresolved.rs+2-2| ... | ... | @@ -15,12 +15,12 @@ mod internal { |
| 15 | 15 | |
| 16 | 16 | struct S { |
| 17 | 17 | #[rustfmt::skip] |
| 18 | pub(in nonexistent) field: u8 //~ ERROR failed to resolve | |
| 18 | pub(in nonexistent) field: u8 //~ ERROR cannot find | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | struct Z( |
| 22 | 22 | #[rustfmt::skip] |
| 23 | pub(in nonexistent) u8 //~ ERROR failed to resolve | |
| 23 | pub(in nonexistent) u8 //~ ERROR cannot find | |
| 24 | 24 | ); |
| 25 | 25 | |
| 26 | 26 | fn main() {} |
tests/ui/attributes/field-attributes-vis-unresolved.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` | |
| 1 | error[E0433]: cannot find module or crate `nonexistent` in the crate root | |
| 2 | 2 | --> $DIR/field-attributes-vis-unresolved.rs:18:12 |
| 3 | 3 | | |
| 4 | 4 | LL | pub(in nonexistent) field: u8 |
| ... | ... | @@ -9,7 +9,7 @@ help: you might be missing a crate named `nonexistent`, add it to your project a |
| 9 | 9 | LL + extern crate nonexistent; |
| 10 | 10 | | |
| 11 | 11 | |
| 12 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` | |
| 12 | error[E0433]: cannot find module or crate `nonexistent` in the crate root | |
| 13 | 13 | --> $DIR/field-attributes-vis-unresolved.rs:23:12 |
| 14 | 14 | | |
| 15 | 15 | LL | pub(in nonexistent) u8 |
tests/ui/attributes/illegal-macro-use.rs+4-4| ... | ... | @@ -1,15 +1,15 @@ |
| 1 | 1 | // issue#140255 |
| 2 | 2 | |
| 3 | #[macro_use::a] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_use` | |
| 3 | #[macro_use::a] //~ ERROR cannot find | |
| 4 | 4 | fn f0() {} |
| 5 | 5 | |
| 6 | #[macro_use::a::b] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_use` | |
| 6 | #[macro_use::a::b] //~ ERROR cannot find | |
| 7 | 7 | fn f1() {} |
| 8 | 8 | |
| 9 | #[macro_escape::a] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_escape` | |
| 9 | #[macro_escape::a] //~ ERROR cannot find | |
| 10 | 10 | fn f2() {} |
| 11 | 11 | |
| 12 | #[macro_escape::a::b] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `macro_escape` | |
| 12 | #[macro_escape::a::b] //~ ERROR cannot find | |
| 13 | 13 | fn f3() {} |
| 14 | 14 | |
| 15 | 15 | fn main() {} |
tests/ui/attributes/illegal-macro-use.stderr+4-4| ... | ... | @@ -1,22 +1,22 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_escape` | |
| 1 | error[E0433]: cannot find module or crate `macro_escape` in this scope | |
| 2 | 2 | --> $DIR/illegal-macro-use.rs:12:3 |
| 3 | 3 | | |
| 4 | 4 | LL | #[macro_escape::a::b] |
| 5 | 5 | | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `macro_escape` |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_escape` | |
| 7 | error[E0433]: cannot find module or crate `macro_escape` in this scope | |
| 8 | 8 | --> $DIR/illegal-macro-use.rs:9:3 |
| 9 | 9 | | |
| 10 | 10 | LL | #[macro_escape::a] |
| 11 | 11 | | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `macro_escape` |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_use` | |
| 13 | error[E0433]: cannot find module or crate `macro_use` in this scope | |
| 14 | 14 | --> $DIR/illegal-macro-use.rs:6:3 |
| 15 | 15 | | |
| 16 | 16 | LL | #[macro_use::a::b] |
| 17 | 17 | | ^^^^^^^^^ use of unresolved module or unlinked crate `macro_use` |
| 18 | 18 | |
| 19 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `macro_use` | |
| 19 | error[E0433]: cannot find module or crate `macro_use` in this scope | |
| 20 | 20 | --> $DIR/illegal-macro-use.rs:3:3 |
| 21 | 21 | | |
| 22 | 22 | LL | #[macro_use::a] |
tests/ui/attributes/malformed-attrs.rs-1| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | // We enable a bunch of features to not get feature-gate errs in this test. |
| 3 | 3 | #![deny(invalid_doc_attributes)] |
| 4 | 4 | #![feature(rustc_attrs)] |
| 5 | #![feature(rustc_allow_const_fn_unstable)] | |
| 6 | 5 | #![feature(allow_internal_unstable)] |
| 7 | 6 | // FIXME(#82232, #143834): temporarily renamed to mitigate `#[align]` nameres ambiguity |
| 8 | 7 | #![feature(fn_align)] |
tests/ui/attributes/malformed-attrs.stderr+89-89| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0539]: malformed `cfg` attribute input |
| 2 | --> $DIR/malformed-attrs.rs:107:1 | |
| 2 | --> $DIR/malformed-attrs.rs:106:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[cfg] |
| 5 | 5 | | ^^^^^^ |
| ... | ... | @@ -10,7 +10,7 @@ LL | #[cfg] |
| 10 | 10 | = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg-attribute> |
| 11 | 11 | |
| 12 | 12 | error[E0539]: malformed `cfg_attr` attribute input |
| 13 | --> $DIR/malformed-attrs.rs:109:1 | |
| 13 | --> $DIR/malformed-attrs.rs:108:1 | |
| 14 | 14 | | |
| 15 | 15 | LL | #[cfg_attr] |
| 16 | 16 | | ^^^^^^^^^^^ |
| ... | ... | @@ -21,13 +21,13 @@ LL | #[cfg_attr] |
| 21 | 21 | = note: for more information, visit <https://doc.rust-lang.org/reference/conditional-compilation.html#the-cfg_attr-attribute> |
| 22 | 22 | |
| 23 | 23 | error[E0463]: can't find crate for `wloop` |
| 24 | --> $DIR/malformed-attrs.rs:215:1 | |
| 24 | --> $DIR/malformed-attrs.rs:214:1 | |
| 25 | 25 | | |
| 26 | 26 | LL | extern crate wloop; |
| 27 | 27 | | ^^^^^^^^^^^^^^^^^^^ can't find crate |
| 28 | 28 | |
| 29 | 29 | error: malformed `allow` attribute input |
| 30 | --> $DIR/malformed-attrs.rs:181:1 | |
| 30 | --> $DIR/malformed-attrs.rs:180:1 | |
| 31 | 31 | | |
| 32 | 32 | LL | #[allow] |
| 33 | 33 | | ^^^^^^^^ |
| ... | ... | @@ -43,7 +43,7 @@ LL | #[allow(lint1, lint2, lint3, reason = "...")] |
| 43 | 43 | | +++++++++++++++++++++++++++++++++++++ |
| 44 | 44 | |
| 45 | 45 | error: malformed `expect` attribute input |
| 46 | --> $DIR/malformed-attrs.rs:183:1 | |
| 46 | --> $DIR/malformed-attrs.rs:182:1 | |
| 47 | 47 | | |
| 48 | 48 | LL | #[expect] |
| 49 | 49 | | ^^^^^^^^^ |
| ... | ... | @@ -59,7 +59,7 @@ LL | #[expect(lint1, lint2, lint3, reason = "...")] |
| 59 | 59 | | +++++++++++++++++++++++++++++++++++++ |
| 60 | 60 | |
| 61 | 61 | error: malformed `warn` attribute input |
| 62 | --> $DIR/malformed-attrs.rs:185:1 | |
| 62 | --> $DIR/malformed-attrs.rs:184:1 | |
| 63 | 63 | | |
| 64 | 64 | LL | #[warn] |
| 65 | 65 | | ^^^^^^^ |
| ... | ... | @@ -75,7 +75,7 @@ LL | #[warn(lint1, lint2, lint3, reason = "...")] |
| 75 | 75 | | +++++++++++++++++++++++++++++++++++++ |
| 76 | 76 | |
| 77 | 77 | error: malformed `deny` attribute input |
| 78 | --> $DIR/malformed-attrs.rs:187:1 | |
| 78 | --> $DIR/malformed-attrs.rs:186:1 | |
| 79 | 79 | | |
| 80 | 80 | LL | #[deny] |
| 81 | 81 | | ^^^^^^^ |
| ... | ... | @@ -91,7 +91,7 @@ LL | #[deny(lint1, lint2, lint3, reason = "...")] |
| 91 | 91 | | +++++++++++++++++++++++++++++++++++++ |
| 92 | 92 | |
| 93 | 93 | error: malformed `forbid` attribute input |
| 94 | --> $DIR/malformed-attrs.rs:189:1 | |
| 94 | --> $DIR/malformed-attrs.rs:188:1 | |
| 95 | 95 | | |
| 96 | 96 | LL | #[forbid] |
| 97 | 97 | | ^^^^^^^^^ |
| ... | ... | @@ -107,25 +107,25 @@ LL | #[forbid(lint1, lint2, lint3, reason = "...")] |
| 107 | 107 | | +++++++++++++++++++++++++++++++++++++ |
| 108 | 108 | |
| 109 | 109 | error: the `#[proc_macro]` attribute is only usable with crates of the `proc-macro` crate type |
| 110 | --> $DIR/malformed-attrs.rs:104:1 | |
| 110 | --> $DIR/malformed-attrs.rs:103:1 | |
| 111 | 111 | | |
| 112 | 112 | LL | #[proc_macro = 18] |
| 113 | 113 | | ^^^^^^^^^^^^^^^^^^ |
| 114 | 114 | |
| 115 | 115 | error: the `#[proc_macro_attribute]` attribute is only usable with crates of the `proc-macro` crate type |
| 116 | --> $DIR/malformed-attrs.rs:121:1 | |
| 116 | --> $DIR/malformed-attrs.rs:120:1 | |
| 117 | 117 | | |
| 118 | 118 | LL | #[proc_macro_attribute = 19] |
| 119 | 119 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 120 | 120 | |
| 121 | 121 | error: the `#[proc_macro_derive]` attribute is only usable with crates of the `proc-macro` crate type |
| 122 | --> $DIR/malformed-attrs.rs:128:1 | |
| 122 | --> $DIR/malformed-attrs.rs:127:1 | |
| 123 | 123 | | |
| 124 | 124 | LL | #[proc_macro_derive] |
| 125 | 125 | | ^^^^^^^^^^^^^^^^^^^^ |
| 126 | 126 | |
| 127 | 127 | error[E0658]: allow_internal_unsafe side-steps the unsafe_code lint |
| 128 | --> $DIR/malformed-attrs.rs:220:1 | |
| 128 | --> $DIR/malformed-attrs.rs:219:1 | |
| 129 | 129 | | |
| 130 | 130 | LL | #[allow_internal_unsafe = 1] |
| 131 | 131 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -134,7 +134,7 @@ LL | #[allow_internal_unsafe = 1] |
| 134 | 134 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 135 | 135 | |
| 136 | 136 | error[E0539]: malformed `windows_subsystem` attribute input |
| 137 | --> $DIR/malformed-attrs.rs:27:1 | |
| 137 | --> $DIR/malformed-attrs.rs:26:1 | |
| 138 | 138 | | |
| 139 | 139 | LL | #![windows_subsystem] |
| 140 | 140 | | ^^^-----------------^ |
| ... | ... | @@ -150,25 +150,25 @@ LL | #![windows_subsystem = "windows"] |
| 150 | 150 | | +++++++++++ |
| 151 | 151 | |
| 152 | 152 | error[E0539]: malformed `export_name` attribute input |
| 153 | --> $DIR/malformed-attrs.rs:30:1 | |
| 153 | --> $DIR/malformed-attrs.rs:29:1 | |
| 154 | 154 | | |
| 155 | 155 | LL | #[unsafe(export_name)] |
| 156 | 156 | | ^^^^^^^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]` |
| 157 | 157 | |
| 158 | 158 | error: `rustc_allow_const_fn_unstable` expects a list of feature names |
| 159 | --> $DIR/malformed-attrs.rs:32:1 | |
| 159 | --> $DIR/malformed-attrs.rs:31:1 | |
| 160 | 160 | | |
| 161 | 161 | LL | #[rustc_allow_const_fn_unstable] |
| 162 | 162 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 163 | 163 | |
| 164 | 164 | error: `allow_internal_unstable` expects a list of feature names |
| 165 | --> $DIR/malformed-attrs.rs:35:1 | |
| 165 | --> $DIR/malformed-attrs.rs:34:1 | |
| 166 | 166 | | |
| 167 | 167 | LL | #[allow_internal_unstable] |
| 168 | 168 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 169 | 169 | |
| 170 | 170 | error[E0539]: malformed `rustc_confusables` attribute input |
| 171 | --> $DIR/malformed-attrs.rs:37:1 | |
| 171 | --> $DIR/malformed-attrs.rs:36:1 | |
| 172 | 172 | | |
| 173 | 173 | LL | #[rustc_confusables] |
| 174 | 174 | | ^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -177,7 +177,7 @@ LL | #[rustc_confusables] |
| 177 | 177 | | help: must be of the form: `#[rustc_confusables("name1", "name2", ...)]` |
| 178 | 178 | |
| 179 | 179 | error: `#[rustc_confusables]` attribute cannot be used on functions |
| 180 | --> $DIR/malformed-attrs.rs:37:1 | |
| 180 | --> $DIR/malformed-attrs.rs:36:1 | |
| 181 | 181 | | |
| 182 | 182 | LL | #[rustc_confusables] |
| 183 | 183 | | ^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -185,7 +185,7 @@ LL | #[rustc_confusables] |
| 185 | 185 | = help: `#[rustc_confusables]` can only be applied to inherent methods |
| 186 | 186 | |
| 187 | 187 | error[E0539]: malformed `deprecated` attribute input |
| 188 | --> $DIR/malformed-attrs.rs:40:1 | |
| 188 | --> $DIR/malformed-attrs.rs:39:1 | |
| 189 | 189 | | |
| 190 | 190 | LL | #[deprecated = 5] |
| 191 | 191 | | ^^^^^^^^^^^^^^^-^ |
| ... | ... | @@ -193,7 +193,7 @@ LL | #[deprecated = 5] |
| 193 | 193 | | expected a string literal here |
| 194 | 194 | |
| 195 | 195 | error[E0539]: malformed `rustc_macro_transparency` attribute input |
| 196 | --> $DIR/malformed-attrs.rs:44:1 | |
| 196 | --> $DIR/malformed-attrs.rs:43:1 | |
| 197 | 197 | | |
| 198 | 198 | LL | #[rustc_macro_transparency] |
| 199 | 199 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -208,7 +208,7 @@ LL | #[rustc_macro_transparency = "transparent"] |
| 208 | 208 | | +++++++++++++++ |
| 209 | 209 | |
| 210 | 210 | error: `#[rustc_macro_transparency]` attribute cannot be used on functions |
| 211 | --> $DIR/malformed-attrs.rs:44:1 | |
| 211 | --> $DIR/malformed-attrs.rs:43:1 | |
| 212 | 212 | | |
| 213 | 213 | LL | #[rustc_macro_transparency] |
| 214 | 214 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -216,7 +216,7 @@ LL | #[rustc_macro_transparency] |
| 216 | 216 | = help: `#[rustc_macro_transparency]` can only be applied to macro defs |
| 217 | 217 | |
| 218 | 218 | error[E0539]: malformed `repr` attribute input |
| 219 | --> $DIR/malformed-attrs.rs:47:1 | |
| 219 | --> $DIR/malformed-attrs.rs:46:1 | |
| 220 | 220 | | |
| 221 | 221 | LL | #[repr] |
| 222 | 222 | | ^^^^^^^ expected this to be a list |
| ... | ... | @@ -224,7 +224,7 @@ LL | #[repr] |
| 224 | 224 | = note: for more information, visit <https://doc.rust-lang.org/reference/type-layout.html#representations> |
| 225 | 225 | |
| 226 | 226 | error[E0565]: malformed `rustc_as_ptr` attribute input |
| 227 | --> $DIR/malformed-attrs.rs:50:1 | |
| 227 | --> $DIR/malformed-attrs.rs:49:1 | |
| 228 | 228 | | |
| 229 | 229 | LL | #[rustc_as_ptr = 5] |
| 230 | 230 | | ^^^^^^^^^^^^^^^---^ |
| ... | ... | @@ -233,7 +233,7 @@ LL | #[rustc_as_ptr = 5] |
| 233 | 233 | | help: must be of the form: `#[rustc_as_ptr]` |
| 234 | 234 | |
| 235 | 235 | error[E0539]: malformed `rustc_align` attribute input |
| 236 | --> $DIR/malformed-attrs.rs:55:1 | |
| 236 | --> $DIR/malformed-attrs.rs:54:1 | |
| 237 | 237 | | |
| 238 | 238 | LL | #[rustc_align] |
| 239 | 239 | | ^^^^^^^^^^^^^^ |
| ... | ... | @@ -242,7 +242,7 @@ LL | #[rustc_align] |
| 242 | 242 | | help: must be of the form: `#[rustc_align(<alignment in bytes>)]` |
| 243 | 243 | |
| 244 | 244 | error[E0539]: malformed `optimize` attribute input |
| 245 | --> $DIR/malformed-attrs.rs:57:1 | |
| 245 | --> $DIR/malformed-attrs.rs:56:1 | |
| 246 | 246 | | |
| 247 | 247 | LL | #[optimize] |
| 248 | 248 | | ^^^^^^^^^^^ expected this to be a list |
| ... | ... | @@ -257,7 +257,7 @@ LL | #[optimize(speed)] |
| 257 | 257 | | +++++++ |
| 258 | 258 | |
| 259 | 259 | error[E0565]: malformed `cold` attribute input |
| 260 | --> $DIR/malformed-attrs.rs:59:1 | |
| 260 | --> $DIR/malformed-attrs.rs:58:1 | |
| 261 | 261 | | |
| 262 | 262 | LL | #[cold = 1] |
| 263 | 263 | | ^^^^^^^---^ |
| ... | ... | @@ -266,7 +266,7 @@ LL | #[cold = 1] |
| 266 | 266 | | help: must be of the form: `#[cold]` |
| 267 | 267 | |
| 268 | 268 | error[E0539]: malformed `must_use` attribute input |
| 269 | --> $DIR/malformed-attrs.rs:61:1 | |
| 269 | --> $DIR/malformed-attrs.rs:60:1 | |
| 270 | 270 | | |
| 271 | 271 | LL | #[must_use()] |
| 272 | 272 | | ^^^^^^^^^^--^ |
| ... | ... | @@ -284,7 +284,7 @@ LL + #[must_use] |
| 284 | 284 | | |
| 285 | 285 | |
| 286 | 286 | error[E0565]: malformed `no_mangle` attribute input |
| 287 | --> $DIR/malformed-attrs.rs:63:1 | |
| 287 | --> $DIR/malformed-attrs.rs:62:1 | |
| 288 | 288 | | |
| 289 | 289 | LL | #[no_mangle = 1] |
| 290 | 290 | | ^^^^^^^^^^^^---^ |
| ... | ... | @@ -293,7 +293,7 @@ LL | #[no_mangle = 1] |
| 293 | 293 | | help: must be of the form: `#[no_mangle]` |
| 294 | 294 | |
| 295 | 295 | error[E0565]: malformed `naked` attribute input |
| 296 | --> $DIR/malformed-attrs.rs:65:1 | |
| 296 | --> $DIR/malformed-attrs.rs:64:1 | |
| 297 | 297 | | |
| 298 | 298 | LL | #[unsafe(naked())] |
| 299 | 299 | | ^^^^^^^^^^^^^^--^^ |
| ... | ... | @@ -302,7 +302,7 @@ LL | #[unsafe(naked())] |
| 302 | 302 | | help: must be of the form: `#[naked]` |
| 303 | 303 | |
| 304 | 304 | error[E0565]: malformed `track_caller` attribute input |
| 305 | --> $DIR/malformed-attrs.rs:67:1 | |
| 305 | --> $DIR/malformed-attrs.rs:66:1 | |
| 306 | 306 | | |
| 307 | 307 | LL | #[track_caller()] |
| 308 | 308 | | ^^^^^^^^^^^^^^--^ |
| ... | ... | @@ -311,13 +311,13 @@ LL | #[track_caller()] |
| 311 | 311 | | help: must be of the form: `#[track_caller]` |
| 312 | 312 | |
| 313 | 313 | error[E0539]: malformed `export_name` attribute input |
| 314 | --> $DIR/malformed-attrs.rs:69:1 | |
| 314 | --> $DIR/malformed-attrs.rs:68:1 | |
| 315 | 315 | | |
| 316 | 316 | LL | #[export_name()] |
| 317 | 317 | | ^^^^^^^^^^^^^^^^ help: must be of the form: `#[export_name = "name"]` |
| 318 | 318 | |
| 319 | 319 | error[E0805]: malformed `used` attribute input |
| 320 | --> $DIR/malformed-attrs.rs:71:1 | |
| 320 | --> $DIR/malformed-attrs.rs:70:1 | |
| 321 | 321 | | |
| 322 | 322 | LL | #[used()] |
| 323 | 323 | | ^^^^^^--^ |
| ... | ... | @@ -335,7 +335,7 @@ LL + #[used] |
| 335 | 335 | | |
| 336 | 336 | |
| 337 | 337 | error: `#[used]` attribute cannot be used on functions |
| 338 | --> $DIR/malformed-attrs.rs:71:1 | |
| 338 | --> $DIR/malformed-attrs.rs:70:1 | |
| 339 | 339 | | |
| 340 | 340 | LL | #[used()] |
| 341 | 341 | | ^^^^^^^^^ |
| ... | ... | @@ -343,13 +343,13 @@ LL | #[used()] |
| 343 | 343 | = help: `#[used]` can only be applied to statics |
| 344 | 344 | |
| 345 | 345 | error[E0539]: malformed `crate_name` attribute input |
| 346 | --> $DIR/malformed-attrs.rs:74:1 | |
| 346 | --> $DIR/malformed-attrs.rs:73:1 | |
| 347 | 347 | | |
| 348 | 348 | LL | #[crate_name] |
| 349 | 349 | | ^^^^^^^^^^^^^ help: must be of the form: `#[crate_name = "name"]` |
| 350 | 350 | |
| 351 | 351 | error[E0539]: malformed `target_feature` attribute input |
| 352 | --> $DIR/malformed-attrs.rs:79:1 | |
| 352 | --> $DIR/malformed-attrs.rs:78:1 | |
| 353 | 353 | | |
| 354 | 354 | LL | #[target_feature] |
| 355 | 355 | | ^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -358,7 +358,7 @@ LL | #[target_feature] |
| 358 | 358 | | help: must be of the form: `#[target_feature(enable = "feat1, feat2")]` |
| 359 | 359 | |
| 360 | 360 | error[E0565]: malformed `export_stable` attribute input |
| 361 | --> $DIR/malformed-attrs.rs:81:1 | |
| 361 | --> $DIR/malformed-attrs.rs:80:1 | |
| 362 | 362 | | |
| 363 | 363 | LL | #[export_stable = 1] |
| 364 | 364 | | ^^^^^^^^^^^^^^^^---^ |
| ... | ... | @@ -367,7 +367,7 @@ LL | #[export_stable = 1] |
| 367 | 367 | | help: must be of the form: `#[export_stable]` |
| 368 | 368 | |
| 369 | 369 | error[E0539]: malformed `link` attribute input |
| 370 | --> $DIR/malformed-attrs.rs:83:1 | |
| 370 | --> $DIR/malformed-attrs.rs:82:1 | |
| 371 | 371 | | |
| 372 | 372 | LL | #[link] |
| 373 | 373 | | ^^^^^^^ expected this to be a list |
| ... | ... | @@ -375,7 +375,7 @@ LL | #[link] |
| 375 | 375 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link-attribute> |
| 376 | 376 | |
| 377 | 377 | error[E0539]: malformed `link_name` attribute input |
| 378 | --> $DIR/malformed-attrs.rs:87:1 | |
| 378 | --> $DIR/malformed-attrs.rs:86:1 | |
| 379 | 379 | | |
| 380 | 380 | LL | #[link_name] |
| 381 | 381 | | ^^^^^^^^^^^^ help: must be of the form: `#[link_name = "name"]` |
| ... | ... | @@ -383,7 +383,7 @@ LL | #[link_name] |
| 383 | 383 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_name-attribute> |
| 384 | 384 | |
| 385 | 385 | error[E0539]: malformed `link_section` attribute input |
| 386 | --> $DIR/malformed-attrs.rs:91:1 | |
| 386 | --> $DIR/malformed-attrs.rs:90:1 | |
| 387 | 387 | | |
| 388 | 388 | LL | #[link_section] |
| 389 | 389 | | ^^^^^^^^^^^^^^^ help: must be of the form: `#[link_section = "name"]` |
| ... | ... | @@ -391,7 +391,7 @@ LL | #[link_section] |
| 391 | 391 | = note: for more information, visit <https://doc.rust-lang.org/reference/abi.html#the-link_section-attribute> |
| 392 | 392 | |
| 393 | 393 | error[E0539]: malformed `coverage` attribute input |
| 394 | --> $DIR/malformed-attrs.rs:93:1 | |
| 394 | --> $DIR/malformed-attrs.rs:92:1 | |
| 395 | 395 | | |
| 396 | 396 | LL | #[coverage] |
| 397 | 397 | | ^^^^^^^^^^^ this attribute is only valid with either `on` or `off` as an argument |
| ... | ... | @@ -404,13 +404,13 @@ LL | #[coverage(on)] |
| 404 | 404 | | ++++ |
| 405 | 405 | |
| 406 | 406 | error[E0539]: malformed `sanitize` attribute input |
| 407 | --> $DIR/malformed-attrs.rs:95:1 | |
| 407 | --> $DIR/malformed-attrs.rs:94:1 | |
| 408 | 408 | | |
| 409 | 409 | LL | #[sanitize] |
| 410 | 410 | | ^^^^^^^^^^^ expected this to be a list |
| 411 | 411 | |
| 412 | 412 | error[E0565]: malformed `no_implicit_prelude` attribute input |
| 413 | --> $DIR/malformed-attrs.rs:100:1 | |
| 413 | --> $DIR/malformed-attrs.rs:99:1 | |
| 414 | 414 | | |
| 415 | 415 | LL | #[no_implicit_prelude = 23] |
| 416 | 416 | | ^^^^^^^^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -419,7 +419,7 @@ LL | #[no_implicit_prelude = 23] |
| 419 | 419 | | help: must be of the form: `#[no_implicit_prelude]` |
| 420 | 420 | |
| 421 | 421 | error[E0565]: malformed `proc_macro` attribute input |
| 422 | --> $DIR/malformed-attrs.rs:104:1 | |
| 422 | --> $DIR/malformed-attrs.rs:103:1 | |
| 423 | 423 | | |
| 424 | 424 | LL | #[proc_macro = 18] |
| 425 | 425 | | ^^^^^^^^^^^^^----^ |
| ... | ... | @@ -428,7 +428,7 @@ LL | #[proc_macro = 18] |
| 428 | 428 | | help: must be of the form: `#[proc_macro]` |
| 429 | 429 | |
| 430 | 430 | error[E0539]: malformed `instruction_set` attribute input |
| 431 | --> $DIR/malformed-attrs.rs:111:1 | |
| 431 | --> $DIR/malformed-attrs.rs:110:1 | |
| 432 | 432 | | |
| 433 | 433 | LL | #[instruction_set] |
| 434 | 434 | | ^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -439,7 +439,7 @@ LL | #[instruction_set] |
| 439 | 439 | = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/codegen.html#the-instruction_set-attribute> |
| 440 | 440 | |
| 441 | 441 | error[E0539]: malformed `patchable_function_entry` attribute input |
| 442 | --> $DIR/malformed-attrs.rs:113:1 | |
| 442 | --> $DIR/malformed-attrs.rs:112:1 | |
| 443 | 443 | | |
| 444 | 444 | LL | #[patchable_function_entry] |
| 445 | 445 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -448,7 +448,7 @@ LL | #[patchable_function_entry] |
| 448 | 448 | | help: must be of the form: `#[patchable_function_entry(prefix_nops = m, entry_nops = n)]` |
| 449 | 449 | |
| 450 | 450 | error[E0565]: malformed `coroutine` attribute input |
| 451 | --> $DIR/malformed-attrs.rs:116:5 | |
| 451 | --> $DIR/malformed-attrs.rs:115:5 | |
| 452 | 452 | | |
| 453 | 453 | LL | #[coroutine = 63] || {} |
| 454 | 454 | | ^^^^^^^^^^^^----^ |
| ... | ... | @@ -457,7 +457,7 @@ LL | #[coroutine = 63] || {} |
| 457 | 457 | | help: must be of the form: `#[coroutine]` |
| 458 | 458 | |
| 459 | 459 | error[E0565]: malformed `proc_macro_attribute` attribute input |
| 460 | --> $DIR/malformed-attrs.rs:121:1 | |
| 460 | --> $DIR/malformed-attrs.rs:120:1 | |
| 461 | 461 | | |
| 462 | 462 | LL | #[proc_macro_attribute = 19] |
| 463 | 463 | | ^^^^^^^^^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -466,7 +466,7 @@ LL | #[proc_macro_attribute = 19] |
| 466 | 466 | | help: must be of the form: `#[proc_macro_attribute]` |
| 467 | 467 | |
| 468 | 468 | error[E0539]: malformed `must_use` attribute input |
| 469 | --> $DIR/malformed-attrs.rs:124:1 | |
| 469 | --> $DIR/malformed-attrs.rs:123:1 | |
| 470 | 470 | | |
| 471 | 471 | LL | #[must_use = 1] |
| 472 | 472 | | ^^^^^^^^^^^^^-^ |
| ... | ... | @@ -484,7 +484,7 @@ LL + #[must_use] |
| 484 | 484 | | |
| 485 | 485 | |
| 486 | 486 | error[E0539]: malformed `proc_macro_derive` attribute input |
| 487 | --> $DIR/malformed-attrs.rs:128:1 | |
| 487 | --> $DIR/malformed-attrs.rs:127:1 | |
| 488 | 488 | | |
| 489 | 489 | LL | #[proc_macro_derive] |
| 490 | 490 | | ^^^^^^^^^^^^^^^^^^^^ expected this to be a list |
| ... | ... | @@ -498,7 +498,7 @@ LL | #[proc_macro_derive(TraitName, attributes(name1, name2, ...))] |
| 498 | 498 | | ++++++++++++++++++++++++++++++++++++++++++ |
| 499 | 499 | |
| 500 | 500 | error[E0539]: malformed `rustc_layout_scalar_valid_range_start` attribute input |
| 501 | --> $DIR/malformed-attrs.rs:133:1 | |
| 501 | --> $DIR/malformed-attrs.rs:132:1 | |
| 502 | 502 | | |
| 503 | 503 | LL | #[rustc_layout_scalar_valid_range_start] |
| 504 | 504 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -507,7 +507,7 @@ LL | #[rustc_layout_scalar_valid_range_start] |
| 507 | 507 | | help: must be of the form: `#[rustc_layout_scalar_valid_range_start(start)]` |
| 508 | 508 | |
| 509 | 509 | error[E0539]: malformed `rustc_layout_scalar_valid_range_end` attribute input |
| 510 | --> $DIR/malformed-attrs.rs:135:1 | |
| 510 | --> $DIR/malformed-attrs.rs:134:1 | |
| 511 | 511 | | |
| 512 | 512 | LL | #[rustc_layout_scalar_valid_range_end] |
| 513 | 513 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -516,7 +516,7 @@ LL | #[rustc_layout_scalar_valid_range_end] |
| 516 | 516 | | help: must be of the form: `#[rustc_layout_scalar_valid_range_end(end)]` |
| 517 | 517 | |
| 518 | 518 | error[E0539]: malformed `must_not_suspend` attribute input |
| 519 | --> $DIR/malformed-attrs.rs:137:1 | |
| 519 | --> $DIR/malformed-attrs.rs:136:1 | |
| 520 | 520 | | |
| 521 | 521 | LL | #[must_not_suspend()] |
| 522 | 522 | | ^^^^^^^^^^^^^^^^^^--^ |
| ... | ... | @@ -532,7 +532,7 @@ LL + #[must_not_suspend] |
| 532 | 532 | | |
| 533 | 533 | |
| 534 | 534 | error[E0539]: malformed `cfi_encoding` attribute input |
| 535 | --> $DIR/malformed-attrs.rs:139:1 | |
| 535 | --> $DIR/malformed-attrs.rs:138:1 | |
| 536 | 536 | | |
| 537 | 537 | LL | #[cfi_encoding = ""] |
| 538 | 538 | | ^^^^^^^^^^^^^^^^^--^ |
| ... | ... | @@ -541,7 +541,7 @@ LL | #[cfi_encoding = ""] |
| 541 | 541 | | help: must be of the form: `#[cfi_encoding = "encoding"]` |
| 542 | 542 | |
| 543 | 543 | error[E0565]: malformed `marker` attribute input |
| 544 | --> $DIR/malformed-attrs.rs:158:1 | |
| 544 | --> $DIR/malformed-attrs.rs:157:1 | |
| 545 | 545 | | |
| 546 | 546 | LL | #[marker = 3] |
| 547 | 547 | | ^^^^^^^^^---^ |
| ... | ... | @@ -550,7 +550,7 @@ LL | #[marker = 3] |
| 550 | 550 | | help: must be of the form: `#[marker]` |
| 551 | 551 | |
| 552 | 552 | error[E0565]: malformed `fundamental` attribute input |
| 553 | --> $DIR/malformed-attrs.rs:160:1 | |
| 553 | --> $DIR/malformed-attrs.rs:159:1 | |
| 554 | 554 | | |
| 555 | 555 | LL | #[fundamental()] |
| 556 | 556 | | ^^^^^^^^^^^^^--^ |
| ... | ... | @@ -559,7 +559,7 @@ LL | #[fundamental()] |
| 559 | 559 | | help: must be of the form: `#[fundamental]` |
| 560 | 560 | |
| 561 | 561 | error[E0565]: malformed `ffi_pure` attribute input |
| 562 | --> $DIR/malformed-attrs.rs:168:5 | |
| 562 | --> $DIR/malformed-attrs.rs:167:5 | |
| 563 | 563 | | |
| 564 | 564 | LL | #[unsafe(ffi_pure = 1)] |
| 565 | 565 | | ^^^^^^^^^^^^^^^^^^---^^ |
| ... | ... | @@ -568,7 +568,7 @@ LL | #[unsafe(ffi_pure = 1)] |
| 568 | 568 | | help: must be of the form: `#[ffi_pure]` |
| 569 | 569 | |
| 570 | 570 | error[E0539]: malformed `link_ordinal` attribute input |
| 571 | --> $DIR/malformed-attrs.rs:170:5 | |
| 571 | --> $DIR/malformed-attrs.rs:169:5 | |
| 572 | 572 | | |
| 573 | 573 | LL | #[link_ordinal] |
| 574 | 574 | | ^^^^^^^^^^^^^^^ |
| ... | ... | @@ -579,7 +579,7 @@ LL | #[link_ordinal] |
| 579 | 579 | = note: for more information, visit <https://doc.rust-lang.org/reference/items/external-blocks.html#the-link_ordinal-attribute> |
| 580 | 580 | |
| 581 | 581 | error[E0565]: malformed `ffi_const` attribute input |
| 582 | --> $DIR/malformed-attrs.rs:174:5 | |
| 582 | --> $DIR/malformed-attrs.rs:173:5 | |
| 583 | 583 | | |
| 584 | 584 | LL | #[unsafe(ffi_const = 1)] |
| 585 | 585 | | ^^^^^^^^^^^^^^^^^^^---^^ |
| ... | ... | @@ -588,13 +588,13 @@ LL | #[unsafe(ffi_const = 1)] |
| 588 | 588 | | help: must be of the form: `#[ffi_const]` |
| 589 | 589 | |
| 590 | 590 | error[E0539]: malformed `linkage` attribute input |
| 591 | --> $DIR/malformed-attrs.rs:176:5 | |
| 591 | --> $DIR/malformed-attrs.rs:175:5 | |
| 592 | 592 | | |
| 593 | 593 | LL | #[linkage] |
| 594 | 594 | | ^^^^^^^^^^ expected this to be of the form `linkage = "..."` |
| 595 | 595 | |
| 596 | 596 | error[E0539]: malformed `debugger_visualizer` attribute input |
| 597 | --> $DIR/malformed-attrs.rs:191:1 | |
| 597 | --> $DIR/malformed-attrs.rs:190:1 | |
| 598 | 598 | | |
| 599 | 599 | LL | #[debugger_visualizer] |
| 600 | 600 | | ^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -605,7 +605,7 @@ LL | #[debugger_visualizer] |
| 605 | 605 | = note: for more information, visit <https://doc.rust-lang.org/reference/attributes/debugger.html#the-debugger_visualizer-attribute> |
| 606 | 606 | |
| 607 | 607 | error[E0565]: malformed `automatically_derived` attribute input |
| 608 | --> $DIR/malformed-attrs.rs:193:1 | |
| 608 | --> $DIR/malformed-attrs.rs:192:1 | |
| 609 | 609 | | |
| 610 | 610 | LL | #[automatically_derived = 18] |
| 611 | 611 | | ^^^^^^^^^^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -614,7 +614,7 @@ LL | #[automatically_derived = 18] |
| 614 | 614 | | help: must be of the form: `#[automatically_derived]` |
| 615 | 615 | |
| 616 | 616 | error[E0565]: malformed `non_exhaustive` attribute input |
| 617 | --> $DIR/malformed-attrs.rs:201:1 | |
| 617 | --> $DIR/malformed-attrs.rs:200:1 | |
| 618 | 618 | | |
| 619 | 619 | LL | #[non_exhaustive = 1] |
| 620 | 620 | | ^^^^^^^^^^^^^^^^^---^ |
| ... | ... | @@ -623,7 +623,7 @@ LL | #[non_exhaustive = 1] |
| 623 | 623 | | help: must be of the form: `#[non_exhaustive]` |
| 624 | 624 | |
| 625 | 625 | error[E0565]: malformed `thread_local` attribute input |
| 626 | --> $DIR/malformed-attrs.rs:207:1 | |
| 626 | --> $DIR/malformed-attrs.rs:206:1 | |
| 627 | 627 | | |
| 628 | 628 | LL | #[thread_local()] |
| 629 | 629 | | ^^^^^^^^^^^^^^--^ |
| ... | ... | @@ -632,7 +632,7 @@ LL | #[thread_local()] |
| 632 | 632 | | help: must be of the form: `#[thread_local]` |
| 633 | 633 | |
| 634 | 634 | error[E0565]: malformed `no_link` attribute input |
| 635 | --> $DIR/malformed-attrs.rs:211:1 | |
| 635 | --> $DIR/malformed-attrs.rs:210:1 | |
| 636 | 636 | | |
| 637 | 637 | LL | #[no_link()] |
| 638 | 638 | | ^^^^^^^^^--^ |
| ... | ... | @@ -641,7 +641,7 @@ LL | #[no_link()] |
| 641 | 641 | | help: must be of the form: `#[no_link]` |
| 642 | 642 | |
| 643 | 643 | error[E0539]: malformed `macro_use` attribute input |
| 644 | --> $DIR/malformed-attrs.rs:213:1 | |
| 644 | --> $DIR/malformed-attrs.rs:212:1 | |
| 645 | 645 | | |
| 646 | 646 | LL | #[macro_use = 1] |
| 647 | 647 | | ^^^^^^^^^^^^---^ |
| ... | ... | @@ -659,7 +659,7 @@ LL + #[macro_use] |
| 659 | 659 | | |
| 660 | 660 | |
| 661 | 661 | error[E0539]: malformed `macro_export` attribute input |
| 662 | --> $DIR/malformed-attrs.rs:218:1 | |
| 662 | --> $DIR/malformed-attrs.rs:217:1 | |
| 663 | 663 | | |
| 664 | 664 | LL | #[macro_export = 18] |
| 665 | 665 | | ^^^^^^^^^^^^^^^----^ |
| ... | ... | @@ -676,7 +676,7 @@ LL + #[macro_export] |
| 676 | 676 | | |
| 677 | 677 | |
| 678 | 678 | error[E0565]: malformed `allow_internal_unsafe` attribute input |
| 679 | --> $DIR/malformed-attrs.rs:220:1 | |
| 679 | --> $DIR/malformed-attrs.rs:219:1 | |
| 680 | 680 | | |
| 681 | 681 | LL | #[allow_internal_unsafe = 1] |
| 682 | 682 | | ^^^^^^^^^^^^^^^^^^^^^^^^---^ |
| ... | ... | @@ -685,7 +685,7 @@ LL | #[allow_internal_unsafe = 1] |
| 685 | 685 | | help: must be of the form: `#[allow_internal_unsafe]` |
| 686 | 686 | |
| 687 | 687 | error: attribute should be applied to `const fn` |
| 688 | --> $DIR/malformed-attrs.rs:32:1 | |
| 688 | --> $DIR/malformed-attrs.rs:31:1 | |
| 689 | 689 | | |
| 690 | 690 | LL | #[rustc_allow_const_fn_unstable] |
| 691 | 691 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -697,7 +697,7 @@ LL | | } |
| 697 | 697 | | |_- not a `const fn` |
| 698 | 698 | |
| 699 | 699 | warning: attribute should be applied to an `extern` block with non-Rust ABI |
| 700 | --> $DIR/malformed-attrs.rs:83:1 | |
| 700 | --> $DIR/malformed-attrs.rs:82:1 | |
| 701 | 701 | | |
| 702 | 702 | LL | #[link] |
| 703 | 703 | | ^^^^^^^ |
| ... | ... | @@ -712,19 +712,19 @@ LL | | } |
| 712 | 712 | = note: requested on the command line with `-W unused-attributes` |
| 713 | 713 | |
| 714 | 714 | error: `#[repr(align(...))]` is not supported on functions |
| 715 | --> $DIR/malformed-attrs.rs:47:1 | |
| 715 | --> $DIR/malformed-attrs.rs:46:1 | |
| 716 | 716 | | |
| 717 | 717 | LL | #[repr] |
| 718 | 718 | | ^^^^^^^ |
| 719 | 719 | | |
| 720 | 720 | help: use `#[rustc_align(...)]` instead |
| 721 | --> $DIR/malformed-attrs.rs:47:1 | |
| 721 | --> $DIR/malformed-attrs.rs:46:1 | |
| 722 | 722 | | |
| 723 | 723 | LL | #[repr] |
| 724 | 724 | | ^^^^^^^ |
| 725 | 725 | |
| 726 | 726 | warning: missing options for `on_unimplemented` attribute |
| 727 | --> $DIR/malformed-attrs.rs:143:1 | |
| 727 | --> $DIR/malformed-attrs.rs:142:1 | |
| 728 | 728 | | |
| 729 | 729 | LL | #[diagnostic::on_unimplemented] |
| 730 | 730 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -733,7 +733,7 @@ LL | #[diagnostic::on_unimplemented] |
| 733 | 733 | = note: `#[warn(malformed_diagnostic_attributes)]` (part of `#[warn(unknown_or_malformed_diagnostic_attributes)]`) on by default |
| 734 | 734 | |
| 735 | 735 | warning: malformed `on_unimplemented` attribute |
| 736 | --> $DIR/malformed-attrs.rs:145:1 | |
| 736 | --> $DIR/malformed-attrs.rs:144:1 | |
| 737 | 737 | | |
| 738 | 738 | LL | #[diagnostic::on_unimplemented = 1] |
| 739 | 739 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ invalid option found here |
| ... | ... | @@ -741,7 +741,7 @@ LL | #[diagnostic::on_unimplemented = 1] |
| 741 | 741 | = help: only `message`, `note` and `label` are allowed as options |
| 742 | 742 | |
| 743 | 743 | error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]` |
| 744 | --> $DIR/malformed-attrs.rs:42:1 | |
| 744 | --> $DIR/malformed-attrs.rs:41:1 | |
| 745 | 745 | | |
| 746 | 746 | LL | #[doc] |
| 747 | 747 | | ^^^^^^ |
| ... | ... | @@ -753,7 +753,7 @@ LL | #![deny(invalid_doc_attributes)] |
| 753 | 753 | | ^^^^^^^^^^^^^^^^^^^^^^ |
| 754 | 754 | |
| 755 | 755 | error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]` |
| 756 | --> $DIR/malformed-attrs.rs:52:1 | |
| 756 | --> $DIR/malformed-attrs.rs:51:1 | |
| 757 | 757 | | |
| 758 | 758 | LL | #[inline = 5] |
| 759 | 759 | | ^^^^^^^^^^^^^ |
| ... | ... | @@ -763,13 +763,13 @@ LL | #[inline = 5] |
| 763 | 763 | = note: `#[deny(ill_formed_attribute_input)]` (part of `#[deny(future_incompatible)]`) on by default |
| 764 | 764 | |
| 765 | 765 | warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![crate_name]` |
| 766 | --> $DIR/malformed-attrs.rs:74:1 | |
| 766 | --> $DIR/malformed-attrs.rs:73:1 | |
| 767 | 767 | | |
| 768 | 768 | LL | #[crate_name] |
| 769 | 769 | | ^^^^^^^^^^^^^ |
| 770 | 770 | | |
| 771 | 771 | note: this attribute does not have an `!`, which means it is applied to this function |
| 772 | --> $DIR/malformed-attrs.rs:115:1 | |
| 772 | --> $DIR/malformed-attrs.rs:114:1 | |
| 773 | 773 | | |
| 774 | 774 | LL | / fn test() { |
| 775 | 775 | LL | | #[coroutine = 63] || {} |
| ... | ... | @@ -778,13 +778,13 @@ LL | | } |
| 778 | 778 | | |_^ |
| 779 | 779 | |
| 780 | 780 | error: valid forms for the attribute are `#[doc = "string"]`, `#[doc(alias)]`, `#[doc(attribute)]`, `#[doc(auto_cfg)]`, `#[doc(cfg)]`, `#[doc(fake_variadic)]`, `#[doc(hidden)]`, `#[doc(html_favicon_url)]`, `#[doc(html_logo_url)]`, `#[doc(html_no_source)]`, `#[doc(html_playground_url)]`, `#[doc(html_root_url)]`, `#[doc(include)]`, `#[doc(inline)]`, `#[doc(issue_tracker_base_url)]`, `#[doc(keyword)]`, `#[doc(masked)]`, `#[doc(no_default_passes)]`, `#[doc(no_inline)]`, `#[doc(notable_trait)]`, `#[doc(passes)]`, `#[doc(plugins)]`, `#[doc(rust_logo)]`, `#[doc(search_unbox)]`, `#[doc(spotlight)]`, and `#[doc(test)]` |
| 781 | --> $DIR/malformed-attrs.rs:77:1 | |
| 781 | --> $DIR/malformed-attrs.rs:76:1 | |
| 782 | 782 | | |
| 783 | 783 | LL | #[doc] |
| 784 | 784 | | ^^^^^^ |
| 785 | 785 | |
| 786 | 786 | warning: `#[link_name]` attribute cannot be used on functions |
| 787 | --> $DIR/malformed-attrs.rs:87:1 | |
| 787 | --> $DIR/malformed-attrs.rs:86:1 | |
| 788 | 788 | | |
| 789 | 789 | LL | #[link_name] |
| 790 | 790 | | ^^^^^^^^^^^^ |
| ... | ... | @@ -793,7 +793,7 @@ LL | #[link_name] |
| 793 | 793 | = help: `#[link_name]` can be applied to foreign functions and foreign statics |
| 794 | 794 | |
| 795 | 795 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 796 | --> $DIR/malformed-attrs.rs:97:1 | |
| 796 | --> $DIR/malformed-attrs.rs:96:1 | |
| 797 | 797 | | |
| 798 | 798 | LL | #[ignore()] |
| 799 | 799 | | ^^^^^^^^^^^ |
| ... | ... | @@ -802,7 +802,7 @@ LL | #[ignore()] |
| 802 | 802 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> |
| 803 | 803 | |
| 804 | 804 | warning: `#[no_implicit_prelude]` attribute cannot be used on functions |
| 805 | --> $DIR/malformed-attrs.rs:100:1 | |
| 805 | --> $DIR/malformed-attrs.rs:99:1 | |
| 806 | 806 | | |
| 807 | 807 | LL | #[no_implicit_prelude = 23] |
| 808 | 808 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -811,13 +811,13 @@ LL | #[no_implicit_prelude = 23] |
| 811 | 811 | = help: `#[no_implicit_prelude]` can be applied to crates and modules |
| 812 | 812 | |
| 813 | 813 | warning: `#[diagnostic::do_not_recommend]` does not expect any arguments |
| 814 | --> $DIR/malformed-attrs.rs:152:1 | |
| 814 | --> $DIR/malformed-attrs.rs:151:1 | |
| 815 | 815 | | |
| 816 | 816 | LL | #[diagnostic::do_not_recommend()] |
| 817 | 817 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 818 | 818 | |
| 819 | 819 | warning: `#[automatically_derived]` attribute cannot be used on modules |
| 820 | --> $DIR/malformed-attrs.rs:193:1 | |
| 820 | --> $DIR/malformed-attrs.rs:192:1 | |
| 821 | 821 | | |
| 822 | 822 | LL | #[automatically_derived = 18] |
| 823 | 823 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| ... | ... | @@ -826,7 +826,7 @@ LL | #[automatically_derived = 18] |
| 826 | 826 | = help: `#[automatically_derived]` can only be applied to trait impl blocks |
| 827 | 827 | |
| 828 | 828 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 829 | --> $DIR/malformed-attrs.rs:227:1 | |
| 829 | --> $DIR/malformed-attrs.rs:226:1 | |
| 830 | 830 | | |
| 831 | 831 | LL | #[ignore = 1] |
| 832 | 832 | | ^^^^^^^^^^^^^ |
| ... | ... | @@ -835,7 +835,7 @@ LL | #[ignore = 1] |
| 835 | 835 | = note: for more information, see issue #57571 <https://github.com/rust-lang/rust/issues/57571> |
| 836 | 836 | |
| 837 | 837 | error[E0308]: mismatched types |
| 838 | --> $DIR/malformed-attrs.rs:116:23 | |
| 838 | --> $DIR/malformed-attrs.rs:115:23 | |
| 839 | 839 | | |
| 840 | 840 | LL | fn test() { |
| 841 | 841 | | - help: a return type might be missing here: `-> _` |
| ... | ... | @@ -843,7 +843,7 @@ LL | #[coroutine = 63] || {} |
| 843 | 843 | | ^^^^^ expected `()`, found coroutine |
| 844 | 844 | | |
| 845 | 845 | = note: expected unit type `()` |
| 846 | found coroutine `{coroutine@$DIR/malformed-attrs.rs:116:23: 116:25}` | |
| 846 | found coroutine `{coroutine@$DIR/malformed-attrs.rs:115:23: 115:25}` | |
| 847 | 847 | |
| 848 | 848 | error: aborting due to 75 previous errors; 8 warnings emitted |
| 849 | 849 | |
| ... | ... | @@ -851,7 +851,7 @@ Some errors have detailed explanations: E0308, E0463, E0539, E0565, E0658, E0805 |
| 851 | 851 | For more information about an error, try `rustc --explain E0308`. |
| 852 | 852 | Future incompatibility report: Future breakage diagnostic: |
| 853 | 853 | error: valid forms for the attribute are `#[inline(always)]`, `#[inline(never)]`, and `#[inline]` |
| 854 | --> $DIR/malformed-attrs.rs:52:1 | |
| 854 | --> $DIR/malformed-attrs.rs:51:1 | |
| 855 | 855 | | |
| 856 | 856 | LL | #[inline = 5] |
| 857 | 857 | | ^^^^^^^^^^^^^ |
| ... | ... | @@ -862,7 +862,7 @@ LL | #[inline = 5] |
| 862 | 862 | |
| 863 | 863 | Future breakage diagnostic: |
| 864 | 864 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 865 | --> $DIR/malformed-attrs.rs:97:1 | |
| 865 | --> $DIR/malformed-attrs.rs:96:1 | |
| 866 | 866 | | |
| 867 | 867 | LL | #[ignore()] |
| 868 | 868 | | ^^^^^^^^^^^ |
| ... | ... | @@ -873,7 +873,7 @@ LL | #[ignore()] |
| 873 | 873 | |
| 874 | 874 | Future breakage diagnostic: |
| 875 | 875 | error: valid forms for the attribute are `#[ignore = "reason"]` and `#[ignore]` |
| 876 | --> $DIR/malformed-attrs.rs:227:1 | |
| 876 | --> $DIR/malformed-attrs.rs:226:1 | |
| 877 | 877 | | |
| 878 | 878 | LL | #[ignore = 1] |
| 879 | 879 | | ^^^^^^^^^^^^^ |
tests/ui/attributes/use-doc-alias-name.rs+2-2| ... | ... | @@ -42,7 +42,7 @@ fn main() { |
| 42 | 42 | //~| HELP: `S5` has a name defined in the doc alias attribute as `DocAliasS5` |
| 43 | 43 | |
| 44 | 44 | not_exist_module::DocAliasS1; |
| 45 | //~^ ERROR: use of unresolved module or unlinked crate `not_exist_module` | |
| 45 | //~^ ERROR: cannot find module or crate `not_exist_module` | |
| 46 | 46 | //~| HELP: you might be missing a crate named `not_exist_module` |
| 47 | 47 | |
| 48 | 48 | use_doc_alias_name_extern::DocAliasS1; |
| ... | ... | @@ -50,7 +50,7 @@ fn main() { |
| 50 | 50 | //~| HELP: `S1` has a name defined in the doc alias attribute as `DocAliasS1` |
| 51 | 51 | |
| 52 | 52 | m::n::DocAliasX::y::S6; |
| 53 | //~^ ERROR: could not find `DocAliasX` in `n` | |
| 53 | //~^ ERROR: cannot find `DocAliasX` in `n` | |
| 54 | 54 | //~| HELP: `x` has a name defined in the doc alias attribute as `DocAliasX` |
| 55 | 55 | |
| 56 | 56 | m::n::x::y::DocAliasS6; |
tests/ui/attributes/use-doc-alias-name.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `DocAliasX` in `n` | |
| 1 | error[E0433]: cannot find `DocAliasX` in `n` | |
| 2 | 2 | --> $DIR/use-doc-alias-name.rs:52:11 |
| 3 | 3 | | |
| 4 | 4 | LL | m::n::DocAliasX::y::S6; |
| ... | ... | @@ -136,7 +136,7 @@ LL - doc_alias_f2(); |
| 136 | 136 | LL + f(); |
| 137 | 137 | | |
| 138 | 138 | |
| 139 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `not_exist_module` | |
| 139 | error[E0433]: cannot find module or crate `not_exist_module` in this scope | |
| 140 | 140 | --> $DIR/use-doc-alias-name.rs:44:5 |
| 141 | 141 | | |
| 142 | 142 | LL | not_exist_module::DocAliasS1; |
tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.rs+2-2| ... | ... | @@ -4,9 +4,9 @@ |
| 4 | 4 | |
| 5 | 5 | fn main() { |
| 6 | 6 | let mut a = E::StructVar { boxed: Box::new(5_i32) }; |
| 7 | //~^ ERROR failed to resolve: use of undeclared type `E` | |
| 7 | //~^ ERROR cannot find type `E` | |
| 8 | 8 | match a { |
| 9 | 9 | E::StructVar { box boxed } => { } |
| 10 | //~^ ERROR failed to resolve: use of undeclared type `E` | |
| 10 | //~^ ERROR cannot find type `E` | |
| 11 | 11 | } |
| 12 | 12 | } |
tests/ui/borrowck/non-ADT-struct-pattern-box-pattern-ice-121463.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `E` | |
| 1 | error[E0433]: cannot find type `E` in this scope | |
| 2 | 2 | --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:6:17 |
| 3 | 3 | | |
| 4 | 4 | LL | let mut a = E::StructVar { boxed: Box::new(5_i32) }; |
| ... | ... | @@ -9,7 +9,7 @@ help: a trait with a similar name exists |
| 9 | 9 | LL | let mut a = Eq::StructVar { boxed: Box::new(5_i32) }; |
| 10 | 10 | | + |
| 11 | 11 | |
| 12 | error[E0433]: failed to resolve: use of undeclared type `E` | |
| 12 | error[E0433]: cannot find type `E` in this scope | |
| 13 | 13 | --> $DIR/non-ADT-struct-pattern-box-pattern-ice-121463.rs:9:9 |
| 14 | 14 | | |
| 15 | 15 | LL | E::StructVar { box boxed } => { } |
tests/ui/cfg/diagnostics-cross-crate.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ fn main() { |
| 14 | 14 | |
| 15 | 15 | // The module isn't found - we would like to get a diagnostic, but currently don't due to |
| 16 | 16 | // the awkward way the resolver diagnostics are currently implemented. |
| 17 | cfged_out::inner::doesnt_exist::hello(); //~ ERROR failed to resolve | |
| 17 | cfged_out::inner::doesnt_exist::hello(); //~ ERROR cannot find | |
| 18 | 18 | //~^ NOTE could not find `doesnt_exist` in `inner` |
| 19 | 19 | //~| NOTE found an item that was configured out |
| 20 | 20 |
tests/ui/cfg/diagnostics-cross-crate.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner` | |
| 1 | error[E0433]: cannot find `doesnt_exist` in `inner` | |
| 2 | 2 | --> $DIR/diagnostics-cross-crate.rs:17:23 |
| 3 | 3 | | |
| 4 | 4 | LL | cfged_out::inner::doesnt_exist::hello(); |
tests/ui/cfg/diagnostics-reexport-2.rs+5-5| ... | ... | @@ -40,22 +40,22 @@ mod reexport32 { |
| 40 | 40 | |
| 41 | 41 | fn main() { |
| 42 | 42 | reexport::gated::foo(); |
| 43 | //~^ ERROR failed to resolve: could not find `gated` in `reexport` | |
| 43 | //~^ ERROR cannot find | |
| 44 | 44 | //~| NOTE could not find `gated` in `reexport` |
| 45 | 45 | |
| 46 | 46 | reexport2::gated::foo(); |
| 47 | //~^ ERROR failed to resolve: could not find `gated` in `reexport2` | |
| 47 | //~^ ERROR cannot find | |
| 48 | 48 | //~| NOTE could not find `gated` in `reexport2` |
| 49 | 49 | |
| 50 | 50 | reexport30::gated::foo(); |
| 51 | //~^ ERROR failed to resolve: could not find `gated` in `reexport30` | |
| 51 | //~^ ERROR cannot find | |
| 52 | 52 | //~| NOTE could not find `gated` in `reexport30` |
| 53 | 53 | |
| 54 | 54 | reexport31::gated::foo(); |
| 55 | //~^ ERROR failed to resolve: could not find `gated` in `reexport31` | |
| 55 | //~^ ERROR cannot find | |
| 56 | 56 | //~| NOTE could not find `gated` in `reexport31` |
| 57 | 57 | |
| 58 | 58 | reexport32::gated::foo(); |
| 59 | //~^ ERROR failed to resolve: could not find `gated` in `reexport32` | |
| 59 | //~^ ERROR cannot find | |
| 60 | 60 | //~| NOTE could not find `gated` in `reexport32` |
| 61 | 61 | } |
tests/ui/cfg/diagnostics-reexport-2.stderr+5-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `gated` in `reexport` | |
| 1 | error[E0433]: cannot find `gated` in `reexport` | |
| 2 | 2 | --> $DIR/diagnostics-reexport-2.rs:42:15 |
| 3 | 3 | | |
| 4 | 4 | LL | reexport::gated::foo(); |
| ... | ... | @@ -13,7 +13,7 @@ LL | #[cfg(false)] |
| 13 | 13 | LL | pub mod gated { |
| 14 | 14 | | ^^^^^ |
| 15 | 15 | |
| 16 | error[E0433]: failed to resolve: could not find `gated` in `reexport2` | |
| 16 | error[E0433]: cannot find `gated` in `reexport2` | |
| 17 | 17 | --> $DIR/diagnostics-reexport-2.rs:46:16 |
| 18 | 18 | | |
| 19 | 19 | LL | reexport2::gated::foo(); |
| ... | ... | @@ -28,7 +28,7 @@ LL | #[cfg(false)] |
| 28 | 28 | LL | pub mod gated { |
| 29 | 29 | | ^^^^^ |
| 30 | 30 | |
| 31 | error[E0433]: failed to resolve: could not find `gated` in `reexport30` | |
| 31 | error[E0433]: cannot find `gated` in `reexport30` | |
| 32 | 32 | --> $DIR/diagnostics-reexport-2.rs:50:17 |
| 33 | 33 | | |
| 34 | 34 | LL | reexport30::gated::foo(); |
| ... | ... | @@ -43,7 +43,7 @@ LL | #[cfg(false)] |
| 43 | 43 | LL | pub mod gated { |
| 44 | 44 | | ^^^^^ |
| 45 | 45 | |
| 46 | error[E0433]: failed to resolve: could not find `gated` in `reexport31` | |
| 46 | error[E0433]: cannot find `gated` in `reexport31` | |
| 47 | 47 | --> $DIR/diagnostics-reexport-2.rs:54:17 |
| 48 | 48 | | |
| 49 | 49 | LL | reexport31::gated::foo(); |
| ... | ... | @@ -58,7 +58,7 @@ LL | #[cfg(false)] |
| 58 | 58 | LL | pub mod gated { |
| 59 | 59 | | ^^^^^ |
| 60 | 60 | |
| 61 | error[E0433]: failed to resolve: could not find `gated` in `reexport32` | |
| 61 | error[E0433]: cannot find `gated` in `reexport32` | |
| 62 | 62 | --> $DIR/diagnostics-reexport-2.rs:58:17 |
| 63 | 63 | | |
| 64 | 64 | LL | reexport32::gated::foo(); |
tests/ui/cfg/diagnostics-same-crate.rs+1-1| ... | ... | @@ -50,7 +50,7 @@ fn main() { |
| 50 | 50 | //~| NOTE not found in `inner` |
| 51 | 51 | |
| 52 | 52 | // The module isn't found - we get a diagnostic. |
| 53 | inner::doesnt_exist::hello(); //~ ERROR failed to resolve | |
| 53 | inner::doesnt_exist::hello(); //~ ERROR cannot find | |
| 54 | 54 | //~| NOTE could not find `doesnt_exist` in `inner` |
| 55 | 55 | |
| 56 | 56 | // It should find the one in the right module, not the wrong one. |
tests/ui/cfg/diagnostics-same-crate.stderr+1-1| ... | ... | @@ -28,7 +28,7 @@ LL | #[cfg(false)] |
| 28 | 28 | LL | pub mod doesnt_exist { |
| 29 | 29 | | ^^^^^^^^^^^^ |
| 30 | 30 | |
| 31 | error[E0433]: failed to resolve: could not find `doesnt_exist` in `inner` | |
| 31 | error[E0433]: cannot find `doesnt_exist` in `inner` | |
| 32 | 32 | --> $DIR/diagnostics-same-crate.rs:53:12 |
| 33 | 33 | | |
| 34 | 34 | LL | inner::doesnt_exist::hello(); |
tests/ui/coherence/conflicting-impl-with-err.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | struct ErrorKind; |
| 2 | 2 | struct Error(ErrorKind); |
| 3 | 3 | |
| 4 | impl From<nope::Thing> for Error { //~ ERROR failed to resolve | |
| 5 | fn from(_: nope::Thing) -> Self { //~ ERROR failed to resolve | |
| 4 | impl From<nope::Thing> for Error { //~ ERROR cannot find | |
| 5 | fn from(_: nope::Thing) -> Self { //~ ERROR cannot find | |
| 6 | 6 | unimplemented!() |
| 7 | 7 | } |
| 8 | 8 | } |
tests/ui/coherence/conflicting-impl-with-err.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope` | |
| 1 | error[E0433]: cannot find module or crate `nope` in this scope | |
| 2 | 2 | --> $DIR/conflicting-impl-with-err.rs:4:11 |
| 3 | 3 | | |
| 4 | 4 | LL | impl From<nope::Thing> for Error { |
| ... | ... | @@ -6,7 +6,7 @@ LL | impl From<nope::Thing> for Error { |
| 6 | 6 | | |
| 7 | 7 | = help: you might be missing a crate named `nope` |
| 8 | 8 | |
| 9 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nope` | |
| 9 | error[E0433]: cannot find module or crate `nope` in this scope | |
| 10 | 10 | --> $DIR/conflicting-impl-with-err.rs:5:16 |
| 11 | 11 | | |
| 12 | 12 | LL | fn from(_: nope::Thing) -> Self { |
tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ where |
| 11 | 11 | //~^ ERROR only lifetime parameters can be used in this context |
| 12 | 12 | //~| ERROR defaults for generic parameters are not allowed in `for<...>` binders |
| 13 | 13 | //~| ERROR defaults for generic parameters are not allowed in `for<...>` binders |
| 14 | //~| ERROR failed to resolve: use of undeclared type `COT` | |
| 14 | //~| ERROR cannot find | |
| 15 | 15 | //~| ERROR the name `N` is already used for a generic parameter in this item's generic parameters |
| 16 | 16 | { |
| 17 | 17 | } |
tests/ui/const-generics/generic_const_exprs/ice-predicates-of-no-entry-found-for-key-119275.stderr+1-1| ... | ... | @@ -43,7 +43,7 @@ error: defaults for generic parameters are not allowed in `for<...>` binders |
| 43 | 43 | LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:, |
| 44 | 44 | | ^^^^^^^ |
| 45 | 45 | |
| 46 | error[E0433]: failed to resolve: use of undeclared type `COT` | |
| 46 | error[E0433]: cannot find type `COT` in this scope | |
| 47 | 47 | --> $DIR/ice-predicates-of-no-entry-found-for-key-119275.rs:10:43 |
| 48 | 48 | | |
| 49 | 49 | LL | for<const N: usize = 3, T = u32> [(); COT::BYTES]:, |
tests/ui/const-generics/issues/issue-82956.rs+1-1| ... | ... | @@ -24,7 +24,7 @@ where |
| 24 | 24 | |
| 25 | 25 | fn pop(self) -> (Self::Newlen, Self::Output) { |
| 26 | 26 | let mut iter = IntoIter::new(self); |
| 27 | //~^ ERROR: failed to resolve: use of undeclared type `IntoIter` | |
| 27 | //~^ ERROR: cannot find | |
| 28 | 28 | let end = iter.next_back().unwrap(); |
| 29 | 29 | let new = [(); N - 1].map(move |()| iter.next().unwrap()); |
| 30 | 30 | (new, end) |
tests/ui/const-generics/issues/issue-82956.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `IntoIter` | |
| 1 | error[E0433]: cannot find type `IntoIter` in this scope | |
| 2 | 2 | --> $DIR/issue-82956.rs:26:24 |
| 3 | 3 | | |
| 4 | 4 | LL | let mut iter = IntoIter::new(self); |
tests/ui/consts/const_refs_to_static-ice-121413.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | const REF_INTERIOR_MUT: &usize = { |
| 8 | 8 | //~^ HELP consider importing this struct |
| 9 | 9 | static FOO: Sync = AtomicUsize::new(0); |
| 10 | //~^ ERROR failed to resolve: use of undeclared type `AtomicUsize` | |
| 10 | //~^ ERROR cannot find | |
| 11 | 11 | //~| WARN trait objects without an explicit `dyn` are deprecated |
| 12 | 12 | //~| ERROR the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time |
| 13 | 13 | //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! |
tests/ui/consts/const_refs_to_static-ice-121413.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `AtomicUsize` | |
| 1 | error[E0433]: cannot find type `AtomicUsize` in this scope | |
| 2 | 2 | --> $DIR/const_refs_to_static-ice-121413.rs:9:24 |
| 3 | 3 | | |
| 4 | 4 | LL | static FOO: Sync = AtomicUsize::new(0); |
tests/ui/consts/precise-drop-allow-const-fn-unstable.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //@ compile-flags: --crate-type=lib -Cinstrument-coverage -Zno-profiler-runtime |
| 3 | 3 | //@[allow] check-pass |
| 4 | 4 | |
| 5 | #![feature(staged_api, rustc_allow_const_fn_unstable)] | |
| 5 | #![feature(staged_api, rustc_attrs)] | |
| 6 | 6 | #![stable(feature = "rust_test", since = "1.0.0")] |
| 7 | 7 | |
| 8 | 8 | #[stable(feature = "rust_test", since = "1.0.0")] |
tests/ui/delegation/bad-resolve.rs+1-1| ... | ... | @@ -40,7 +40,7 @@ impl Trait for S { |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | mod prefix {} |
| 43 | reuse unresolved_prefix::{a, b, c}; //~ ERROR use of unresolved module or unlinked crate | |
| 43 | reuse unresolved_prefix::{a, b, c}; //~ ERROR cannot find module or crate `unresolved_prefix` | |
| 44 | 44 | reuse prefix::{self, super, crate}; //~ ERROR `crate` in paths can only be used in start position |
| 45 | 45 | |
| 46 | 46 | fn main() {} |
tests/ui/delegation/bad-resolve.stderr+3-3| ... | ... | @@ -91,7 +91,7 @@ LL | type Type; |
| 91 | 91 | LL | impl Trait for S { |
| 92 | 92 | | ^^^^^^^^^^^^^^^^ missing `Type` in implementation |
| 93 | 93 | |
| 94 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved_prefix` | |
| 94 | error[E0433]: cannot find module or crate `unresolved_prefix` in this scope | |
| 95 | 95 | --> $DIR/bad-resolve.rs:43:7 |
| 96 | 96 | | |
| 97 | 97 | LL | reuse unresolved_prefix::{a, b, c}; |
| ... | ... | @@ -99,11 +99,11 @@ LL | reuse unresolved_prefix::{a, b, c}; |
| 99 | 99 | | |
| 100 | 100 | = help: you might be missing a crate named `unresolved_prefix` |
| 101 | 101 | |
| 102 | error[E0433]: failed to resolve: `crate` in paths can only be used in start position | |
| 102 | error[E0433]: `crate` in paths can only be used in start position | |
| 103 | 103 | --> $DIR/bad-resolve.rs:44:29 |
| 104 | 104 | | |
| 105 | 105 | LL | reuse prefix::{self, super, crate}; |
| 106 | | ^^^^^ `crate` in paths can only be used in start position | |
| 106 | | ^^^^^ can only be used in path start position | |
| 107 | 107 | |
| 108 | 108 | error: aborting due to 12 previous errors |
| 109 | 109 |
tests/ui/delegation/glob-bad-path.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ trait Trait {} |
| 5 | 5 | struct S; |
| 6 | 6 | |
| 7 | 7 | impl Trait for u8 { |
| 8 | reuse unresolved::*; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `unresolved` | |
| 8 | reuse unresolved::*; //~ ERROR cannot find module or crate `unresolved` | |
| 9 | 9 | reuse S::*; //~ ERROR expected trait, found struct `S` |
| 10 | 10 | } |
| 11 | 11 |
tests/ui/delegation/glob-bad-path.stderr+1-1| ... | ... | @@ -4,7 +4,7 @@ error: expected trait, found struct `S` |
| 4 | 4 | LL | reuse S::*; |
| 5 | 5 | | ^ not a trait |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved` | |
| 7 | error[E0433]: cannot find module or crate `unresolved` in this scope | |
| 8 | 8 | --> $DIR/glob-bad-path.rs:8:11 |
| 9 | 9 | | |
| 10 | 10 | LL | reuse unresolved::*; |
tests/ui/delegation/impl-reuse-bad-path.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | mod unresolved { |
| 5 | 5 | struct S; |
| 6 | 6 | reuse impl unresolved for S { self.0 } |
| 7 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `unresolved` | |
| 7 | //~^ ERROR cannot find module or crate `unresolved` in this scope | |
| 8 | 8 | //~| ERROR cannot find trait `unresolved` in this scope |
| 9 | 9 | |
| 10 | 10 | trait T {} |
tests/ui/delegation/impl-reuse-bad-path.stderr+1-1| ... | ... | @@ -16,7 +16,7 @@ error: expected trait, found module `TraitModule` |
| 16 | 16 | LL | reuse impl TraitModule for S { self.0 } |
| 17 | 17 | | ^^^^^^^^^^^ not a trait |
| 18 | 18 | |
| 19 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `unresolved` | |
| 19 | error[E0433]: cannot find module or crate `unresolved` in this scope | |
| 20 | 20 | --> $DIR/impl-reuse-bad-path.rs:6:16 |
| 21 | 21 | | |
| 22 | 22 | LL | reuse impl unresolved for S { self.0 } |
tests/ui/derived-errors/issue-31997-1.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `HashMap` | |
| 1 | error[E0433]: cannot find type `HashMap` in this scope | |
| 2 | 2 | --> $DIR/issue-31997-1.rs:20:19 |
| 3 | 3 | | |
| 4 | 4 | LL | let mut map = HashMap::new(); |
tests/ui/dollar-crate/dollar-crate-is-keyword-2.rs+9-3| ... | ... | @@ -2,12 +2,18 @@ mod a {} |
| 2 | 2 | |
| 3 | 3 | macro_rules! m { |
| 4 | 4 | () => { |
| 5 | use a::$crate; //~ ERROR unresolved import `a::$crate` | |
| 6 | use a::$crate::b; //~ ERROR `$crate` in paths can only be used in start position | |
| 7 | type A = a::$crate; //~ ERROR `$crate` in paths can only be used in start position | |
| 5 | use a::$crate; //~ ERROR: unresolved import `a::$crate` | |
| 6 | //~^ NOTE: no `$crate` in `a` | |
| 7 | use a::$crate::b; //~ ERROR: `$crate` in paths can only be used in start position | |
| 8 | //~^ NOTE: can only be used in path start position | |
| 9 | type A = a::$crate; //~ ERROR: `$crate` in paths can only be used in start position | |
| 10 | //~^ NOTE: can only be used in path start position | |
| 8 | 11 | } |
| 9 | 12 | } |
| 10 | 13 | |
| 11 | 14 | m!(); |
| 15 | //~^ NOTE: in this expansion | |
| 16 | //~| NOTE: in this expansion | |
| 17 | //~| NOTE: in this expansion | |
| 12 | 18 | |
| 13 | 19 | fn main() {} |
tests/ui/dollar-crate/dollar-crate-is-keyword-2.stderr+6-6| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | error[E0433]: failed to resolve: `$crate` in paths can only be used in start position | |
| 2 | --> $DIR/dollar-crate-is-keyword-2.rs:6:16 | |
| 1 | error[E0433]: `$crate` in paths can only be used in start position | |
| 2 | --> $DIR/dollar-crate-is-keyword-2.rs:7:16 | |
| 3 | 3 | | |
| 4 | 4 | LL | use a::$crate::b; |
| 5 | | ^^^^^^ `$crate` in paths can only be used in start position | |
| 5 | | ^^^^^^ can only be used in path start position | |
| 6 | 6 | ... |
| 7 | 7 | LL | m!(); |
| 8 | 8 | | ---- in this macro invocation |
| ... | ... | @@ -20,11 +20,11 @@ LL | m!(); |
| 20 | 20 | | |
| 21 | 21 | = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 22 | 22 | |
| 23 | error[E0433]: failed to resolve: `$crate` in paths can only be used in start position | |
| 24 | --> $DIR/dollar-crate-is-keyword-2.rs:7:21 | |
| 23 | error[E0433]: `$crate` in paths can only be used in start position | |
| 24 | --> $DIR/dollar-crate-is-keyword-2.rs:9:21 | |
| 25 | 25 | | |
| 26 | 26 | LL | type A = a::$crate; |
| 27 | | ^^^^^^ `$crate` in paths can only be used in start position | |
| 27 | | ^^^^^^ can only be used in path start position | |
| 28 | 28 | ... |
| 29 | 29 | LL | m!(); |
| 30 | 30 | | ---- in this macro invocation |
tests/ui/eii/privacy2.rs+1-1| ... | ... | @@ -13,7 +13,7 @@ fn eii1_impl(x: u64) { |
| 13 | 13 | println!("{x:?}") |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | #[codegen::eii3] //~ ERROR failed to resolve: could not find `eii3` in `codegen` | |
| 16 | #[codegen::eii3] //~ ERROR cannot find `eii3` in `codegen` | |
| 17 | 17 | fn eii3_impl(x: u64) { |
| 18 | 18 | println!("{x:?}") |
| 19 | 19 | } |
tests/ui/eii/privacy2.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `eii3` in `codegen` | |
| 1 | error[E0433]: cannot find `eii3` in `codegen` | |
| 2 | 2 | --> $DIR/privacy2.rs:16:12 |
| 3 | 3 | | |
| 4 | 4 | LL | #[codegen::eii3] |
tests/ui/enum/assoc-fn-call-on-variant.rs+2-1| ... | ... | @@ -12,5 +12,6 @@ impl E { |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | fn main() { |
| 15 | E::A::f(); //~ ERROR failed to resolve: `A` is a variant, not a module | |
| 15 | E::A::f(); //~ ERROR cannot find module `A` in `E` | |
| 16 | //~^ NOTE: `A` is a variant, not a module | |
| 16 | 17 | } |
tests/ui/enum/assoc-fn-call-on-variant.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `A` is a variant, not a module | |
| 1 | error[E0433]: cannot find module `A` in `E` | |
| 2 | 2 | --> $DIR/assoc-fn-call-on-variant.rs:15:8 |
| 3 | 3 | | |
| 4 | 4 | LL | E::A::f(); |
tests/ui/error-codes/E0433.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `NonExistingMap` | |
| 1 | error[E0433]: cannot find type `NonExistingMap` in this scope | |
| 2 | 2 | --> $DIR/E0433.rs:2:15 |
| 3 | 3 | | |
| 4 | 4 | LL | let map = NonExistingMap::new(); |
tests/ui/extern-flag/multiple-opts.rs+1-1| ... | ... | @@ -16,5 +16,5 @@ pub mod m { |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | fn main() { |
| 19 | somedep::somefun(); //~ ERROR failed to resolve | |
| 19 | somedep::somefun(); //~ ERROR cannot find | |
| 20 | 20 | } |
tests/ui/extern-flag/multiple-opts.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep` | |
| 1 | error[E0433]: cannot find module or crate `somedep` in this scope | |
| 2 | 2 | --> $DIR/multiple-opts.rs:19:5 |
| 3 | 3 | | |
| 4 | 4 | LL | somedep::somefun(); |
tests/ui/extern-flag/noprelude.rs+1-1| ... | ... | @@ -3,5 +3,5 @@ |
| 3 | 3 | //@ edition:2018 |
| 4 | 4 | |
| 5 | 5 | fn main() { |
| 6 | somedep::somefun(); //~ ERROR failed to resolve | |
| 6 | somedep::somefun(); //~ ERROR cannot find | |
| 7 | 7 | } |
tests/ui/extern-flag/noprelude.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `somedep` | |
| 1 | error[E0433]: cannot find module or crate `somedep` in this scope | |
| 2 | 2 | --> $DIR/noprelude.rs:6:5 |
| 3 | 3 | | |
| 4 | 4 | LL | somedep::somefun(); |
tests/ui/extern/extern-macro.rs+1-1| ... | ... | @@ -2,5 +2,5 @@ |
| 2 | 2 | |
| 3 | 3 | fn main() { |
| 4 | 4 | enum Foo {} |
| 5 | let _ = Foo::bar!(); //~ ERROR failed to resolve: partially resolved path in a macro | |
| 5 | let _ = Foo::bar!(); //~ ERROR cannot find macro `bar` in enum `Foo` | |
| 6 | 6 | } |
tests/ui/extern/extern-macro.stderr+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | error[E0433]: failed to resolve: partially resolved path in a macro | |
| 1 | error[E0433]: cannot find macro `bar` in enum `Foo` | |
| 2 | 2 | --> $DIR/extern-macro.rs:5:13 |
| 3 | 3 | | |
| 4 | 4 | LL | let _ = Foo::bar!(); |
| 5 | | ^^^^^^^^ partially resolved path in a macro | |
| 5 | | ^^^^^^^^ a macro can't exist within an enum | |
| 6 | 6 | |
| 7 | 7 | error: aborting due to 1 previous error |
| 8 | 8 |
tests/ui/feature-gates/feature-gate-extern_absolute_paths.rs+1-1| ... | ... | @@ -2,5 +2,5 @@ |
| 2 | 2 | use core::default; //~ ERROR unresolved import `core` |
| 3 | 3 | |
| 4 | 4 | fn main() { |
| 5 | let _: u8 = ::core::default::Default(); //~ ERROR failed to resolve | |
| 5 | let _: u8 = ::core::default::Default(); //~ ERROR cannot find | |
| 6 | 6 | } |
tests/ui/feature-gates/feature-gate-extern_absolute_paths.stderr+1-1| ... | ... | @@ -7,7 +7,7 @@ LL | use core::default; |
| 7 | 7 | | you might be missing crate `core` |
| 8 | 8 | | help: try using `std` instead of `core`: `std` |
| 9 | 9 | |
| 10 | error[E0433]: failed to resolve: you might be missing crate `core` | |
| 10 | error[E0433]: cannot find `core` in the crate root | |
| 11 | 11 | --> $DIR/feature-gate-extern_absolute_paths.rs:5:19 |
| 12 | 12 | | |
| 13 | 13 | LL | let _: u8 = ::core::default::Default(); |
tests/ui/feature-gates/feature-gate-final-associated-functions.stderr+1-1| ... | ... | @@ -4,7 +4,7 @@ error[E0658]: `final` on trait functions is experimental |
| 4 | 4 | LL | final fn bar() {} |
| 5 | 5 | | ^^^^^ |
| 6 | 6 | | |
| 7 | = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | |
| 7 | = note: see issue #131179 <https://github.com/rust-lang/rust/issues/131179> for more information | |
| 8 | 8 | = help: add `#![feature(final_associated_functions)]` to the crate attributes to enable |
| 9 | 9 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 10 | 10 |
tests/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | #![allow(unused_macros)] |
| 2 | 2 | |
| 3 | #[rustc_allow_const_fn_unstable()] //~ ERROR rustc_allow_const_fn_unstable side-steps | |
| 3 | #[rustc_allow_const_fn_unstable()] //~ ERROR use of an internal attribute | |
| 4 | 4 | const fn foo() { } |
| 5 | 5 | |
| 6 | 6 | fn main() {} |
tests/ui/feature-gates/feature-gate-rustc-allow-const-fn-unstable.stderr+4-4| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | error[E0658]: rustc_allow_const_fn_unstable side-steps feature gating and stability checks | |
| 1 | error[E0658]: use of an internal attribute | |
| 2 | 2 | --> $DIR/feature-gate-rustc-allow-const-fn-unstable.rs:3:1 |
| 3 | 3 | | |
| 4 | 4 | LL | #[rustc_allow_const_fn_unstable()] |
| 5 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 6 | 6 | | |
| 7 | = note: see issue #69399 <https://github.com/rust-lang/rust/issues/69399> for more information | |
| 8 | = help: add `#![feature(rustc_allow_const_fn_unstable)]` to the crate attributes to enable | |
| 9 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | |
| 7 | = help: add `#![feature(rustc_attrs)]` to the crate attributes to enable | |
| 8 | = note: the `#[rustc_allow_const_fn_unstable]` attribute is an internal implementation detail that will never be stable | |
| 9 | = note: rustc_allow_const_fn_unstable side-steps feature gating and stability checks | |
| 10 | 10 | |
| 11 | 11 | error: aborting due to 1 previous error |
| 12 | 12 |
tests/ui/foreign/stashed-issue-121451.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | 1 | extern "C" fn _f() -> libc::uintptr_t {} |
| 2 | //~^ ERROR failed to resolve | |
| 2 | //~^ ERROR cannot find | |
| 3 | 3 | |
| 4 | 4 | fn main() {} |
tests/ui/foreign/stashed-issue-121451.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `libc` | |
| 1 | error[E0433]: cannot find module or crate `libc` in this scope | |
| 2 | 2 | --> $DIR/stashed-issue-121451.rs:1:23 |
| 3 | 3 | | |
| 4 | 4 | LL | extern "C" fn _f() -> libc::uintptr_t {} |
tests/ui/generic-associated-types/equality-bound.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ fn sum2<I: Iterator>(i: I) -> i32 where I::Item = i32 { |
| 8 | 8 | } |
| 9 | 9 | fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 { |
| 10 | 10 | //~^ ERROR equality constraints are not yet supported in `where` clauses |
| 11 | //~| ERROR failed to resolve: use of undeclared type `I` | |
| 11 | //~| ERROR cannot find type `I` | |
| 12 | 12 | panic!() |
| 13 | 13 | } |
| 14 | 14 |
tests/ui/generic-associated-types/equality-bound.stderr+1-1| ... | ... | @@ -200,7 +200,7 @@ LL - fn from_iter<T>(_: T) -> Self where T::Item = A, T: IntoIterator, |
| 200 | 200 | LL + fn from_iter<T>(_: T) -> Self where T::Item = K, T: IntoIterator, |
| 201 | 201 | | |
| 202 | 202 | |
| 203 | error[E0433]: failed to resolve: use of undeclared type `I` | |
| 203 | error[E0433]: cannot find type `I` in this scope | |
| 204 | 204 | --> $DIR/equality-bound.rs:9:41 |
| 205 | 205 | | |
| 206 | 206 | LL | fn sum3<J: Iterator>(i: J) -> i32 where I::Item = i32 { |
tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.rs+2-2| ... | ... | @@ -10,7 +10,7 @@ macro a() { |
| 10 | 10 | mod u { |
| 11 | 11 | // Late resolution. |
| 12 | 12 | fn f() { my_core::mem::drop(0); } |
| 13 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 13 | //~^ ERROR cannot find | |
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
| ... | ... | @@ -23,7 +23,7 @@ mod v { |
| 23 | 23 | mod u { |
| 24 | 24 | // Late resolution. |
| 25 | 25 | fn f() { my_core::mem::drop(0); } |
| 26 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 26 | //~^ ERROR cannot find | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | fn main() {} |
tests/ui/hygiene/extern-prelude-from-opaque-fail-2018.stderr+2-2| ... | ... | @@ -15,7 +15,7 @@ LL | a!(); |
| 15 | 15 | | |
| 16 | 16 | = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 17 | 17 | |
| 18 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 18 | error[E0433]: cannot find module or crate `my_core` in this scope | |
| 19 | 19 | --> $DIR/extern-prelude-from-opaque-fail-2018.rs:12:18 |
| 20 | 20 | | |
| 21 | 21 | LL | fn f() { my_core::mem::drop(0); } |
| ... | ... | @@ -29,7 +29,7 @@ LL | a!(); |
| 29 | 29 | std::mem |
| 30 | 30 | = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 31 | 31 | |
| 32 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 32 | error[E0433]: cannot find module or crate `my_core` in this scope | |
| 33 | 33 | --> $DIR/extern-prelude-from-opaque-fail-2018.rs:25:14 |
| 34 | 34 | | |
| 35 | 35 | LL | fn f() { my_core::mem::drop(0); } |
tests/ui/hygiene/extern-prelude-from-opaque-fail.rs+2-2| ... | ... | @@ -10,7 +10,7 @@ macro a() { |
| 10 | 10 | mod u { |
| 11 | 11 | // Late resolution. |
| 12 | 12 | fn f() { my_core::mem::drop(0); } |
| 13 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 13 | //~^ ERROR cannot find | |
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
| ... | ... | @@ -23,7 +23,7 @@ mod v { |
| 23 | 23 | mod u { |
| 24 | 24 | // Late resolution. |
| 25 | 25 | fn f() { my_core::mem::drop(0); } |
| 26 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 26 | //~^ ERROR cannot find | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | fn main() {} |
tests/ui/hygiene/extern-prelude-from-opaque-fail.stderr+2-2| ... | ... | @@ -15,7 +15,7 @@ LL | a!(); |
| 15 | 15 | | |
| 16 | 16 | = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 17 | 17 | |
| 18 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 18 | error[E0433]: cannot find module or crate `my_core` in this scope | |
| 19 | 19 | --> $DIR/extern-prelude-from-opaque-fail.rs:12:18 |
| 20 | 20 | | |
| 21 | 21 | LL | fn f() { my_core::mem::drop(0); } |
| ... | ... | @@ -29,7 +29,7 @@ LL | a!(); |
| 29 | 29 | my_core::mem |
| 30 | 30 | = note: this error originates in the macro `a` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 31 | 31 | |
| 32 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `my_core` | |
| 32 | error[E0433]: cannot find module or crate `my_core` in this scope | |
| 33 | 33 | --> $DIR/extern-prelude-from-opaque-fail.rs:25:14 |
| 34 | 34 | | |
| 35 | 35 | LL | fn f() { my_core::mem::drop(0); } |
tests/ui/hygiene/no_implicit_prelude.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ mod foo { |
| 9 | 9 | #[no_implicit_prelude] |
| 10 | 10 | mod bar { |
| 11 | 11 | pub macro m() { |
| 12 | Vec::new(); //~ ERROR failed to resolve | |
| 12 | Vec::new(); //~ ERROR cannot find | |
| 13 | 13 | ().clone() //~ ERROR no method named `clone` found |
| 14 | 14 | } |
| 15 | 15 | fn f() { |
tests/ui/hygiene/no_implicit_prelude.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `Vec` | |
| 1 | error[E0433]: cannot find type `Vec` in this scope | |
| 2 | 2 | --> $DIR/no_implicit_prelude.rs:12:9 |
| 3 | 3 | | |
| 4 | 4 | LL | fn f() { ::bar::m!(); } |
tests/ui/impl-trait/issues/issue-72911.rs+2-2| ... | ... | @@ -9,12 +9,12 @@ pub fn gather_all() -> impl Iterator<Item = Lint> { |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> { |
| 12 | //~^ ERROR: failed to resolve | |
| 12 | //~^ ERROR: cannot find | |
| 13 | 13 | unimplemented!() |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | fn lint_files() -> impl Iterator<Item = foo::MissingItem> { |
| 17 | //~^ ERROR: failed to resolve | |
| 17 | //~^ ERROR: cannot find | |
| 18 | 18 | unimplemented!() |
| 19 | 19 | } |
| 20 | 20 |
tests/ui/impl-trait/issues/issue-72911.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 1 | error[E0433]: cannot find module or crate `foo` in this scope | |
| 2 | 2 | --> $DIR/issue-72911.rs:11:33 |
| 3 | 3 | | |
| 4 | 4 | LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = Lint> { |
| ... | ... | @@ -6,7 +6,7 @@ LL | fn gather_from_file(dir_entry: &foo::MissingItem) -> impl Iterator<Item = L |
| 6 | 6 | | |
| 7 | 7 | = help: you might be missing a crate named `foo` |
| 8 | 8 | |
| 9 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 9 | error[E0433]: cannot find module or crate `foo` in this scope | |
| 10 | 10 | --> $DIR/issue-72911.rs:16:41 |
| 11 | 11 | | |
| 12 | 12 | LL | fn lint_files() -> impl Iterator<Item = foo::MissingItem> { |
tests/ui/impl-trait/stashed-diag-issue-121504.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ trait MyTrait { |
| 4 | 4 | async fn foo(self) -> (Self, i32); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | impl MyTrait for xyz::T { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `xyz` | |
| 7 | impl MyTrait for xyz::T { //~ ERROR cannot find module or crate `xyz` | |
| 8 | 8 | async fn foo(self, key: i32) -> (u32, i32) { |
| 9 | 9 | (self, key) |
| 10 | 10 | } |
tests/ui/impl-trait/stashed-diag-issue-121504.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `xyz` | |
| 1 | error[E0433]: cannot find module or crate `xyz` in this scope | |
| 2 | 2 | --> $DIR/stashed-diag-issue-121504.rs:7:18 |
| 3 | 3 | | |
| 4 | 4 | LL | impl MyTrait for xyz::T { |
tests/ui/imports/absolute-paths-in-nested-use-groups.rs+6-3| ... | ... | @@ -3,9 +3,12 @@ |
| 3 | 3 | mod foo {} |
| 4 | 4 | |
| 5 | 5 | use foo::{ |
| 6 | ::bar, //~ ERROR crate root in paths can only be used in start position | |
| 7 | super::bar, //~ ERROR `super` in paths can only be used in start position | |
| 8 | self::bar, //~ ERROR `self` in paths can only be used in start position | |
| 6 | ::bar, | |
| 7 | //~^ ERROR: crate root in paths can only be used in start position | |
| 8 | super::bar, | |
| 9 | //~^ ERROR: `super` in paths can only be used in start position | |
| 10 | self::bar, | |
| 11 | //~^ ERROR: `self` in paths can only be used in start position | |
| 9 | 12 | }; |
| 10 | 13 | |
| 11 | 14 | fn main() {} |
tests/ui/imports/absolute-paths-in-nested-use-groups.stderr+8-8| ... | ... | @@ -1,20 +1,20 @@ |
| 1 | error[E0433]: failed to resolve: crate root in paths can only be used in start position | |
| 1 | error[E0433]: the crate root in paths can only be used in start position | |
| 2 | 2 | --> $DIR/absolute-paths-in-nested-use-groups.rs:6:5 |
| 3 | 3 | | |
| 4 | 4 | LL | ::bar, |
| 5 | | ^ crate root in paths can only be used in start position | |
| 5 | | ^ can only be used in path start position | |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: `super` in paths can only be used in start position | |
| 8 | --> $DIR/absolute-paths-in-nested-use-groups.rs:7:5 | |
| 7 | error[E0433]: `super` in paths can only be used in start position | |
| 8 | --> $DIR/absolute-paths-in-nested-use-groups.rs:8:5 | |
| 9 | 9 | | |
| 10 | 10 | LL | super::bar, |
| 11 | | ^^^^^ `super` in paths can only be used in start position | |
| 11 | | ^^^^^ can only be used in path start position | |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: `self` in paths can only be used in start position | |
| 14 | --> $DIR/absolute-paths-in-nested-use-groups.rs:8:5 | |
| 13 | error[E0433]: `self` in paths can only be used in start position | |
| 14 | --> $DIR/absolute-paths-in-nested-use-groups.rs:10:5 | |
| 15 | 15 | | |
| 16 | 16 | LL | self::bar, |
| 17 | | ^^^^ `self` in paths can only be used in start position | |
| 17 | | ^^^^ can only be used in path start position | |
| 18 | 18 | |
| 19 | 19 | error: aborting due to 3 previous errors |
| 20 | 20 |
tests/ui/imports/extern-prelude-extern-crate-fail.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ mod n { |
| 7 | 7 | |
| 8 | 8 | mod m { |
| 9 | 9 | fn check() { |
| 10 | two_macros::m!(); //~ ERROR failed to resolve: use of unresolved module or unlinked crate `two_macros` | |
| 10 | two_macros::m!(); //~ ERROR cannot find | |
| 11 | 11 | } |
| 12 | 12 | } |
| 13 | 13 |
tests/ui/imports/extern-prelude-extern-crate-fail.stderr+1-1| ... | ... | @@ -9,7 +9,7 @@ LL | define_std_as_non_existent!(); |
| 9 | 9 | | |
| 10 | 10 | = note: this error originates in the macro `define_std_as_non_existent` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 11 | 11 | |
| 12 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `two_macros` | |
| 12 | error[E0433]: cannot find module or crate `two_macros` in this scope | |
| 13 | 13 | --> $DIR/extern-prelude-extern-crate-fail.rs:10:9 |
| 14 | 14 | | |
| 15 | 15 | LL | two_macros::m!(); |
tests/ui/imports/nested-import-root-symbol-150103.rs+2-2| ... | ... | @@ -3,11 +3,11 @@ |
| 3 | 3 | // caused by `{{root}}` appearing in diagnostic suggestions |
| 4 | 4 | |
| 5 | 5 | mod A { |
| 6 | use Iuse::{ ::Fish }; //~ ERROR failed to resolve: use of unresolved module or unlinked crate | |
| 6 | use Iuse::{ ::Fish }; //~ ERROR cannot find module or crate `Iuse` in the crate root | |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | mod B { |
| 10 | use A::{::Fish}; //~ ERROR failed to resolve: crate root in paths can only be used in start position | |
| 10 | use A::{::Fish}; //~ ERROR the crate root in paths can only be used in start position | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | fn main() {} |
tests/ui/imports/nested-import-root-symbol-150103.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Iuse` | |
| 1 | error[E0433]: cannot find module or crate `Iuse` in the crate root | |
| 2 | 2 | --> $DIR/nested-import-root-symbol-150103.rs:6:9 |
| 3 | 3 | | |
| 4 | 4 | LL | use Iuse::{ ::Fish }; |
| ... | ... | @@ -9,11 +9,11 @@ help: you might be missing a crate named `Iuse`, add it to your project and impo |
| 9 | 9 | LL + extern crate Iuse; |
| 10 | 10 | | |
| 11 | 11 | |
| 12 | error[E0433]: failed to resolve: crate root in paths can only be used in start position | |
| 12 | error[E0433]: the crate root in paths can only be used in start position | |
| 13 | 13 | --> $DIR/nested-import-root-symbol-150103.rs:10:13 |
| 14 | 14 | | |
| 15 | 15 | LL | use A::{::Fish}; |
| 16 | | ^ crate root in paths can only be used in start position | |
| 16 | | ^ can only be used in path start position | |
| 17 | 17 | |
| 18 | 18 | error: aborting due to 2 previous errors |
| 19 | 19 |
tests/ui/imports/overwrite-different-vis-3.rs created+14| ... | ... | @@ -0,0 +1,14 @@ |
| 1 | // Regression test for issue #152606. | |
| 2 | ||
| 3 | //@ check-pass | |
| 4 | ||
| 5 | mod outer { | |
| 6 | mod inner { | |
| 7 | use super::*; // should go before the ambiguous glob imports | |
| 8 | } | |
| 9 | ||
| 10 | use crate::*; | |
| 11 | pub use crate::*; | |
| 12 | } | |
| 13 | ||
| 14 | fn main() {} |
tests/ui/imports/suggest-import-issue-120074.edition2015.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: unresolved import | |
| 1 | error[E0433]: cannot find `bar` in `crate` | |
| 2 | 2 | --> $DIR/suggest-import-issue-120074.rs:14:35 |
| 3 | 3 | | |
| 4 | 4 | LL | println!("Hello, {}!", crate::bar::do_the_thing); |
tests/ui/imports/suggest-import-issue-120074.edition2021.stderr deleted-23| ... | ... | @@ -1,23 +0,0 @@ |
| 1 | error[E0433]: failed to resolve: unresolved import | |
| 2 | --> $DIR/suggest-import-issue-120074.rs:14:35 | |
| 3 | | | |
| 4 | LL | println!("Hello, {}!", crate::bar::do_the_thing); | |
| 5 | | ^^^ unresolved import | |
| 6 | | | |
| 7 | help: a similar path exists | |
| 8 | | | |
| 9 | LL | println!("Hello, {}!", crate::foo::bar::do_the_thing); | |
| 10 | | +++++ | |
| 11 | help: consider importing this module | |
| 12 | | | |
| 13 | LL + use foo::bar; | |
| 14 | | | |
| 15 | help: if you import `bar`, refer to it directly | |
| 16 | | | |
| 17 | LL - println!("Hello, {}!", crate::bar::do_the_thing); | |
| 18 | LL + println!("Hello, {}!", bar::do_the_thing); | |
| 19 | | | |
| 20 | ||
| 21 | error: aborting due to 1 previous error | |
| 22 | ||
| 23 | For more information about this error, try `rustc --explain E0433`. |
tests/ui/imports/suggest-import-issue-120074.post2015.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: unresolved import | |
| 1 | error[E0433]: cannot find `bar` in `crate` | |
| 2 | 2 | --> $DIR/suggest-import-issue-120074.rs:14:35 |
| 3 | 3 | | |
| 4 | 4 | LL | println!("Hello, {}!", crate::bar::do_the_thing); |
tests/ui/imports/suggest-import-issue-120074.rs+1-1| ... | ... | @@ -11,5 +11,5 @@ pub mod foo { |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | fn main() { |
| 14 | println!("Hello, {}!", crate::bar::do_the_thing); //~ ERROR failed to resolve: unresolved import | |
| 14 | println!("Hello, {}!", crate::bar::do_the_thing); //~ ERROR cannot find `bar` in `crate` | |
| 15 | 15 | } |
tests/ui/imports/tool-mod-child.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | //@ edition:2015 |
| 2 | 2 | use clippy::a; //~ ERROR unresolved import `clippy` |
| 3 | use clippy::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `clippy` | |
| 3 | use clippy::a::b; //~ ERROR cannot find | |
| 4 | 4 | |
| 5 | 5 | use rustdoc::a; //~ ERROR unresolved import `rustdoc` |
| 6 | use rustdoc::a::b; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `rustdoc` | |
| 6 | use rustdoc::a::b; //~ ERROR cannot find | |
| 7 | 7 | |
| 8 | 8 | fn main() {} |
tests/ui/imports/tool-mod-child.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `clippy` | |
| 1 | error[E0433]: cannot find module or crate `clippy` in the crate root | |
| 2 | 2 | --> $DIR/tool-mod-child.rs:3:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use clippy::a::b; |
| ... | ... | @@ -20,7 +20,7 @@ help: you might be missing a crate named `clippy`, add it to your project and im |
| 20 | 20 | LL + extern crate clippy; |
| 21 | 21 | | |
| 22 | 22 | |
| 23 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustdoc` | |
| 23 | error[E0433]: cannot find module or crate `rustdoc` in the crate root | |
| 24 | 24 | --> $DIR/tool-mod-child.rs:6:5 |
| 25 | 25 | | |
| 26 | 26 | LL | use rustdoc::a::b; |
tests/ui/issues/issue-38857.rs+2-2| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | fn main() { |
| 2 | 2 | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; |
| 3 | //~^ ERROR failed to resolve: could not find `imp` in `sys` [E0433] | |
| 4 | //~^^ ERROR module `sys` is private [E0603] | |
| 3 | //~^ ERROR: cannot find `imp` in `sys` [E0433] | |
| 4 | //~| ERROR: module `sys` is private [E0603] | |
| 5 | 5 | } |
tests/ui/issues/issue-38857.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `imp` in `sys` | |
| 1 | error[E0433]: cannot find `imp` in `sys` | |
| 2 | 2 | --> $DIR/issue-38857.rs:2:23 |
| 3 | 3 | | |
| 4 | 4 | LL | let a = std::sys::imp::process::process_common::StdioPipes { ..panic!() }; |
tests/ui/issues/issue-46101.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | trait Foo {} |
| 2 | #[derive(Foo::Anything)] //~ ERROR failed to resolve: partially resolved path in a derive macro | |
| 3 | //~| ERROR failed to resolve: partially resolved path in a derive macro | |
| 2 | #[derive(Foo::Anything)] //~ ERROR cannot find | |
| 3 | //~| ERROR cannot find | |
| 4 | 4 | struct S; |
| 5 | 5 | |
| 6 | 6 | fn main() {} |
tests/ui/issues/issue-46101.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | error[E0433]: failed to resolve: partially resolved path in a derive macro | |
| 1 | error[E0433]: cannot find derive macro `Anything` in trait `Foo` | |
| 2 | 2 | --> $DIR/issue-46101.rs:2:10 |
| 3 | 3 | | |
| 4 | 4 | LL | #[derive(Foo::Anything)] |
| 5 | | ^^^^^^^^^^^^^ partially resolved path in a derive macro | |
| 5 | | ^^^^^^^^^^^^^ a derive macro can't exist within a trait | |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: partially resolved path in a derive macro | |
| 7 | error[E0433]: cannot find derive macro `Anything` in trait `Foo` | |
| 8 | 8 | --> $DIR/issue-46101.rs:2:10 |
| 9 | 9 | | |
| 10 | 10 | LL | #[derive(Foo::Anything)] |
| 11 | | ^^^^^^^^^^^^^ partially resolved path in a derive macro | |
| 11 | | ^^^^^^^^^^^^^ a derive macro can't exist within a trait | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 |
tests/ui/keyword/keyword-super-as-identifier.rs+1-1| ... | ... | @@ -1,3 +1,3 @@ |
| 1 | 1 | fn main() { |
| 2 | let super = 22; //~ ERROR failed to resolve: there are too many leading `super` keywords | |
| 2 | let super = 22; //~ ERROR too many leading `super` keywords | |
| 3 | 3 | } |
tests/ui/keyword/keyword-super-as-identifier.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: there are too many leading `super` keywords | |
| 1 | error[E0433]: too many leading `super` keywords | |
| 2 | 2 | --> $DIR/keyword-super-as-identifier.rs:2:9 |
| 3 | 3 | | |
| 4 | 4 | LL | let super = 22; |
tests/ui/keyword/keyword-super.rs+1-1| ... | ... | @@ -1,3 +1,3 @@ |
| 1 | 1 | fn main() { |
| 2 | let super: isize; //~ ERROR failed to resolve: there are too many leading `super` keywords | |
| 2 | let super: isize; //~ ERROR: too many leading `super` keywords | |
| 3 | 3 | } |
tests/ui/keyword/keyword-super.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: there are too many leading `super` keywords | |
| 1 | error[E0433]: too many leading `super` keywords | |
| 2 | 2 | --> $DIR/keyword-super.rs:2:9 |
| 3 | 3 | | |
| 4 | 4 | LL | let super: isize; |
tests/ui/lifetimes/issue-97194.rs+3-3| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | extern "C" { |
| 2 | 2 | fn bget(&self, index: [usize; Self::DIM]) -> bool { |
| 3 | //~^ ERROR incorrect function inside `extern` block | |
| 4 | //~| ERROR `self` parameter is only allowed in associated functions | |
| 5 | //~| ERROR failed to resolve: `Self` | |
| 3 | //~^ ERROR: incorrect function inside `extern` block | |
| 4 | //~| ERROR: `self` parameter is only allowed in associated functions | |
| 5 | //~| ERROR: cannot find `Self` | |
| 6 | 6 | type T<'a> = &'a str; |
| 7 | 7 | } |
| 8 | 8 | } |
tests/ui/lifetimes/issue-97194.stderr+1-1| ... | ... | @@ -22,7 +22,7 @@ LL | fn bget(&self, index: [usize; Self::DIM]) -> bool { |
| 22 | 22 | | |
| 23 | 23 | = note: associated functions are those in `impl` or `trait` definitions |
| 24 | 24 | |
| 25 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 25 | error[E0433]: cannot find `Self` in this scope | |
| 26 | 26 | --> $DIR/issue-97194.rs:2:35 |
| 27 | 27 | | |
| 28 | 28 | LL | fn bget(&self, index: [usize; Self::DIM]) -> bool { |
tests/ui/lifetimes/mut-ref-owned-suggestion.rs created+29| ... | ... | @@ -0,0 +1,29 @@ |
| 1 | //! Regression test for <https://github.com/rust-lang/rust/issues/150077> | |
| 2 | //! Tests that `&mut T` suggests `T`, not `mut T`, `&mut str` suggests `String`, not `str`, | |
| 3 | //! when recommending an owned value. | |
| 4 | fn with_fn(_f: impl Fn() -> &mut ()) {} | |
| 5 | //~^ ERROR: missing lifetime specifier | |
| 6 | ||
| 7 | fn with_ref_mut_str(_f: impl Fn() -> &mut str) {} | |
| 8 | //~^ ERROR: missing lifetime specifier | |
| 9 | ||
| 10 | fn with_fn_has_return(_f: impl Fn() -> &mut ()) -> i32 { | |
| 11 | //~^ ERROR: missing lifetime specifier | |
| 12 | 2 | |
| 13 | } | |
| 14 | ||
| 15 | fn with_dyn(_f: Box<dyn Fn() -> &mut i32>) {} | |
| 16 | //~^ ERROR: missing lifetime specifier | |
| 17 | ||
| 18 | fn trait_bound<F: Fn() -> &mut i32>(_f: F) {} | |
| 19 | //~^ ERROR: missing lifetime specifier | |
| 20 | ||
| 21 | fn nested_result(_f: impl Fn() -> Result<&mut i32, ()>) {} | |
| 22 | //~^ ERROR: missing lifetime specifier | |
| 23 | ||
| 24 | struct Holder<F: Fn() -> &mut i32> { | |
| 25 | //~^ ERROR: missing lifetime specifier | |
| 26 | f: F, | |
| 27 | } | |
| 28 | ||
| 29 | fn main() {} |
tests/ui/lifetimes/mut-ref-owned-suggestion.stderr created+137| ... | ... | @@ -0,0 +1,137 @@ |
| 1 | error[E0106]: missing lifetime specifier | |
| 2 | --> $DIR/mut-ref-owned-suggestion.rs:4:29 | |
| 3 | | | |
| 4 | LL | fn with_fn(_f: impl Fn() -> &mut ()) {} | |
| 5 | | ^ expected named lifetime parameter | |
| 6 | | | |
| 7 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
| 8 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | |
| 9 | | | |
| 10 | LL | fn with_fn(_f: impl Fn() -> &'static mut ()) {} | |
| 11 | | +++++++ | |
| 12 | help: instead, you are more likely to want to return an owned value | |
| 13 | | | |
| 14 | LL - fn with_fn(_f: impl Fn() -> &mut ()) {} | |
| 15 | LL + fn with_fn(_f: impl Fn() -> ()) {} | |
| 16 | | | |
| 17 | ||
| 18 | error[E0106]: missing lifetime specifier | |
| 19 | --> $DIR/mut-ref-owned-suggestion.rs:7:38 | |
| 20 | | | |
| 21 | LL | fn with_ref_mut_str(_f: impl Fn() -> &mut str) {} | |
| 22 | | ^ expected named lifetime parameter | |
| 23 | | | |
| 24 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
| 25 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | |
| 26 | | | |
| 27 | LL | fn with_ref_mut_str(_f: impl Fn() -> &'static mut str) {} | |
| 28 | | +++++++ | |
| 29 | help: instead, you are more likely to want to return an owned value | |
| 30 | | | |
| 31 | LL - fn with_ref_mut_str(_f: impl Fn() -> &mut str) {} | |
| 32 | LL + fn with_ref_mut_str(_f: impl Fn() -> String) {} | |
| 33 | | | |
| 34 | ||
| 35 | error[E0106]: missing lifetime specifier | |
| 36 | --> $DIR/mut-ref-owned-suggestion.rs:10:40 | |
| 37 | | | |
| 38 | LL | fn with_fn_has_return(_f: impl Fn() -> &mut ()) -> i32 { | |
| 39 | | ^ expected named lifetime parameter | |
| 40 | | | |
| 41 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
| 42 | = note: for more information on higher-ranked polymorphism, visit https://doc.rust-lang.org/nomicon/hrtb.html | |
| 43 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | |
| 44 | | | |
| 45 | LL | fn with_fn_has_return(_f: impl Fn() -> &'static mut ()) -> i32 { | |
| 46 | | +++++++ | |
| 47 | help: consider making the bound lifetime-generic with a new `'a` lifetime | |
| 48 | | | |
| 49 | LL - fn with_fn_has_return(_f: impl Fn() -> &mut ()) -> i32 { | |
| 50 | LL + fn with_fn_has_return(_f: impl for<'a> Fn() -> &'a ()) -> i32 { | |
| 51 | | | |
| 52 | help: consider introducing a named lifetime parameter | |
| 53 | | | |
| 54 | LL - fn with_fn_has_return(_f: impl Fn() -> &mut ()) -> i32 { | |
| 55 | LL + fn with_fn_has_return<'a>(_f: impl Fn() -> &'a ()) -> i32 { | |
| 56 | | | |
| 57 | help: alternatively, you might want to return an owned value | |
| 58 | | | |
| 59 | LL - fn with_fn_has_return(_f: impl Fn() -> &mut ()) -> i32 { | |
| 60 | LL + fn with_fn_has_return(_f: impl Fn() -> ()) -> i32 { | |
| 61 | | | |
| 62 | ||
| 63 | error[E0106]: missing lifetime specifier | |
| 64 | --> $DIR/mut-ref-owned-suggestion.rs:15:33 | |
| 65 | | | |
| 66 | LL | fn with_dyn(_f: Box<dyn Fn() -> &mut i32>) {} | |
| 67 | | ^ expected named lifetime parameter | |
| 68 | | | |
| 69 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
| 70 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | |
| 71 | | | |
| 72 | LL | fn with_dyn(_f: Box<dyn Fn() -> &'static mut i32>) {} | |
| 73 | | +++++++ | |
| 74 | help: instead, you are more likely to want to return an owned value | |
| 75 | | | |
| 76 | LL - fn with_dyn(_f: Box<dyn Fn() -> &mut i32>) {} | |
| 77 | LL + fn with_dyn(_f: Box<dyn Fn() -> i32>) {} | |
| 78 | | | |
| 79 | ||
| 80 | error[E0106]: missing lifetime specifier | |
| 81 | --> $DIR/mut-ref-owned-suggestion.rs:18:27 | |
| 82 | | | |
| 83 | LL | fn trait_bound<F: Fn() -> &mut i32>(_f: F) {} | |
| 84 | | ^ expected named lifetime parameter | |
| 85 | | | |
| 86 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
| 87 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | |
| 88 | | | |
| 89 | LL | fn trait_bound<F: Fn() -> &'static mut i32>(_f: F) {} | |
| 90 | | +++++++ | |
| 91 | help: instead, you are more likely to want to change the argument to be borrowed... | |
| 92 | | | |
| 93 | LL | fn trait_bound<F: Fn() -> &mut i32>(_f: &F) {} | |
| 94 | | + | |
| 95 | help: ...or alternatively, you might want to return an owned value | |
| 96 | | | |
| 97 | LL - fn trait_bound<F: Fn() -> &mut i32>(_f: F) {} | |
| 98 | LL + fn trait_bound<F: Fn() -> i32>(_f: F) {} | |
| 99 | | | |
| 100 | ||
| 101 | error[E0106]: missing lifetime specifier | |
| 102 | --> $DIR/mut-ref-owned-suggestion.rs:21:42 | |
| 103 | | | |
| 104 | LL | fn nested_result(_f: impl Fn() -> Result<&mut i32, ()>) {} | |
| 105 | | ^ expected named lifetime parameter | |
| 106 | | | |
| 107 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
| 108 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | |
| 109 | | | |
| 110 | LL | fn nested_result(_f: impl Fn() -> Result<&'static mut i32, ()>) {} | |
| 111 | | +++++++ | |
| 112 | help: instead, you are more likely to want to return an owned value | |
| 113 | | | |
| 114 | LL - fn nested_result(_f: impl Fn() -> Result<&mut i32, ()>) {} | |
| 115 | LL + fn nested_result(_f: impl Fn() -> Result<i32, ()>) {} | |
| 116 | | | |
| 117 | ||
| 118 | error[E0106]: missing lifetime specifier | |
| 119 | --> $DIR/mut-ref-owned-suggestion.rs:24:26 | |
| 120 | | | |
| 121 | LL | struct Holder<F: Fn() -> &mut i32> { | |
| 122 | | ^ expected named lifetime parameter | |
| 123 | | | |
| 124 | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from | |
| 125 | help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | |
| 126 | | | |
| 127 | LL | struct Holder<F: Fn() -> &'static mut i32> { | |
| 128 | | +++++++ | |
| 129 | help: instead, you are more likely to want to return an owned value | |
| 130 | | | |
| 131 | LL - struct Holder<F: Fn() -> &mut i32> { | |
| 132 | LL + struct Holder<F: Fn() -> i32> { | |
| 133 | | | |
| 134 | ||
| 135 | error: aborting due to 7 previous errors | |
| 136 | ||
| 137 | For more information about this error, try `rustc --explain E0106`. |
tests/ui/lifetimes/trait-impl-mismatch-elided-lifetime-issue-65866.rs created+49| ... | ... | @@ -0,0 +1,49 @@ |
| 1 | // Regression test for https://github.com/rust-lang/rust/issues/65866. | |
| 2 | ||
| 3 | mod plain { | |
| 4 | struct Foo; | |
| 5 | ||
| 6 | struct Re<'a> { | |
| 7 | _data: &'a u16, | |
| 8 | } | |
| 9 | ||
| 10 | trait Bar { | |
| 11 | fn bar(&self, r: &mut Re); | |
| 12 | //~^ NOTE expected | |
| 13 | //~| NOTE `Re` here is elided as `Re<'_>` | |
| 14 | } | |
| 15 | ||
| 16 | impl Bar for Foo { | |
| 17 | fn bar<'a, 'b>(&'a self, _r: &'b mut Re<'a>) {} | |
| 18 | //~^ ERROR `impl` item signature doesn't match `trait` item signature | |
| 19 | //~| NOTE expected signature | |
| 20 | //~| NOTE found | |
| 21 | //~| HELP the lifetime requirements | |
| 22 | //~| HELP verify the lifetime relationships | |
| 23 | } | |
| 24 | } | |
| 25 | ||
| 26 | mod with_type_args { | |
| 27 | struct Foo; | |
| 28 | ||
| 29 | struct Re<'a, T> { | |
| 30 | _data: (&'a u16, T), | |
| 31 | } | |
| 32 | ||
| 33 | trait Bar { | |
| 34 | fn bar(&self, r: &mut Re<u8>); | |
| 35 | //~^ NOTE expected | |
| 36 | //~| NOTE `Re` here is elided as `Re<'_, u8>` | |
| 37 | } | |
| 38 | ||
| 39 | impl Bar for Foo { | |
| 40 | fn bar<'a, 'b>(&'a self, _r: &'b mut Re<'a, u8>) {} | |
| 41 | //~^ ERROR `impl` item signature doesn't match `trait` item signature | |
| 42 | //~| NOTE expected signature | |
| 43 | //~| NOTE found | |
| 44 | //~| HELP the lifetime requirements | |
| 45 | //~| HELP verify the lifetime relationships | |
| 46 | } | |
| 47 | } | |
| 48 | ||
| 49 | fn main() {} |
tests/ui/lifetimes/trait-impl-mismatch-elided-lifetime-issue-65866.stderr created+40| ... | ... | @@ -0,0 +1,40 @@ |
| 1 | error: `impl` item signature doesn't match `trait` item signature | |
| 2 | --> $DIR/trait-impl-mismatch-elided-lifetime-issue-65866.rs:17:9 | |
| 3 | | | |
| 4 | LL | fn bar(&self, r: &mut Re); | |
| 5 | | -------------------------- expected `fn(&'1 plain::Foo, &'2 mut plain::Re<'3>)` | |
| 6 | ... | |
| 7 | LL | fn bar<'a, 'b>(&'a self, _r: &'b mut Re<'a>) {} | |
| 8 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 plain::Foo, &'2 mut plain::Re<'1>)` | |
| 9 | | | |
| 10 | = note: expected signature `fn(&'1 plain::Foo, &'2 mut plain::Re<'3>)` | |
| 11 | found signature `fn(&'1 plain::Foo, &'2 mut plain::Re<'1>)` | |
| 12 | = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` | |
| 13 | = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output | |
| 14 | note: `Re` here is elided as `Re<'_>` | |
| 15 | --> $DIR/trait-impl-mismatch-elided-lifetime-issue-65866.rs:11:31 | |
| 16 | | | |
| 17 | LL | fn bar(&self, r: &mut Re); | |
| 18 | | ^^ | |
| 19 | ||
| 20 | error: `impl` item signature doesn't match `trait` item signature | |
| 21 | --> $DIR/trait-impl-mismatch-elided-lifetime-issue-65866.rs:40:9 | |
| 22 | | | |
| 23 | LL | fn bar(&self, r: &mut Re<u8>); | |
| 24 | | ------------------------------ expected `fn(&'1 with_type_args::Foo, &'2 mut with_type_args::Re<'3, u8>)` | |
| 25 | ... | |
| 26 | LL | fn bar<'a, 'b>(&'a self, _r: &'b mut Re<'a, u8>) {} | |
| 27 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ found `fn(&'1 with_type_args::Foo, &'2 mut with_type_args::Re<'1, u8>)` | |
| 28 | | | |
| 29 | = note: expected signature `fn(&'1 with_type_args::Foo, &'2 mut with_type_args::Re<'3, u8>)` | |
| 30 | found signature `fn(&'1 with_type_args::Foo, &'2 mut with_type_args::Re<'1, u8>)` | |
| 31 | = help: the lifetime requirements from the `impl` do not correspond to the requirements in the `trait` | |
| 32 | = help: verify the lifetime relationships in the `trait` and `impl` between the `self` argument, the other inputs and its output | |
| 33 | note: `Re` here is elided as `Re<'_, u8>` | |
| 34 | --> $DIR/trait-impl-mismatch-elided-lifetime-issue-65866.rs:34:31 | |
| 35 | | | |
| 36 | LL | fn bar(&self, r: &mut Re<u8>); | |
| 37 | | ^^ | |
| 38 | ||
| 39 | error: aborting due to 2 previous errors | |
| 40 |
tests/ui/lint/ice-array-into-iter-lint-issue-121532.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | // Typeck fails for the arg type as |
| 6 | 6 | // `Self` makes no sense here |
| 7 | fn func(a: Self::ItemsIterator) { //~ ERROR failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 7 | fn func(a: Self::ItemsIterator) { //~ ERROR cannot find `Self` | |
| 8 | 8 | a.into_iter(); |
| 9 | 9 | } |
| 10 | 10 |
tests/ui/lint/ice-array-into-iter-lint-issue-121532.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 1 | error[E0433]: cannot find `Self` in this scope | |
| 2 | 2 | --> $DIR/ice-array-into-iter-lint-issue-121532.rs:7:12 |
| 3 | 3 | | |
| 4 | 4 | LL | fn func(a: Self::ItemsIterator) { |
tests/ui/macros/builtin-prelude-no-accidents.rs+3-3| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // because macros with the same names are in prelude. |
| 3 | 3 | |
| 4 | 4 | fn main() { |
| 5 | env::current_dir; //~ ERROR use of unresolved module or unlinked crate `env` | |
| 6 | type A = panic::PanicInfo; //~ ERROR use of unresolved module or unlinked crate `panic` | |
| 7 | type B = vec::Vec<u8>; //~ ERROR use of unresolved module or unlinked crate `vec` | |
| 5 | env::current_dir; //~ ERROR cannot find module or crate `env` | |
| 6 | type A = panic::PanicInfo; //~ ERROR cannot find module or crate `panic` | |
| 7 | type B = vec::Vec<u8>; //~ ERROR cannot find module or crate `vec` | |
| 8 | 8 | } |
tests/ui/macros/builtin-prelude-no-accidents.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `env` | |
| 1 | error[E0433]: cannot find module or crate `env` in this scope | |
| 2 | 2 | --> $DIR/builtin-prelude-no-accidents.rs:5:5 |
| 3 | 3 | | |
| 4 | 4 | LL | env::current_dir; |
| ... | ... | @@ -10,7 +10,7 @@ help: consider importing this module |
| 10 | 10 | LL + use std::env; |
| 11 | 11 | | |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `panic` | |
| 13 | error[E0433]: cannot find module or crate `panic` in this scope | |
| 14 | 14 | --> $DIR/builtin-prelude-no-accidents.rs:6:14 |
| 15 | 15 | | |
| 16 | 16 | LL | type A = panic::PanicInfo; |
| ... | ... | @@ -22,7 +22,7 @@ help: consider importing this module |
| 22 | 22 | LL + use std::panic; |
| 23 | 23 | | |
| 24 | 24 | |
| 25 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec` | |
| 25 | error[E0433]: cannot find module or crate `vec` in this scope | |
| 26 | 26 | --> $DIR/builtin-prelude-no-accidents.rs:7:14 |
| 27 | 27 | | |
| 28 | 28 | LL | type B = vec::Vec<u8>; |
tests/ui/macros/builtin-std-paths-fail.rs+16-16| ... | ... | @@ -1,25 +1,25 @@ |
| 1 | 1 | #[derive( |
| 2 | core::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `core` | |
| 3 | //~| ERROR could not find `RustcDecodable` in `core` | |
| 4 | core::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `core` | |
| 5 | //~| ERROR could not find `RustcDecodable` in `core` | |
| 2 | core::RustcDecodable, //~ ERROR cannot find `RustcDecodable` in `core` | |
| 3 | //~| ERROR cannot find `RustcDecodable` in `core` | |
| 4 | core::RustcDecodable, //~ ERROR cannot find `RustcDecodable` in `core` | |
| 5 | //~| ERROR cannot find `RustcDecodable` in `core` | |
| 6 | 6 | )] |
| 7 | #[core::bench] //~ ERROR could not find `bench` in `core` | |
| 8 | #[core::global_allocator] //~ ERROR could not find `global_allocator` in `core` | |
| 9 | #[core::test_case] //~ ERROR could not find `test_case` in `core` | |
| 10 | #[core::test] //~ ERROR could not find `test` in `core` | |
| 7 | #[core::bench] //~ ERROR cannot find `bench` in `core` | |
| 8 | #[core::global_allocator] //~ ERROR cannot find `global_allocator` in `core` | |
| 9 | #[core::test_case] //~ ERROR cannot find `test_case` in `core` | |
| 10 | #[core::test] //~ ERROR cannot find `test` in `core` | |
| 11 | 11 | struct Core; |
| 12 | 12 | |
| 13 | 13 | #[derive( |
| 14 | std::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `std` | |
| 15 | //~| ERROR could not find `RustcDecodable` in `std` | |
| 16 | std::RustcDecodable, //~ ERROR could not find `RustcDecodable` in `std` | |
| 17 | //~| ERROR could not find `RustcDecodable` in `std` | |
| 14 | std::RustcDecodable, //~ ERROR cannot find `RustcDecodable` in `std` | |
| 15 | //~| ERROR cannot find `RustcDecodable` in `std` | |
| 16 | std::RustcDecodable, //~ ERROR cannot find `RustcDecodable` in `std` | |
| 17 | //~| ERROR cannot find `RustcDecodable` in `std` | |
| 18 | 18 | )] |
| 19 | #[std::bench] //~ ERROR could not find `bench` in `std` | |
| 20 | #[std::global_allocator] //~ ERROR could not find `global_allocator` in `std` | |
| 21 | #[std::test_case] //~ ERROR could not find `test_case` in `std` | |
| 22 | #[std::test] //~ ERROR could not find `test` in `std` | |
| 19 | #[std::bench] //~ ERROR cannot find `bench` in `std` | |
| 20 | #[std::global_allocator] //~ ERROR cannot find `global_allocator` in `std` | |
| 21 | #[std::test_case] //~ ERROR cannot find `test_case` in `std` | |
| 22 | #[std::test] //~ ERROR cannot find `test` in `std` | |
| 23 | 23 | struct Std; |
| 24 | 24 | |
| 25 | 25 | fn main() {} |
tests/ui/macros/builtin-std-paths-fail.stderr+16-16| ... | ... | @@ -1,16 +1,16 @@ |
| 1 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` | |
| 1 | error[E0433]: cannot find `RustcDecodable` in `core` | |
| 2 | 2 | --> $DIR/builtin-std-paths-fail.rs:2:11 |
| 3 | 3 | | |
| 4 | 4 | LL | core::RustcDecodable, |
| 5 | 5 | | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `core` |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` | |
| 7 | error[E0433]: cannot find `RustcDecodable` in `core` | |
| 8 | 8 | --> $DIR/builtin-std-paths-fail.rs:4:11 |
| 9 | 9 | | |
| 10 | 10 | LL | core::RustcDecodable, |
| 11 | 11 | | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `core` |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` | |
| 13 | error[E0433]: cannot find `RustcDecodable` in `core` | |
| 14 | 14 | --> $DIR/builtin-std-paths-fail.rs:2:11 |
| 15 | 15 | | |
| 16 | 16 | LL | core::RustcDecodable, |
| ... | ... | @@ -18,7 +18,7 @@ LL | core::RustcDecodable, |
| 18 | 18 | | |
| 19 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 20 | 20 | |
| 21 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `core` | |
| 21 | error[E0433]: cannot find `RustcDecodable` in `core` | |
| 22 | 22 | --> $DIR/builtin-std-paths-fail.rs:4:11 |
| 23 | 23 | | |
| 24 | 24 | LL | core::RustcDecodable, |
| ... | ... | @@ -26,43 +26,43 @@ LL | core::RustcDecodable, |
| 26 | 26 | | |
| 27 | 27 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 28 | 28 | |
| 29 | error[E0433]: failed to resolve: could not find `bench` in `core` | |
| 29 | error[E0433]: cannot find `bench` in `core` | |
| 30 | 30 | --> $DIR/builtin-std-paths-fail.rs:7:9 |
| 31 | 31 | | |
| 32 | 32 | LL | #[core::bench] |
| 33 | 33 | | ^^^^^ could not find `bench` in `core` |
| 34 | 34 | |
| 35 | error[E0433]: failed to resolve: could not find `global_allocator` in `core` | |
| 35 | error[E0433]: cannot find `global_allocator` in `core` | |
| 36 | 36 | --> $DIR/builtin-std-paths-fail.rs:8:9 |
| 37 | 37 | | |
| 38 | 38 | LL | #[core::global_allocator] |
| 39 | 39 | | ^^^^^^^^^^^^^^^^ could not find `global_allocator` in `core` |
| 40 | 40 | |
| 41 | error[E0433]: failed to resolve: could not find `test_case` in `core` | |
| 41 | error[E0433]: cannot find `test_case` in `core` | |
| 42 | 42 | --> $DIR/builtin-std-paths-fail.rs:9:9 |
| 43 | 43 | | |
| 44 | 44 | LL | #[core::test_case] |
| 45 | 45 | | ^^^^^^^^^ could not find `test_case` in `core` |
| 46 | 46 | |
| 47 | error[E0433]: failed to resolve: could not find `test` in `core` | |
| 47 | error[E0433]: cannot find `test` in `core` | |
| 48 | 48 | --> $DIR/builtin-std-paths-fail.rs:10:9 |
| 49 | 49 | | |
| 50 | 50 | LL | #[core::test] |
| 51 | 51 | | ^^^^ could not find `test` in `core` |
| 52 | 52 | |
| 53 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` | |
| 53 | error[E0433]: cannot find `RustcDecodable` in `std` | |
| 54 | 54 | --> $DIR/builtin-std-paths-fail.rs:14:10 |
| 55 | 55 | | |
| 56 | 56 | LL | std::RustcDecodable, |
| 57 | 57 | | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `std` |
| 58 | 58 | |
| 59 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` | |
| 59 | error[E0433]: cannot find `RustcDecodable` in `std` | |
| 60 | 60 | --> $DIR/builtin-std-paths-fail.rs:16:10 |
| 61 | 61 | | |
| 62 | 62 | LL | std::RustcDecodable, |
| 63 | 63 | | ^^^^^^^^^^^^^^ could not find `RustcDecodable` in `std` |
| 64 | 64 | |
| 65 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` | |
| 65 | error[E0433]: cannot find `RustcDecodable` in `std` | |
| 66 | 66 | --> $DIR/builtin-std-paths-fail.rs:14:10 |
| 67 | 67 | | |
| 68 | 68 | LL | std::RustcDecodable, |
| ... | ... | @@ -70,7 +70,7 @@ LL | std::RustcDecodable, |
| 70 | 70 | | |
| 71 | 71 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 72 | 72 | |
| 73 | error[E0433]: failed to resolve: could not find `RustcDecodable` in `std` | |
| 73 | error[E0433]: cannot find `RustcDecodable` in `std` | |
| 74 | 74 | --> $DIR/builtin-std-paths-fail.rs:16:10 |
| 75 | 75 | | |
| 76 | 76 | LL | std::RustcDecodable, |
| ... | ... | @@ -78,25 +78,25 @@ LL | std::RustcDecodable, |
| 78 | 78 | | |
| 79 | 79 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 80 | 80 | |
| 81 | error[E0433]: failed to resolve: could not find `bench` in `std` | |
| 81 | error[E0433]: cannot find `bench` in `std` | |
| 82 | 82 | --> $DIR/builtin-std-paths-fail.rs:19:8 |
| 83 | 83 | | |
| 84 | 84 | LL | #[std::bench] |
| 85 | 85 | | ^^^^^ could not find `bench` in `std` |
| 86 | 86 | |
| 87 | error[E0433]: failed to resolve: could not find `global_allocator` in `std` | |
| 87 | error[E0433]: cannot find `global_allocator` in `std` | |
| 88 | 88 | --> $DIR/builtin-std-paths-fail.rs:20:8 |
| 89 | 89 | | |
| 90 | 90 | LL | #[std::global_allocator] |
| 91 | 91 | | ^^^^^^^^^^^^^^^^ could not find `global_allocator` in `std` |
| 92 | 92 | |
| 93 | error[E0433]: failed to resolve: could not find `test_case` in `std` | |
| 93 | error[E0433]: cannot find `test_case` in `std` | |
| 94 | 94 | --> $DIR/builtin-std-paths-fail.rs:21:8 |
| 95 | 95 | | |
| 96 | 96 | LL | #[std::test_case] |
| 97 | 97 | | ^^^^^^^^^ could not find `test_case` in `std` |
| 98 | 98 | |
| 99 | error[E0433]: failed to resolve: could not find `test` in `std` | |
| 99 | error[E0433]: cannot find `test` in `std` | |
| 100 | 100 | --> $DIR/builtin-std-paths-fail.rs:22:8 |
| 101 | 101 | | |
| 102 | 102 | LL | #[std::test] |
tests/ui/macros/compile_error_macro-suppress-errors.rs+1-1| ... | ... | @@ -36,5 +36,5 @@ fn main() { |
| 36 | 36 | //~^ ERROR: cannot find function `some_function` in module `another_module` |
| 37 | 37 | let _: another_module::SomeType = another_module::Hello::new(); |
| 38 | 38 | //~^ ERROR: cannot find type `SomeType` in module `another_module` |
| 39 | //~^^ ERROR: failed to resolve: could not find `Hello` in `another_module` | |
| 39 | //~| ERROR: cannot find `Hello` in `another_module` | |
| 40 | 40 | } |
tests/ui/macros/compile_error_macro-suppress-errors.stderr+1-1| ... | ... | @@ -16,7 +16,7 @@ error[E0432]: unresolved import `crate::another_module::NotExist` |
| 16 | 16 | LL | use crate::another_module::NotExist; |
| 17 | 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ no `NotExist` in `another_module` |
| 18 | 18 | |
| 19 | error[E0433]: failed to resolve: could not find `Hello` in `another_module` | |
| 19 | error[E0433]: cannot find `Hello` in `another_module` | |
| 20 | 20 | --> $DIR/compile_error_macro-suppress-errors.rs:37:55 |
| 21 | 21 | | |
| 22 | 22 | LL | let _: another_module::SomeType = another_module::Hello::new(); |
tests/ui/macros/macro-inner-attributes.rs+4-4| ... | ... | @@ -4,8 +4,8 @@ macro_rules! test { ($nm:ident, |
| 4 | 4 | #[$a:meta], |
| 5 | 5 | $i:item) => (mod $nm { #![$a] $i }); } |
| 6 | 6 | |
| 7 | test!(a, | |
| 8 | #[cfg(false)], | |
| 7 | test!(a, //~ NOTE: found an item that was configured out | |
| 8 | #[cfg(false)], //~ NOTE: the item is gated here | |
| 9 | 9 | pub fn bar() { }); |
| 10 | 10 | |
| 11 | 11 | test!(b, |
| ... | ... | @@ -14,7 +14,7 @@ test!(b, |
| 14 | 14 | |
| 15 | 15 | #[rustc_dummy] |
| 16 | 16 | fn main() { |
| 17 | a::bar(); | |
| 18 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `a` | |
| 17 | a::bar(); //~ ERROR: cannot find module or crate `a` | |
| 18 | //~^ NOTE: use of unresolved module or unlinked crate `a` | |
| 19 | 19 | b::bar(); |
| 20 | 20 | } |
tests/ui/macros/macro-inner-attributes.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `a` | |
| 1 | error[E0433]: cannot find module or crate `a` in this scope | |
| 2 | 2 | --> $DIR/macro-inner-attributes.rs:17:5 |
| 3 | 3 | | |
| 4 | 4 | LL | a::bar(); |
tests/ui/macros/macro-path-prelude-fail-1.rs+4-2| ... | ... | @@ -1,7 +1,9 @@ |
| 1 | 1 | mod m { |
| 2 | 2 | fn check() { |
| 3 | Vec::clone!(); //~ ERROR failed to resolve: `Vec` is a struct, not a module | |
| 4 | u8::clone!(); //~ ERROR failed to resolve: `u8` is a builtin type, not a module | |
| 3 | Vec::clone!(); //~ ERROR cannot find | |
| 4 | //~^ NOTE `Vec` is a struct, not a module | |
| 5 | u8::clone!(); //~ ERROR cannot find | |
| 6 | //~^ NOTE `u8` is a builtin type, not a module | |
| 5 | 7 | } |
| 6 | 8 | } |
| 7 | 9 |
tests/ui/macros/macro-path-prelude-fail-1.stderr+3-3| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | error[E0433]: failed to resolve: `Vec` is a struct, not a module | |
| 1 | error[E0433]: cannot find module `Vec` in this scope | |
| 2 | 2 | --> $DIR/macro-path-prelude-fail-1.rs:3:9 |
| 3 | 3 | | |
| 4 | 4 | LL | Vec::clone!(); |
| 5 | 5 | | ^^^ `Vec` is a struct, not a module |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: `u8` is a builtin type, not a module | |
| 8 | --> $DIR/macro-path-prelude-fail-1.rs:4:9 | |
| 7 | error[E0433]: cannot find module `u8` in this scope | |
| 8 | --> $DIR/macro-path-prelude-fail-1.rs:5:9 | |
| 9 | 9 | | |
| 10 | 10 | LL | u8::clone!(); |
| 11 | 11 | | ^^ `u8` is a builtin type, not a module |
tests/ui/macros/macro-path-prelude-fail-2.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | mod m { |
| 2 | 2 | fn check() { |
| 3 | Result::Ok!(); //~ ERROR failed to resolve: partially resolved path in a macro | |
| 3 | Result::Ok!(); //~ ERROR cannot find | |
| 4 | 4 | } |
| 5 | 5 | } |
| 6 | 6 |
tests/ui/macros/macro-path-prelude-fail-2.stderr+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | error[E0433]: failed to resolve: partially resolved path in a macro | |
| 1 | error[E0433]: cannot find macro `Ok` in enum `Result` | |
| 2 | 2 | --> $DIR/macro-path-prelude-fail-2.rs:3:9 |
| 3 | 3 | | |
| 4 | 4 | LL | Result::Ok!(); |
| 5 | | ^^^^^^^^^^ partially resolved path in a macro | |
| 5 | | ^^^^^^^^^^ a macro can't exist within an enum | |
| 6 | 6 | |
| 7 | 7 | error: aborting due to 1 previous error |
| 8 | 8 |
tests/ui/macros/macro_path_as_generic_bound.rs+1-1| ... | ... | @@ -4,6 +4,6 @@ macro_rules! foo(($t:path) => { |
| 4 | 4 | impl<T: $t> Foo for T {} |
| 5 | 5 | }); |
| 6 | 6 | |
| 7 | foo!(m::m2::A); //~ ERROR failed to resolve | |
| 7 | foo!(m::m2::A); //~ ERROR cannot find | |
| 8 | 8 | |
| 9 | 9 | fn main() {} |
tests/ui/macros/macro_path_as_generic_bound.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `m` | |
| 1 | error[E0433]: cannot find module or crate `m` in this scope | |
| 2 | 2 | --> $DIR/macro_path_as_generic_bound.rs:7:6 |
| 3 | 3 | | |
| 4 | 4 | LL | foo!(m::m2::A); |
tests/ui/macros/meta-item-absolute-path.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //@ edition:2015 |
| 2 | #[derive(::Absolute)] //~ ERROR failed to resolve | |
| 3 | //~| ERROR failed to resolve | |
| 2 | #[derive(::Absolute)] //~ ERROR cannot find | |
| 3 | //~| ERROR cannot find | |
| 4 | 4 | struct S; |
| 5 | 5 | |
| 6 | 6 | fn main() {} |
tests/ui/macros/meta-item-absolute-path.stderr+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute` | |
| 1 | error[E0433]: cannot find module or crate `Absolute` in the crate root | |
| 2 | 2 | --> $DIR/meta-item-absolute-path.rs:2:12 |
| 3 | 3 | | |
| 4 | 4 | LL | #[derive(::Absolute)] |
| 5 | 5 | | ^^^^^^^^ use of unresolved module or unlinked crate `Absolute` |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `Absolute` | |
| 7 | error[E0433]: cannot find module or crate `Absolute` in the crate root | |
| 8 | 8 | --> $DIR/meta-item-absolute-path.rs:2:12 |
| 9 | 9 | | |
| 10 | 10 | LL | #[derive(::Absolute)] |
tests/ui/mir/issue-121103.rs+4-2| ... | ... | @@ -1,3 +1,5 @@ |
| 1 | 1 | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {} |
| 2 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `lib2` | |
| 3 | //~| ERROR failed to resolve: use of unresolved module or unlinked crate `lib2` | |
| 2 | //~^ ERROR: cannot find | |
| 3 | //~| ERROR: cannot find | |
| 4 | //~| NOTE: use of unresolved module or unlinked crate `lib2` | |
| 5 | //~| NOTE: use of unresolved module or unlinked crate `lib2` |
tests/ui/mir/issue-121103.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `lib2` | |
| 1 | error[E0433]: cannot find module or crate `lib2` in this scope | |
| 2 | 2 | --> $DIR/issue-121103.rs:1:38 |
| 3 | 3 | | |
| 4 | 4 | LL | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {} |
| ... | ... | @@ -6,7 +6,7 @@ LL | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {} |
| 6 | 6 | | |
| 7 | 7 | = help: you might be missing a crate named `lib2` |
| 8 | 8 | |
| 9 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `lib2` | |
| 9 | error[E0433]: cannot find module or crate `lib2` in this scope | |
| 10 | 10 | --> $DIR/issue-121103.rs:1:13 |
| 11 | 11 | | |
| 12 | 12 | LL | fn main(_: <lib2::GenericType<42> as lib2::TypeFn>::Output) {} |
tests/ui/modules/super-at-crate-root.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //! Check that `super` keyword used at the crate root (top-level) results in a compilation error |
| 2 | 2 | //! as there is no parent module to resolve. |
| 3 | 3 | |
| 4 | use super::f; //~ ERROR there are too many leading `super` keywords | |
| 4 | use super::f; //~ ERROR too many leading `super` keywords | |
| 5 | 5 | |
| 6 | 6 | fn main() {} |
tests/ui/modules/super-at-crate-root.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: there are too many leading `super` keywords | |
| 1 | error[E0433]: too many leading `super` keywords | |
| 2 | 2 | --> $DIR/super-at-crate-root.rs:4:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use super::f; |
tests/ui/parser/const-param-decl-on-type-instead-of-impl.rs+1-1| ... | ... | @@ -11,5 +11,5 @@ fn banana(a: <T<const N: usize>>::BAR) {} |
| 11 | 11 | fn chaenomeles() { |
| 12 | 12 | path::path::Struct::<const N: usize>() |
| 13 | 13 | //~^ ERROR unexpected `const` parameter declaration |
| 14 | //~| ERROR failed to resolve: use of unresolved module or unlinked crate `path` | |
| 14 | //~| ERROR cannot find module or crate `path` | |
| 15 | 15 | } |
tests/ui/parser/const-param-decl-on-type-instead-of-impl.stderr+1-1| ... | ... | @@ -22,7 +22,7 @@ error: unexpected `const` parameter declaration |
| 22 | 22 | LL | path::path::Struct::<const N: usize>() |
| 23 | 23 | | ^^^^^^^^^^^^^^ expected a `const` expression, not a parameter declaration |
| 24 | 24 | |
| 25 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `path` | |
| 25 | error[E0433]: cannot find module or crate `path` in this scope | |
| 26 | 26 | --> $DIR/const-param-decl-on-type-instead-of-impl.rs:12:5 |
| 27 | 27 | | |
| 28 | 28 | LL | path::path::Struct::<const N: usize>() |
tests/ui/parser/dyn-trait-compatibility.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | type A0 = dyn; |
| 4 | 4 | //~^ ERROR cannot find type `dyn` in this scope |
| 5 | 5 | type A1 = dyn::dyn; |
| 6 | //~^ ERROR use of unresolved module or unlinked crate `dyn` | |
| 6 | //~^ ERROR cannot find module or crate `dyn` in this scope | |
| 7 | 7 | type A2 = dyn<dyn, dyn>; |
| 8 | 8 | //~^ ERROR cannot find type `dyn` in this scope |
| 9 | 9 | //~| ERROR cannot find type `dyn` in this scope |
tests/ui/parser/dyn-trait-compatibility.stderr+1-1| ... | ... | @@ -40,7 +40,7 @@ error[E0425]: cannot find type `dyn` in this scope |
| 40 | 40 | LL | type A3 = dyn<<dyn as dyn>::dyn>; |
| 41 | 41 | | ^^^ not found in this scope |
| 42 | 42 | |
| 43 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `dyn` | |
| 43 | error[E0433]: cannot find module or crate `dyn` in this scope | |
| 44 | 44 | --> $DIR/dyn-trait-compatibility.rs:5:11 |
| 45 | 45 | | |
| 46 | 46 | LL | type A1 = dyn::dyn; |
tests/ui/parser/mod_file_not_exist.rs+5-4| ... | ... | @@ -1,8 +1,9 @@ |
| 1 | mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` | |
| 2 | //~^ HELP to create the module `not_a_real_file`, create file | |
| 1 | mod not_a_real_file; | |
| 2 | //~^ ERROR: file not found for module `not_a_real_file` | |
| 3 | //~| HELP: to create the module `not_a_real_file`, create file | |
| 3 | 4 | |
| 4 | 5 | fn main() { |
| 5 | 6 | assert_eq!(mod_file_aux::bar(), 10); |
| 6 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux` | |
| 7 | //~| HELP you might be missing a crate named `mod_file_aux` | |
| 7 | //~^ ERROR: cannot find module or crate `mod_file_aux` | |
| 8 | //~| HELP: you might be missing a crate named `mod_file_aux` | |
| 8 | 9 | } |
tests/ui/parser/mod_file_not_exist.stderr+2-2| ... | ... | @@ -7,8 +7,8 @@ LL | mod not_a_real_file; |
| 7 | 7 | = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" |
| 8 | 8 | = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead |
| 9 | 9 | |
| 10 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux` | |
| 11 | --> $DIR/mod_file_not_exist.rs:5:16 | |
| 10 | error[E0433]: cannot find module or crate `mod_file_aux` in this scope | |
| 11 | --> $DIR/mod_file_not_exist.rs:6:16 | |
| 12 | 12 | | |
| 13 | 13 | LL | assert_eq!(mod_file_aux::bar(), 10); |
| 14 | 14 | | ^^^^^^^^^^^^ use of unresolved module or unlinked crate `mod_file_aux` |
tests/ui/parser/mod_file_not_exist_windows.rs+1-1| ... | ... | @@ -5,6 +5,6 @@ mod not_a_real_file; //~ ERROR file not found for module `not_a_real_file` |
| 5 | 5 | |
| 6 | 6 | fn main() { |
| 7 | 7 | assert_eq!(mod_file_aux::bar(), 10); |
| 8 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `mod_file_aux` | |
| 8 | //~^ ERROR cannot find module or crate `mod_file_aux` in this scope | |
| 9 | 9 | //~| HELP you might be missing a crate named `mod_file_aux` |
| 10 | 10 | } |
tests/ui/parser/mod_file_not_exist_windows.stderr+1-1| ... | ... | @@ -7,7 +7,7 @@ LL | mod not_a_real_file; |
| 7 | 7 | = help: to create the module `not_a_real_file`, create file "$DIR/not_a_real_file.rs" or "$DIR/not_a_real_file/mod.rs" |
| 8 | 8 | = note: if there is a `mod not_a_real_file` elsewhere in the crate already, import it with `use crate::...` instead |
| 9 | 9 | |
| 10 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `mod_file_aux` | |
| 10 | error[E0433]: cannot find module or crate `mod_file_aux` in this scope | |
| 11 | 11 | --> $DIR/mod_file_not_exist_windows.rs:7:16 |
| 12 | 12 | | |
| 13 | 13 | LL | assert_eq!(mod_file_aux::bar(), 10); |
tests/ui/pattern/pattern-error-continue.rs+1-1| ... | ... | @@ -32,6 +32,6 @@ fn main() { |
| 32 | 32 | //~| NOTE expected `char`, found `bool` |
| 33 | 33 | |
| 34 | 34 | match () { |
| 35 | E::V => {} //~ ERROR failed to resolve: use of undeclared type `E` | |
| 35 | E::V => {} //~ ERROR cannot find type `E` | |
| 36 | 36 | } |
| 37 | 37 | } |
tests/ui/pattern/pattern-error-continue.stderr+1-1| ... | ... | @@ -52,7 +52,7 @@ note: function defined here |
| 52 | 52 | LL | fn f(_c: char) {} |
| 53 | 53 | | ^ -------- |
| 54 | 54 | |
| 55 | error[E0433]: failed to resolve: use of undeclared type `E` | |
| 55 | error[E0433]: cannot find type `E` in this scope | |
| 56 | 56 | --> $DIR/pattern-error-continue.rs:35:9 |
| 57 | 57 | | |
| 58 | 58 | LL | E::V => {} |
tests/ui/privacy/restricted/test.rs+1-1| ... | ... | @@ -48,6 +48,6 @@ fn main() { |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | mod pathological { |
| 51 | pub(in bad::path) mod m1 {} //~ ERROR failed to resolve: use of unresolved module or unlinked crate `bad` | |
| 51 | pub(in bad::path) mod m1 {} //~ ERROR: cannot find module or crate `bad` | |
| 52 | 52 | pub(in foo) mod m2 {} //~ ERROR visibilities can only be restricted to ancestor modules |
| 53 | 53 | } |
tests/ui/privacy/restricted/test.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `bad` | |
| 1 | error[E0433]: cannot find module or crate `bad` in the crate root | |
| 2 | 2 | --> $DIR/test.rs:51:12 |
| 3 | 3 | | |
| 4 | 4 | LL | pub(in bad::path) mod m1 {} |
tests/ui/privacy/unreachable-issue-121455.rs+2-1| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | fn test(s: &Self::Id) { |
| 2 | //~^ ERROR failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 2 | //~^ ERROR: cannot find `Self` | |
| 3 | //~| NOTE: `Self` is only available in impls, traits, and type definitions | |
| 3 | 4 | match &s[0..3] {} |
| 4 | 5 | } |
| 5 | 6 |
tests/ui/privacy/unreachable-issue-121455.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 1 | error[E0433]: cannot find `Self` in this scope | |
| 2 | 2 | --> $DIR/unreachable-issue-121455.rs:1:13 |
| 3 | 3 | | |
| 4 | 4 | LL | fn test(s: &Self::Id) { |
tests/ui/proc-macro/amputate-span.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `Command` | |
| 1 | error[E0433]: cannot find type `Command` in this scope | |
| 2 | 2 | --> $DIR/amputate-span.rs:49:5 |
| 3 | 3 | | |
| 4 | 4 | LL | Command::new("git"); |
| ... | ... | @@ -9,7 +9,7 @@ help: consider importing this struct |
| 9 | 9 | LL + use std::process::Command; |
| 10 | 10 | | |
| 11 | 11 | |
| 12 | error[E0433]: failed to resolve: use of undeclared type `Command` | |
| 12 | error[E0433]: cannot find type `Command` in this scope | |
| 13 | 13 | --> $DIR/amputate-span.rs:63:9 |
| 14 | 14 | | |
| 15 | 15 | LL | Command::new("git"); |
tests/ui/proc-macro/pretty-print-hack-hide.rs deleted-12| ... | ... | @@ -1,12 +0,0 @@ |
| 1 | //@ proc-macro: test-macros.rs | |
| 2 | //@ compile-flags: -Z span-debug | |
| 3 | //@ check-pass | |
| 4 | ||
| 5 | #![no_std] // Don't load unnecessary hygiene information from std | |
| 6 | extern crate std; | |
| 7 | ||
| 8 | #[macro_use] extern crate test_macros; | |
| 9 | ||
| 10 | include!("pretty-print-hack/rental-0.5.6/src/lib.rs"); | |
| 11 | ||
| 12 | fn main() {} |
tests/ui/proc-macro/pretty-print-hack-hide.stdout deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | PRINT-DERIVE INPUT (DISPLAY): enum ProceduralMasqueradeDummyType { Input } | |
| 2 | PRINT-DERIVE INPUT (DEBUG): TokenStream [ | |
| 3 | Ident { | |
| 4 | ident: "enum", | |
| 5 | span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:4:1: 4:5 (#0), | |
| 6 | }, | |
| 7 | Ident { | |
| 8 | ident: "ProceduralMasqueradeDummyType", | |
| 9 | span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:4:6: 4:35 (#0), | |
| 10 | }, | |
| 11 | Group { | |
| 12 | delimiter: Brace, | |
| 13 | stream: TokenStream [ | |
| 14 | Ident { | |
| 15 | ident: "Input", | |
| 16 | span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:13:5: 13:10 (#0), | |
| 17 | }, | |
| 18 | ], | |
| 19 | span: $DIR/pretty-print-hack/rental-0.5.6/src/lib.rs:4:36: 14:2 (#0), | |
| 20 | }, | |
| 21 | ] |
tests/ui/proc-macro/pretty-print-hack-show.local.stderr deleted-6| ... | ... | @@ -1,6 +0,0 @@ |
| 1 | error: using an old version of `rental` | |
| 2 | | | |
| 3 | = note: older versions of the `rental` crate no longer compile; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives | |
| 4 | ||
| 5 | error: aborting due to 1 previous error | |
| 6 |
tests/ui/proc-macro/pretty-print-hack-show.remapped.stderr deleted-6| ... | ... | @@ -1,6 +0,0 @@ |
| 1 | error: using an old version of `rental` | |
| 2 | | | |
| 3 | = note: older versions of the `rental` crate no longer compile; please update to `rental` v0.5.6, or switch to one of the `rental` alternatives | |
| 4 | ||
| 5 | error: aborting due to 1 previous error | |
| 6 |
tests/ui/proc-macro/pretty-print-hack-show.rs deleted-21| ... | ... | @@ -1,21 +0,0 @@ |
| 1 | //@ proc-macro: test-macros.rs | |
| 2 | //@ compile-flags: -Z span-debug | |
| 3 | //@ revisions: local remapped | |
| 4 | //@ [remapped] remap-src-base | |
| 5 | ||
| 6 | #![no_std] // Don't load unnecessary hygiene information from std | |
| 7 | extern crate std; | |
| 8 | ||
| 9 | #[macro_use] extern crate test_macros; | |
| 10 | ||
| 11 | mod first { | |
| 12 | include!("pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs"); | |
| 13 | } | |
| 14 | ||
| 15 | mod second { | |
| 16 | include!("pretty-print-hack/rental-0.5.5/src/lib.rs"); | |
| 17 | } | |
| 18 | ||
| 19 | fn main() {} | |
| 20 | ||
| 21 | //~? ERROR using an old version of `rental` |
tests/ui/proc-macro/pretty-print-hack/allsorts-rental-0.5.6/src/lib.rs deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | //@ ignore-auxiliary (used by `../../../pretty-print-hack-show.rs`) | |
| 2 | ||
| 3 | #[derive(Print)] | |
| 4 | enum ProceduralMasqueradeDummyType { | |
| 5 | //~^ ERROR using | |
| 6 | //~| WARN this was previously | |
| 7 | //~| ERROR using | |
| 8 | //~| WARN this was previously | |
| 9 | //~| ERROR using | |
| 10 | //~| WARN this was previously | |
| 11 | //~| ERROR using | |
| 12 | //~| WARN this was previously | |
| 13 | Input | |
| 14 | } |
tests/ui/proc-macro/pretty-print-hack/rental-0.5.5/src/lib.rs deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | //@ ignore-auxiliary (used by `../../../pretty-print-hack-show.rs`) | |
| 2 | ||
| 3 | #[derive(Print)] | |
| 4 | enum ProceduralMasqueradeDummyType { | |
| 5 | //~^ ERROR using | |
| 6 | //~| WARN this was previously | |
| 7 | //~| ERROR using | |
| 8 | //~| WARN this was previously | |
| 9 | //~| ERROR using | |
| 10 | //~| WARN this was previously | |
| 11 | //~| ERROR using | |
| 12 | //~| WARN this was previously | |
| 13 | Input | |
| 14 | } |
tests/ui/proc-macro/pretty-print-hack/rental-0.5.6/src/lib.rs deleted-14| ... | ... | @@ -1,14 +0,0 @@ |
| 1 | //@ ignore-auxiliary (used by `../../../pretty-print-hack/hide.rs`) | |
| 2 | ||
| 3 | #[derive(Print)] | |
| 4 | enum ProceduralMasqueradeDummyType { | |
| 5 | //~^ ERROR using | |
| 6 | //~| WARN this was previously | |
| 7 | //~| ERROR using | |
| 8 | //~| WARN this was previously | |
| 9 | //~| ERROR using | |
| 10 | //~| WARN this was previously | |
| 11 | //~| ERROR using | |
| 12 | //~| WARN this was previously | |
| 13 | Input | |
| 14 | } |
tests/ui/resolve/112590-2.fixed+5-5| ... | ... | @@ -16,7 +16,7 @@ mod u { |
| 16 | 16 | use foo::bar::baz::MyVec; |
| 17 | 17 | |
| 18 | 18 | fn _a() { |
| 19 | let _: Vec<i32> = MyVec::new(); //~ ERROR failed to resolve | |
| 19 | let _: Vec<i32> = MyVec::new(); //~ ERROR cannot find | |
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | |
| ... | ... | @@ -24,12 +24,12 @@ mod v { |
| 24 | 24 | use foo::bar::baz::MyVec; |
| 25 | 25 | |
| 26 | 26 | fn _b() { |
| 27 | let _: Vec<i32> = MyVec::new(); //~ ERROR failed to resolve | |
| 27 | let _: Vec<i32> = MyVec::new(); //~ ERROR cannot find | |
| 28 | 28 | } |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | fn main() { |
| 32 | let _t: Vec<i32> = Vec::new(); //~ ERROR failed to resolve | |
| 33 | type _B = vec::Vec::<u8>; //~ ERROR failed to resolve | |
| 34 | let _t = AtomicBool::new(true); //~ ERROR failed to resolve | |
| 32 | let _t: Vec<i32> = Vec::new(); //~ ERROR cannot find | |
| 33 | type _B = vec::Vec::<u8>; //~ ERROR cannot find | |
| 34 | let _t = AtomicBool::new(true); //~ ERROR cannot find | |
| 35 | 35 | } |
tests/ui/resolve/112590-2.rs+5-5| ... | ... | @@ -10,18 +10,18 @@ mod foo { |
| 10 | 10 | |
| 11 | 11 | mod u { |
| 12 | 12 | fn _a() { |
| 13 | let _: Vec<i32> = super::foo::baf::baz::MyVec::new(); //~ ERROR failed to resolve | |
| 13 | let _: Vec<i32> = super::foo::baf::baz::MyVec::new(); //~ ERROR cannot find | |
| 14 | 14 | } |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | mod v { |
| 18 | 18 | fn _b() { |
| 19 | let _: Vec<i32> = fox::bar::baz::MyVec::new(); //~ ERROR failed to resolve | |
| 19 | let _: Vec<i32> = fox::bar::baz::MyVec::new(); //~ ERROR cannot find | |
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | fn main() { |
| 24 | let _t: Vec<i32> = vec::new(); //~ ERROR failed to resolve | |
| 25 | type _B = vec::Vec::<u8>; //~ ERROR failed to resolve | |
| 26 | let _t = std::sync_error::atomic::AtomicBool::new(true); //~ ERROR failed to resolve | |
| 24 | let _t: Vec<i32> = vec::new(); //~ ERROR cannot find | |
| 25 | type _B = vec::Vec::<u8>; //~ ERROR cannot find | |
| 26 | let _t = std::sync_error::atomic::AtomicBool::new(true); //~ ERROR cannot find | |
| 27 | 27 | } |
tests/ui/resolve/112590-2.stderr+5-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `baf` in `foo` | |
| 1 | error[E0433]: cannot find `baf` in `foo` | |
| 2 | 2 | --> $DIR/112590-2.rs:13:39 |
| 3 | 3 | | |
| 4 | 4 | LL | let _: Vec<i32> = super::foo::baf::baz::MyVec::new(); |
| ... | ... | @@ -14,7 +14,7 @@ LL - let _: Vec<i32> = super::foo::baf::baz::MyVec::new(); |
| 14 | 14 | LL + let _: Vec<i32> = MyVec::new(); |
| 15 | 15 | | |
| 16 | 16 | |
| 17 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fox` | |
| 17 | error[E0433]: cannot find module or crate `fox` in this scope | |
| 18 | 18 | --> $DIR/112590-2.rs:19:27 |
| 19 | 19 | | |
| 20 | 20 | LL | let _: Vec<i32> = fox::bar::baz::MyVec::new(); |
| ... | ... | @@ -31,7 +31,7 @@ LL - let _: Vec<i32> = fox::bar::baz::MyVec::new(); |
| 31 | 31 | LL + let _: Vec<i32> = MyVec::new(); |
| 32 | 32 | | |
| 33 | 33 | |
| 34 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec` | |
| 34 | error[E0433]: cannot find module or crate `vec` in this scope | |
| 35 | 35 | --> $DIR/112590-2.rs:25:15 |
| 36 | 36 | | |
| 37 | 37 | LL | type _B = vec::Vec::<u8>; |
| ... | ... | @@ -43,7 +43,7 @@ help: consider importing this module |
| 43 | 43 | LL + use std::vec; |
| 44 | 44 | | |
| 45 | 45 | |
| 46 | error[E0433]: failed to resolve: could not find `sync_error` in `std` | |
| 46 | error[E0433]: cannot find `sync_error` in `std` | |
| 47 | 47 | --> $DIR/112590-2.rs:26:19 |
| 48 | 48 | | |
| 49 | 49 | LL | let _t = std::sync_error::atomic::AtomicBool::new(true); |
| ... | ... | @@ -59,7 +59,7 @@ LL - let _t = std::sync_error::atomic::AtomicBool::new(true); |
| 59 | 59 | LL + let _t = AtomicBool::new(true); |
| 60 | 60 | | |
| 61 | 61 | |
| 62 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `vec` | |
| 62 | error[E0433]: cannot find module or crate `vec` in this scope | |
| 63 | 63 | --> $DIR/112590-2.rs:24:24 |
| 64 | 64 | | |
| 65 | 65 | LL | let _t: Vec<i32> = vec::new(); |
tests/ui/resolve/bad-module.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | fn main() { |
| 2 | 2 | let foo = thing::len(Vec::new()); |
| 3 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `thing` | |
| 3 | //~^ ERROR cannot find module or crate `thing` | |
| 4 | 4 | |
| 5 | 5 | let foo = foo::bar::baz(); |
| 6 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 6 | //~^ ERROR cannot find module or crate `foo` | |
| 7 | 7 | } |
tests/ui/resolve/bad-module.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 1 | error[E0433]: cannot find module or crate `foo` in this scope | |
| 2 | 2 | --> $DIR/bad-module.rs:5:15 |
| 3 | 3 | | |
| 4 | 4 | LL | let foo = foo::bar::baz(); |
| ... | ... | @@ -6,7 +6,7 @@ LL | let foo = foo::bar::baz(); |
| 6 | 6 | | |
| 7 | 7 | = help: you might be missing a crate named `foo` |
| 8 | 8 | |
| 9 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `thing` | |
| 9 | error[E0433]: cannot find module or crate `thing` in this scope | |
| 10 | 10 | --> $DIR/bad-module.rs:2:15 |
| 11 | 11 | | |
| 12 | 12 | LL | let foo = thing::len(Vec::new()); |
tests/ui/resolve/editions-crate-root-2015.rs+4-4| ... | ... | @@ -2,17 +2,17 @@ |
| 2 | 2 | |
| 3 | 3 | mod inner { |
| 4 | 4 | fn global_inner(_: ::nonexistant::Foo) { |
| 5 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `nonexistant` | |
| 5 | //~^ ERROR: cannot find module or crate `nonexistant` | |
| 6 | 6 | } |
| 7 | 7 | fn crate_inner(_: crate::nonexistant::Foo) { |
| 8 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `nonexistant` | |
| 8 | //~^ ERROR: cannot find module or crate `nonexistant` | |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | fn bare_global(_: ::nonexistant) { |
| 12 | //~^ ERROR cannot find type `nonexistant` in the crate root | |
| 12 | //~^ ERROR: cannot find type `nonexistant` in the crate root | |
| 13 | 13 | } |
| 14 | 14 | fn bare_crate(_: crate::nonexistant) { |
| 15 | //~^ ERROR cannot find type `nonexistant` in the crate root | |
| 15 | //~^ ERROR: cannot find type `nonexistant` in the crate root | |
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | 18 |
tests/ui/resolve/editions-crate-root-2015.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistant` | |
| 1 | error[E0433]: cannot find module or crate `nonexistant` in the crate root | |
| 2 | 2 | --> $DIR/editions-crate-root-2015.rs:4:26 |
| 3 | 3 | | |
| 4 | 4 | LL | fn global_inner(_: ::nonexistant::Foo) { |
| ... | ... | @@ -9,7 +9,7 @@ help: you might be missing a crate named `nonexistant`, add it to your project a |
| 9 | 9 | LL + extern crate nonexistant; |
| 10 | 10 | | |
| 11 | 11 | |
| 12 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistant` | |
| 12 | error[E0433]: cannot find module or crate `nonexistant` in `crate` | |
| 13 | 13 | --> $DIR/editions-crate-root-2015.rs:7:30 |
| 14 | 14 | | |
| 15 | 15 | LL | fn crate_inner(_: crate::nonexistant::Foo) { |
tests/ui/resolve/editions-crate-root-2018.rs+4-4| ... | ... | @@ -2,17 +2,17 @@ |
| 2 | 2 | |
| 3 | 3 | mod inner { |
| 4 | 4 | fn global_inner(_: ::nonexistant::Foo) { |
| 5 | //~^ ERROR failed to resolve: could not find `nonexistant` in the list of imported crates | |
| 5 | //~^ ERROR: cannot find `nonexistant` | |
| 6 | 6 | } |
| 7 | 7 | fn crate_inner(_: crate::nonexistant::Foo) { |
| 8 | //~^ ERROR failed to resolve: could not find `nonexistant` in the crate root | |
| 8 | //~^ ERROR: cannot find `nonexistant` | |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | fn bare_global(_: ::nonexistant) { |
| 12 | //~^ ERROR cannot find crate `nonexistant` in the list of imported crates | |
| 12 | //~^ ERROR: cannot find crate `nonexistant` | |
| 13 | 13 | } |
| 14 | 14 | fn bare_crate(_: crate::nonexistant) { |
| 15 | //~^ ERROR cannot find type `nonexistant` in the crate root | |
| 15 | //~^ ERROR: cannot find type `nonexistant` in the crate root | |
| 16 | 16 | } |
| 17 | 17 | } |
| 18 | 18 |
tests/ui/resolve/editions-crate-root-2018.stderr+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | error[E0433]: failed to resolve: could not find `nonexistant` in the list of imported crates | |
| 1 | error[E0433]: cannot find `nonexistant` in the crate root | |
| 2 | 2 | --> $DIR/editions-crate-root-2018.rs:4:26 |
| 3 | 3 | | |
| 4 | 4 | LL | fn global_inner(_: ::nonexistant::Foo) { |
| 5 | 5 | | ^^^^^^^^^^^ could not find `nonexistant` in the list of imported crates |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: could not find `nonexistant` in the crate root | |
| 7 | error[E0433]: cannot find `nonexistant` in `crate` | |
| 8 | 8 | --> $DIR/editions-crate-root-2018.rs:7:30 |
| 9 | 9 | | |
| 10 | 10 | LL | fn crate_inner(_: crate::nonexistant::Foo) { |
tests/ui/resolve/export-fully-qualified-2018.rs+2-1| ... | ... | @@ -5,7 +5,8 @@ |
| 5 | 5 | // want to change eventually. |
| 6 | 6 | |
| 7 | 7 | mod foo { |
| 8 | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 8 | pub fn bar() { foo::baz(); } //~ ERROR: cannot find | |
| 9 | //~^ NOTE: use of unresolved module or unlinked crate `foo` | |
| 9 | 10 | |
| 10 | 11 | fn baz() { } |
| 11 | 12 | } |
tests/ui/resolve/export-fully-qualified-2018.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 1 | error[E0433]: cannot find module or crate `foo` in this scope | |
| 2 | 2 | --> $DIR/export-fully-qualified-2018.rs:8:20 |
| 3 | 3 | | |
| 4 | 4 | LL | pub fn bar() { foo::baz(); } |
tests/ui/resolve/export-fully-qualified.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | // want to change eventually. |
| 6 | 6 | |
| 7 | 7 | mod foo { |
| 8 | pub fn bar() { foo::baz(); } //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 8 | pub fn bar() { foo::baz(); } //~ ERROR cannot find module or crate `foo` | |
| 9 | 9 | |
| 10 | 10 | fn baz() { } |
| 11 | 11 | } |
tests/ui/resolve/export-fully-qualified.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 1 | error[E0433]: cannot find module or crate `foo` in this scope | |
| 2 | 2 | --> $DIR/export-fully-qualified.rs:8:20 |
| 3 | 3 | | |
| 4 | 4 | LL | pub fn bar() { foo::baz(); } |
tests/ui/resolve/exported-macro-in-mod-147958.rs created+21| ... | ... | @@ -0,0 +1,21 @@ |
| 1 | //! Regression test for <https://github.com/rust-lang/rust/issues/147958> | |
| 2 | ||
| 3 | //@ check-pass | |
| 4 | ||
| 5 | #![feature(decl_macro)] | |
| 6 | ||
| 7 | macro_rules! exported { | |
| 8 | () => { | |
| 9 | #[macro_export] | |
| 10 | macro_rules! exported { | |
| 11 | () => {}; | |
| 12 | } | |
| 13 | }; | |
| 14 | } | |
| 15 | use inner1::*; | |
| 16 | exported!(); | |
| 17 | mod inner1 { | |
| 18 | pub macro exported() {} | |
| 19 | } | |
| 20 | ||
| 21 | fn main() {} |
tests/ui/resolve/extern-prelude-fail.rs+1-1| ... | ... | @@ -6,5 +6,5 @@ |
| 6 | 6 | |
| 7 | 7 | fn main() { |
| 8 | 8 | use extern_prelude::S; //~ ERROR unresolved import `extern_prelude` |
| 9 | let s = ::extern_prelude::S; //~ ERROR failed to resolve | |
| 9 | let s = ::extern_prelude::S; //~ ERROR cannot find module or crate `extern_prelude` | |
| 10 | 10 | } |
tests/ui/resolve/extern-prelude-fail.stderr+1-1| ... | ... | @@ -9,7 +9,7 @@ help: you might be missing a crate named `extern_prelude`, add it to your projec |
| 9 | 9 | LL + extern crate extern_prelude; |
| 10 | 10 | | |
| 11 | 11 | |
| 12 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `extern_prelude` | |
| 12 | error[E0433]: cannot find module or crate `extern_prelude` in the crate root | |
| 13 | 13 | --> $DIR/extern-prelude-fail.rs:9:15 |
| 14 | 14 | | |
| 15 | 15 | LL | let s = ::extern_prelude::S; |
tests/ui/resolve/function-module-ambiguity-error-71406.rs+2-1| ... | ... | @@ -3,5 +3,6 @@ use std::sync::mpsc; |
| 3 | 3 | |
| 4 | 4 | fn main() { |
| 5 | 5 | let (tx, rx) = mpsc::channel::new(1); |
| 6 | //~^ ERROR expected type, found function `channel` in `mpsc` | |
| 6 | //~^ ERROR: cannot find `channel` | |
| 7 | //~| NOTE: expected type, found function `channel` in `mpsc` | |
| 7 | 8 | } |
tests/ui/resolve/function-module-ambiguity-error-71406.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: expected type, found function `channel` in `mpsc` | |
| 1 | error[E0433]: cannot find `channel` in `mpsc` | |
| 2 | 2 | --> $DIR/function-module-ambiguity-error-71406.rs:5:26 |
| 3 | 3 | | |
| 4 | 4 | LL | let (tx, rx) = mpsc::channel::new(1); |
tests/ui/resolve/impl-items-vis-unresolved.rs+1-1| ... | ... | @@ -19,7 +19,7 @@ pub struct RawFloatState; |
| 19 | 19 | impl RawFloatState { |
| 20 | 20 | perftools_inline! { |
| 21 | 21 | pub(super) fn new() {} |
| 22 | //~^ ERROR failed to resolve: there are too many leading `super` keywords | |
| 22 | //~^ ERROR: too many leading `super` keywords | |
| 23 | 23 | } |
| 24 | 24 | } |
| 25 | 25 |
tests/ui/resolve/impl-items-vis-unresolved.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: there are too many leading `super` keywords | |
| 1 | error[E0433]: too many leading `super` keywords | |
| 2 | 2 | --> $DIR/impl-items-vis-unresolved.rs:21:13 |
| 3 | 3 | | |
| 4 | 4 | LL | pub(super) fn new() {} |
tests/ui/resolve/issue-101749-2.rs+1-1| ... | ... | @@ -12,5 +12,5 @@ fn main() { |
| 12 | 12 | let rect = Rectangle::new(3, 4); |
| 13 | 13 | // `area` is not implemented for `Rectangle`, so this should not suggest |
| 14 | 14 | let _ = rect::area(); |
| 15 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect` | |
| 15 | //~^ ERROR: cannot find module or crate `rect` | |
| 16 | 16 | } |
tests/ui/resolve/issue-101749-2.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rect` | |
| 1 | error[E0433]: cannot find module or crate `rect` in this scope | |
| 2 | 2 | --> $DIR/issue-101749-2.rs:14:13 |
| 3 | 3 | | |
| 4 | 4 | LL | let _ = rect::area(); |
tests/ui/resolve/issue-101749.fixed+1-1| ... | ... | @@ -15,5 +15,5 @@ impl Rectangle { |
| 15 | 15 | fn main() { |
| 16 | 16 | let rect = Rectangle::new(3, 4); |
| 17 | 17 | let _ = rect.area(); |
| 18 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect` | |
| 18 | //~^ ERROR: cannot find module or crate `rect` | |
| 19 | 19 | } |
tests/ui/resolve/issue-101749.rs+1-1| ... | ... | @@ -15,5 +15,5 @@ impl Rectangle { |
| 15 | 15 | fn main() { |
| 16 | 16 | let rect = Rectangle::new(3, 4); |
| 17 | 17 | let _ = rect::area(); |
| 18 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `rect` | |
| 18 | //~^ ERROR: cannot find module or crate `rect` | |
| 19 | 19 | } |
tests/ui/resolve/issue-101749.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rect` | |
| 1 | error[E0433]: cannot find module or crate `rect` in this scope | |
| 2 | 2 | --> $DIR/issue-101749.rs:17:13 |
| 3 | 3 | | |
| 4 | 4 | LL | let _ = rect::area(); |
tests/ui/resolve/issue-109250.rs+1-1| ... | ... | @@ -1,3 +1,3 @@ |
| 1 | 1 | fn main() { //~ HELP consider importing |
| 2 | HashMap::new; //~ ERROR failed to resolve: use of undeclared type `HashMap` | |
| 2 | HashMap::new; //~ ERROR cannot find type `HashMap` | |
| 3 | 3 | } |
tests/ui/resolve/issue-109250.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `HashMap` | |
| 1 | error[E0433]: cannot find type `HashMap` in this scope | |
| 2 | 2 | --> $DIR/issue-109250.rs:2:5 |
| 3 | 3 | | |
| 4 | 4 | LL | HashMap::new; |
tests/ui/resolve/issue-117920.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | #![crate_type = "lib"] |
| 2 | 2 | |
| 3 | use super::A; //~ ERROR failed to resolve | |
| 3 | use super::A; //~ ERROR too many leading `super` keywords | |
| 4 | 4 | |
| 5 | 5 | mod b { |
| 6 | 6 | pub trait A {} |
tests/ui/resolve/issue-117920.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: there are too many leading `super` keywords | |
| 1 | error[E0433]: too many leading `super` keywords | |
| 2 | 2 | --> $DIR/issue-117920.rs:3:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use super::A; |
tests/ui/resolve/issue-24968.rs+2-2| ... | ... | @@ -19,12 +19,12 @@ const FOO: Self = 0; |
| 19 | 19 | //~^ ERROR cannot find type `Self` |
| 20 | 20 | |
| 21 | 21 | const FOO2: u32 = Self::bar(); |
| 22 | //~^ ERROR failed to resolve: `Self` | |
| 22 | //~^ ERROR cannot find `Self` | |
| 23 | 23 | |
| 24 | 24 | static FOO_S: Self = 0; |
| 25 | 25 | //~^ ERROR cannot find type `Self` |
| 26 | 26 | |
| 27 | 27 | static FOO_S2: u32 = Self::bar(); |
| 28 | //~^ ERROR failed to resolve: `Self` | |
| 28 | //~^ ERROR cannot find `Self` | |
| 29 | 29 | |
| 30 | 30 | fn main() {} |
tests/ui/resolve/issue-24968.stderr+2-2| ... | ... | @@ -39,13 +39,13 @@ LL | static FOO_S: Self = 0; |
| 39 | 39 | | | |
| 40 | 40 | | `Self` not allowed in a static item |
| 41 | 41 | |
| 42 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 42 | error[E0433]: cannot find `Self` in this scope | |
| 43 | 43 | --> $DIR/issue-24968.rs:21:19 |
| 44 | 44 | | |
| 45 | 45 | LL | const FOO2: u32 = Self::bar(); |
| 46 | 46 | | ^^^^ `Self` is only available in impls, traits, and type definitions |
| 47 | 47 | |
| 48 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 48 | error[E0433]: cannot find `Self` in this scope | |
| 49 | 49 | --> $DIR/issue-24968.rs:27:22 |
| 50 | 50 | | |
| 51 | 51 | LL | static FOO_S2: u32 = Self::bar(); |
tests/ui/resolve/issue-81508.rs+2-2| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | fn main() { |
| 9 | 9 | let Baz: &str = ""; |
| 10 | 10 | |
| 11 | println!("{}", Baz::Bar); //~ ERROR: failed to resolve: use of undeclared type `Baz` | |
| 11 | println!("{}", Baz::Bar); //~ ERROR: cannot find type `Baz` | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | #[allow(non_upper_case_globals)] |
| ... | ... | @@ -17,6 +17,6 @@ pub const Foo: &str = ""; |
| 17 | 17 | mod submod { |
| 18 | 18 | use super::Foo; |
| 19 | 19 | fn function() { |
| 20 | println!("{}", Foo::Bar); //~ ERROR: failed to resolve: use of undeclared type `Foo` | |
| 20 | println!("{}", Foo::Bar); //~ ERROR: cannot find type `Foo` | |
| 21 | 21 | } |
| 22 | 22 | } |
tests/ui/resolve/issue-81508.stderr+4-10| ... | ... | @@ -1,20 +1,14 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `Baz` | |
| 1 | error[E0433]: cannot find type `Baz` in this scope | |
| 2 | 2 | --> $DIR/issue-81508.rs:11:20 |
| 3 | 3 | | |
| 4 | LL | let Baz: &str = ""; | |
| 5 | | --- help: `Baz` is defined here, but is not a type | |
| 6 | LL | | |
| 7 | 4 | LL | println!("{}", Baz::Bar); |
| 8 | | ^^^ use of undeclared type `Baz` | |
| 5 | | ^^^ `Baz` is declared as a local binding at `issue-81508.rs:9:9`, not a type | |
| 9 | 6 | |
| 10 | error[E0433]: failed to resolve: use of undeclared type `Foo` | |
| 7 | error[E0433]: cannot find type `Foo` in this scope | |
| 11 | 8 | --> $DIR/issue-81508.rs:20:24 |
| 12 | 9 | | |
| 13 | LL | use super::Foo; | |
| 14 | | ---------- help: `Foo` is defined here, but is not a type | |
| 15 | LL | fn function() { | |
| 16 | 10 | LL | println!("{}", Foo::Bar); |
| 17 | | ^^^ use of undeclared type `Foo` | |
| 11 | | ^^^ `Foo` is declared as a constant at `issue-81508.rs:18:9`, not a type | |
| 18 | 12 | |
| 19 | 13 | error: aborting due to 2 previous errors |
| 20 | 14 |
tests/ui/resolve/issue-82156.rs+1-1| ... | ... | @@ -1,3 +1,3 @@ |
| 1 | 1 | fn main() { |
| 2 | super(); //~ ERROR failed to resolve: there are too many leading `super` keywords | |
| 2 | super(); //~ ERROR: too many leading `super` keywords | |
| 3 | 3 | } |
tests/ui/resolve/issue-82156.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: there are too many leading `super` keywords | |
| 1 | error[E0433]: too many leading `super` keywords | |
| 2 | 2 | --> $DIR/issue-82156.rs:2:5 |
| 3 | 3 | | |
| 4 | 4 | LL | super(); |
tests/ui/resolve/issue-82865.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | |
| 4 | 4 | #![feature(decl_macro)] |
| 5 | 5 | |
| 6 | use x::y::z; //~ ERROR: failed to resolve: use of unresolved module or unlinked crate `x` | |
| 6 | use x::y::z; //~ ERROR: cannot find module or crate `x` | |
| 7 | 7 | |
| 8 | 8 | macro mac () { |
| 9 | 9 | Box::z //~ ERROR: no function or associated item |
tests/ui/resolve/issue-82865.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `x` | |
| 1 | error[E0433]: cannot find module or crate `x` in the crate root | |
| 2 | 2 | --> $DIR/issue-82865.rs:6:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use x::y::z; |
tests/ui/resolve/missing-in-namespace.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | 1 | fn main() { |
| 2 | 2 | let _map = std::hahmap::HashMap::new(); |
| 3 | //~^ ERROR failed to resolve: could not find `hahmap` in `std | |
| 3 | //~^ ERROR: cannot find `hahmap` in `std | |
| 4 | 4 | } |
tests/ui/resolve/missing-in-namespace.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `hahmap` in `std` | |
| 1 | error[E0433]: cannot find `hahmap` in `std` | |
| 2 | 2 | --> $DIR/missing-in-namespace.rs:2:21 |
| 3 | 3 | | |
| 4 | 4 | LL | let _map = std::hahmap::HashMap::new(); |
tests/ui/resolve/prelude-order.rs+2-2| ... | ... | @@ -59,7 +59,7 @@ extern crate macro_helpers as _; |
| 59 | 59 | /* lang and libs implicitly in scope */ |
| 60 | 60 | |
| 61 | 61 | // tool/extern -> extern |
| 62 | #[type_ns::inner] //~ ERROR could not find `inner` in `type_ns` | |
| 62 | #[type_ns::inner] //~ ERROR cannot find `inner` in `type_ns` | |
| 63 | 63 | fn t1() {} |
| 64 | 64 | |
| 65 | 65 | // tool/lang -> tool |
| ... | ... | @@ -71,7 +71,7 @@ fn t2() {} |
| 71 | 71 | fn t3() {} |
| 72 | 72 | |
| 73 | 73 | // extern/lang -> extern |
| 74 | #[usize::inner] //~ ERROR could not find `inner` in `usize` | |
| 74 | #[usize::inner] //~ ERROR cannot find `inner` in `usize` | |
| 75 | 75 | fn e1() {} // NOTE: testing with `-> usize` isn't valid, crates aren't considered in that scope |
| 76 | 76 | // (unless they have generic arguments, for some reason.) |
| 77 | 77 |
tests/ui/resolve/prelude-order.stderr+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | error[E0433]: failed to resolve: could not find `inner` in `type_ns` | |
| 1 | error[E0433]: cannot find `inner` in `type_ns` | |
| 2 | 2 | --> $DIR/prelude-order.rs:62:12 |
| 3 | 3 | | |
| 4 | 4 | LL | #[type_ns::inner] |
| 5 | 5 | | ^^^^^ could not find `inner` in `type_ns` |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: could not find `inner` in `usize` | |
| 7 | error[E0433]: cannot find `inner` in `usize` | |
| 8 | 8 | --> $DIR/prelude-order.rs:74:10 |
| 9 | 9 | | |
| 10 | 10 | LL | #[usize::inner] |
tests/ui/resolve/resolve-bad-visibility.rs+2-2| ... | ... | @@ -5,8 +5,8 @@ trait Tr {} |
| 5 | 5 | pub(in E) struct S; //~ ERROR expected module, found enum `E` |
| 6 | 6 | pub(in Tr) struct Z; //~ ERROR expected module, found trait `Tr` |
| 7 | 7 | pub(in std::vec) struct F; //~ ERROR visibilities can only be restricted to ancestor modules |
| 8 | pub(in nonexistent) struct G; //~ ERROR failed to resolve | |
| 9 | pub(in too_soon) struct H; //~ ERROR failed to resolve | |
| 8 | pub(in nonexistent) struct G; //~ ERROR cannot find | |
| 9 | pub(in too_soon) struct H; //~ ERROR cannot find | |
| 10 | 10 | |
| 11 | 11 | // Visibilities are resolved eagerly without waiting for modules becoming fully populated. |
| 12 | 12 | // Visibilities can only use ancestor modules legally which are always available in time, |
tests/ui/resolve/resolve-bad-visibility.stderr+2-2| ... | ... | @@ -16,7 +16,7 @@ error[E0742]: visibilities can only be restricted to ancestor modules |
| 16 | 16 | LL | pub(in std::vec) struct F; |
| 17 | 17 | | ^^^^^^^^ |
| 18 | 18 | |
| 19 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `nonexistent` | |
| 19 | error[E0433]: cannot find module or crate `nonexistent` in the crate root | |
| 20 | 20 | --> $DIR/resolve-bad-visibility.rs:8:8 |
| 21 | 21 | | |
| 22 | 22 | LL | pub(in nonexistent) struct G; |
| ... | ... | @@ -27,7 +27,7 @@ help: you might be missing a crate named `nonexistent`, add it to your project a |
| 27 | 27 | LL + extern crate nonexistent; |
| 28 | 28 | | |
| 29 | 29 | |
| 30 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `too_soon` | |
| 30 | error[E0433]: cannot find module or crate `too_soon` in the crate root | |
| 31 | 31 | --> $DIR/resolve-bad-visibility.rs:9:8 |
| 32 | 32 | | |
| 33 | 33 | LL | pub(in too_soon) struct H; |
tests/ui/resolve/resolve-variant-assoc-item.rs+2-2| ... | ... | @@ -3,6 +3,6 @@ enum E { V } |
| 3 | 3 | use E::V; |
| 4 | 4 | |
| 5 | 5 | fn main() { |
| 6 | E::V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module | |
| 7 | V::associated_item; //~ ERROR failed to resolve: `V` is a variant, not a module | |
| 6 | E::V::associated_item; //~ ERROR: cannot find | |
| 7 | V::associated_item; //~ ERROR: cannot find | |
| 8 | 8 | } |
tests/ui/resolve/resolve-variant-assoc-item.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `V` is a variant, not a module | |
| 1 | error[E0433]: cannot find module `V` in `E` | |
| 2 | 2 | --> $DIR/resolve-variant-assoc-item.rs:6:8 |
| 3 | 3 | | |
| 4 | 4 | LL | E::V::associated_item; |
| ... | ... | @@ -10,7 +10,7 @@ LL - E::V::associated_item; |
| 10 | 10 | LL + E::associated_item; |
| 11 | 11 | | |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: `V` is a variant, not a module | |
| 13 | error[E0433]: cannot find module `V` in this scope | |
| 14 | 14 | --> $DIR/resolve-variant-assoc-item.rs:7:5 |
| 15 | 15 | | |
| 16 | 16 | LL | V::associated_item; |
tests/ui/resolve/tool-import.rs+2-1| ... | ... | @@ -1,7 +1,8 @@ |
| 1 | 1 | //@ edition: 2018 |
| 2 | 2 | |
| 3 | 3 | use clippy::time::Instant; |
| 4 | //~^ ERROR `clippy` is a tool module | |
| 4 | //~^ ERROR: cannot find module `clippy` | |
| 5 | //~| NOTE: `clippy` is a tool module | |
| 5 | 6 | |
| 6 | 7 | fn main() { |
| 7 | 8 | Instant::now(); |
tests/ui/resolve/tool-import.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `clippy` is a tool module, not a module | |
| 1 | error[E0433]: cannot find module `clippy` in this scope | |
| 2 | 2 | --> $DIR/tool-import.rs:3:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use clippy::time::Instant; |
tests/ui/resolve/typo-suggestion-mistyped-in-path.rs+4-4| ... | ... | @@ -25,18 +25,18 @@ fn main() { |
| 25 | 25 | //~| NOTE function or associated item not found in `Struct` |
| 26 | 26 | |
| 27 | 27 | Struc::foo(); |
| 28 | //~^ ERROR failed to resolve: use of undeclared type `Struc` | |
| 28 | //~^ ERROR cannot find type `Struc` | |
| 29 | 29 | //~| NOTE use of undeclared type `Struc` |
| 30 | 30 | |
| 31 | 31 | modul::foo(); |
| 32 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `modul` | |
| 32 | //~^ ERROR cannot find module or crate `modul` | |
| 33 | 33 | //~| NOTE use of unresolved module or unlinked crate `modul` |
| 34 | 34 | |
| 35 | 35 | module::Struc::foo(); |
| 36 | //~^ ERROR failed to resolve: could not find `Struc` in `module` | |
| 36 | //~^ ERROR cannot find `Struc` in `module` | |
| 37 | 37 | //~| NOTE could not find `Struc` in `module` |
| 38 | 38 | |
| 39 | 39 | Trai::foo(); |
| 40 | //~^ ERROR failed to resolve: use of undeclared type `Trai` | |
| 40 | //~^ ERROR cannot find type `Trai` | |
| 41 | 41 | //~| NOTE use of undeclared type `Trai` |
| 42 | 42 | } |
tests/ui/resolve/typo-suggestion-mistyped-in-path.stderr+4-4| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `Struc` in `module` | |
| 1 | error[E0433]: cannot find `Struc` in `module` | |
| 2 | 2 | --> $DIR/typo-suggestion-mistyped-in-path.rs:35:13 |
| 3 | 3 | | |
| 4 | 4 | LL | module::Struc::foo(); |
| ... | ... | @@ -24,7 +24,7 @@ LL - Struct::fob(); |
| 24 | 24 | LL + Struct::foo(); |
| 25 | 25 | | |
| 26 | 26 | |
| 27 | error[E0433]: failed to resolve: use of undeclared type `Struc` | |
| 27 | error[E0433]: cannot find type `Struc` in this scope | |
| 28 | 28 | --> $DIR/typo-suggestion-mistyped-in-path.rs:27:5 |
| 29 | 29 | | |
| 30 | 30 | LL | Struc::foo(); |
| ... | ... | @@ -35,7 +35,7 @@ help: a struct with a similar name exists |
| 35 | 35 | LL | Struct::foo(); |
| 36 | 36 | | + |
| 37 | 37 | |
| 38 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `modul` | |
| 38 | error[E0433]: cannot find module or crate `modul` in this scope | |
| 39 | 39 | --> $DIR/typo-suggestion-mistyped-in-path.rs:31:5 |
| 40 | 40 | | |
| 41 | 41 | LL | modul::foo(); |
| ... | ... | @@ -46,7 +46,7 @@ help: there is a crate or module with a similar name |
| 46 | 46 | LL | module::foo(); |
| 47 | 47 | | + |
| 48 | 48 | |
| 49 | error[E0433]: failed to resolve: use of undeclared type `Trai` | |
| 49 | error[E0433]: cannot find type `Trai` in this scope | |
| 50 | 50 | --> $DIR/typo-suggestion-mistyped-in-path.rs:39:5 |
| 51 | 51 | | |
| 52 | 52 | LL | Trai::foo(); |
tests/ui/resolve/unresolved-module-error-33293.rs+1-1| ... | ... | @@ -2,6 +2,6 @@ |
| 2 | 2 | fn main() { |
| 3 | 3 | match 0 { |
| 4 | 4 | aaa::bbb(_) => () |
| 5 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `aaa` | |
| 5 | //~^ ERROR: cannot find module or crate `aaa` | |
| 6 | 6 | }; |
| 7 | 7 | } |
tests/ui/resolve/unresolved-module-error-33293.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `aaa` | |
| 1 | error[E0433]: cannot find module or crate `aaa` in this scope | |
| 2 | 2 | --> $DIR/unresolved-module-error-33293.rs:4:9 |
| 3 | 3 | | |
| 4 | 4 | LL | aaa::bbb(_) => () |
tests/ui/resolve/unresolved-segments-visibility.rs+2-1| ... | ... | @@ -6,6 +6,7 @@ extern crate alloc as b; |
| 6 | 6 | mod foo { |
| 7 | 7 | mod bar { |
| 8 | 8 | pub(in crate::b::string::String::newy) extern crate alloc as e; |
| 9 | //~^ ERROR failed to resolve: `String` is a struct, not a module [E0433] | |
| 9 | //~^ ERROR: cannot find module `String` in `string` [E0433] | |
| 10 | //~| NOTE: `String` is a struct, not a module | |
| 10 | 11 | } |
| 11 | 12 | } |
tests/ui/resolve/unresolved-segments-visibility.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `String` is a struct, not a module | |
| 1 | error[E0433]: cannot find module `String` in `string` | |
| 2 | 2 | --> $DIR/unresolved-segments-visibility.rs:8:34 |
| 3 | 3 | | |
| 4 | 4 | LL | pub(in crate::b::string::String::newy) extern crate alloc as e; |
tests/ui/resolve/use_suggestion.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | fn main() { |
| 2 | let x1 = HashMap::new(); //~ ERROR failed to resolve | |
| 3 | let x2 = GooMap::new(); //~ ERROR failed to resolve | |
| 2 | let x1 = HashMap::new(); //~ ERROR cannot find | |
| 3 | let x2 = GooMap::new(); //~ ERROR cannot find | |
| 4 | 4 | |
| 5 | 5 | let y1: HashMap; //~ ERROR cannot find type |
| 6 | 6 | let y2: GooMap; //~ ERROR cannot find type |
tests/ui/resolve/use_suggestion.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `HashMap` | |
| 1 | error[E0433]: cannot find type `HashMap` in this scope | |
| 2 | 2 | --> $DIR/use_suggestion.rs:2:14 |
| 3 | 3 | | |
| 4 | 4 | LL | let x1 = HashMap::new(); |
| ... | ... | @@ -26,7 +26,7 @@ error[E0425]: cannot find type `GooMap` in this scope |
| 26 | 26 | LL | let y2: GooMap; |
| 27 | 27 | | ^^^^^^ not found in this scope |
| 28 | 28 | |
| 29 | error[E0433]: failed to resolve: use of undeclared type `GooMap` | |
| 29 | error[E0433]: cannot find type `GooMap` in this scope | |
| 30 | 30 | --> $DIR/use_suggestion.rs:3:14 |
| 31 | 31 | | |
| 32 | 32 | LL | let x2 = GooMap::new(); |
tests/ui/resolve/visibility-indeterminate.rs+1-1| ... | ... | @@ -2,6 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | foo!(); //~ ERROR cannot find macro `foo` in this scope |
| 4 | 4 | |
| 5 | pub(in ::bar) struct Baz {} //~ ERROR failed to resolve: could not find `bar` in the list of imported crates | |
| 5 | pub(in ::bar) struct Baz {} //~ ERROR cannot find `bar` | |
| 6 | 6 | |
| 7 | 7 | fn main() {} |
tests/ui/resolve/visibility-indeterminate.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `bar` in the list of imported crates | |
| 1 | error[E0433]: cannot find `bar` in the crate root | |
| 2 | 2 | --> $DIR/visibility-indeterminate.rs:5:10 |
| 3 | 3 | | |
| 4 | 4 | LL | pub(in ::bar) struct Baz {} |
tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.rs+2-2| ... | ... | @@ -3,8 +3,8 @@ struct S; |
| 3 | 3 | |
| 4 | 4 | pub mod m { |
| 5 | 5 | fn f() { |
| 6 | let s = ::m::crate::S; //~ ERROR failed to resolve | |
| 7 | let s1 = ::crate::S; //~ ERROR failed to resolve | |
| 6 | let s = ::m::crate::S; //~ ERROR: `crate` in paths can only be used in start position | |
| 7 | let s1 = ::crate::S; //~ ERROR: global paths cannot start with `crate` | |
| 8 | 8 | let s2 = crate::S; // no error |
| 9 | 9 | } |
| 10 | 10 | } |
tests/ui/rfcs/rfc-2126-crate-paths/crate-path-non-absolute.stderr+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | error[E0433]: failed to resolve: `crate` in paths can only be used in start position | |
| 1 | error[E0433]: `crate` in paths can only be used in start position | |
| 2 | 2 | --> $DIR/crate-path-non-absolute.rs:6:22 |
| 3 | 3 | | |
| 4 | 4 | LL | let s = ::m::crate::S; |
| 5 | | ^^^^^ `crate` in paths can only be used in start position | |
| 5 | | ^^^^^ can only be used in path start position | |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: global paths cannot start with `crate` | |
| 7 | error[E0433]: global paths cannot start with `crate` | |
| 8 | 8 | --> $DIR/crate-path-non-absolute.rs:7:20 |
| 9 | 9 | | |
| 10 | 10 | LL | let s1 = ::crate::S; |
| 11 | | ^^^^^ global paths cannot start with `crate` | |
| 11 | | ^^^^^ cannot start with this | |
| 12 | 12 | |
| 13 | 13 | error: aborting due to 2 previous errors |
| 14 | 14 |
tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.rs+1-1| ... | ... | @@ -2,5 +2,5 @@ |
| 2 | 2 | |
| 3 | 3 | fn main() { |
| 4 | 4 | let s = ::xcrate::S; |
| 5 | //~^ ERROR failed to resolve: could not find `xcrate` in the list of imported crates | |
| 5 | //~^ ERROR cannot find `xcrate` | |
| 6 | 6 | } |
tests/ui/rfcs/rfc-2126-extern-absolute-paths/non-existent-2.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `xcrate` in the list of imported crates | |
| 1 | error[E0433]: cannot find `xcrate` in the crate root | |
| 2 | 2 | --> $DIR/non-existent-2.rs:4:15 |
| 3 | 3 | | |
| 4 | 4 | LL | let s = ::xcrate::S; |
tests/ui/simd/portable-intrinsics-arent-exposed.stderr+8-5| ... | ... | @@ -1,11 +1,14 @@ |
| 1 | error[E0433]: failed to resolve: you might be missing crate `core` | |
| 1 | error[E0433]: cannot find `core` in the crate root | |
| 2 | 2 | --> $DIR/portable-intrinsics-arent-exposed.rs:5:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use core::simd::intrinsics; |
| 5 | | ^^^^ | |
| 6 | | | | |
| 7 | | you might be missing crate `core` | |
| 8 | | help: try using `std` instead of `core`: `std` | |
| 5 | | ^^^^ you might be missing crate `core` | |
| 6 | | | |
| 7 | help: try using `std` instead of `core` | |
| 8 | | | |
| 9 | LL - use core::simd::intrinsics; | |
| 10 | LL + use std::simd::intrinsics; | |
| 11 | | | |
| 9 | 12 | |
| 10 | 13 | error[E0432]: unresolved import `std::simd::intrinsics` |
| 11 | 14 | --> $DIR/portable-intrinsics-arent-exposed.rs:6:5 |
tests/ui/span/visibility-ty-params.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ macro_rules! m { |
| 4 | 4 | |
| 5 | 5 | struct S<T>(T); |
| 6 | 6 | m!{ crate::S<u8> } //~ ERROR unexpected generic arguments in path |
| 7 | //~| ERROR failed to resolve: `S` is a struct, not a module [E0433] | |
| 7 | //~| ERROR cannot find | |
| 8 | 8 | |
| 9 | 9 | mod m { |
| 10 | 10 | m!{ crate::m<> } //~ ERROR unexpected generic arguments in path |
tests/ui/span/visibility-ty-params.stderr+1-1| ... | ... | @@ -4,7 +4,7 @@ error: unexpected generic arguments in path |
| 4 | 4 | LL | m!{ crate::S<u8> } |
| 5 | 5 | | ^^^^ |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: `S` is a struct, not a module | |
| 7 | error[E0433]: cannot find module `S` in `crate` | |
| 8 | 8 | --> $DIR/visibility-ty-params.rs:6:12 |
| 9 | 9 | | |
| 10 | 10 | LL | m!{ crate::S<u8> } |
tests/ui/suggestions/core-std-import-order-issue-83564.no_std.fixed+1-1| ... | ... | @@ -12,7 +12,7 @@ use core::num::NonZero; |
| 12 | 12 | fn main() { |
| 13 | 13 | //~^ HELP consider importing this struct |
| 14 | 14 | let _x = NonZero::new(5u32).unwrap(); |
| 15 | //~^ ERROR failed to resolve: use of undeclared type `NonZero` | |
| 15 | //~^ ERROR cannot find type `NonZero` | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | #[allow(dead_code)] |
tests/ui/suggestions/core-std-import-order-issue-83564.no_std.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `NonZero` | |
| 1 | error[E0433]: cannot find type `NonZero` in this scope | |
| 2 | 2 | --> $DIR/core-std-import-order-issue-83564.rs:12:14 |
| 3 | 3 | | |
| 4 | 4 | LL | let _x = NonZero::new(5u32).unwrap(); |
tests/ui/suggestions/core-std-import-order-issue-83564.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | fn main() { |
| 11 | 11 | //~^ HELP consider importing this struct |
| 12 | 12 | let _x = NonZero::new(5u32).unwrap(); |
| 13 | //~^ ERROR failed to resolve: use of undeclared type `NonZero` | |
| 13 | //~^ ERROR cannot find type `NonZero` | |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | #[allow(dead_code)] |
tests/ui/suggestions/core-std-import-order-issue-83564.std.fixed+1-1| ... | ... | @@ -12,7 +12,7 @@ use std::num::NonZero; |
| 12 | 12 | fn main() { |
| 13 | 13 | //~^ HELP consider importing this struct |
| 14 | 14 | let _x = NonZero::new(5u32).unwrap(); |
| 15 | //~^ ERROR failed to resolve: use of undeclared type `NonZero` | |
| 15 | //~^ ERROR cannot find type `NonZero` | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | #[allow(dead_code)] |
tests/ui/suggestions/core-std-import-order-issue-83564.std.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `NonZero` | |
| 1 | error[E0433]: cannot find type `NonZero` in this scope | |
| 2 | 2 | --> $DIR/core-std-import-order-issue-83564.rs:12:14 |
| 3 | 3 | | |
| 4 | 4 | LL | let _x = NonZero::new(5u32).unwrap(); |
tests/ui/suggestions/crate-or-module-typo.rs+3-3| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | //@ edition:2018 |
| 2 | 2 | |
| 3 | use st::cell::Cell; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `st` | |
| 3 | use st::cell::Cell; //~ ERROR cannot find module or crate `st` | |
| 4 | 4 | |
| 5 | 5 | mod bar { |
| 6 | pub fn bar() { bar::baz(); } //~ ERROR failed to resolve: function `bar` is not a crate or module | |
| 6 | pub fn bar() { bar::baz(); } //~ ERROR cannot find module or crate `bar` | |
| 7 | 7 | |
| 8 | 8 | fn baz() {} |
| 9 | 9 | } |
| ... | ... | @@ -11,7 +11,7 @@ mod bar { |
| 11 | 11 | use bas::bar; //~ ERROR unresolved import `bas` |
| 12 | 12 | |
| 13 | 13 | struct Foo { |
| 14 | bar: st::cell::Cell<bool> //~ ERROR failed to resolve: use of unresolved module or unlinked crate `st` | |
| 14 | bar: st::cell::Cell<bool> //~ ERROR cannot find module or crate `st` | |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | fn main() {} |
tests/ui/suggestions/crate-or-module-typo.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `st` | |
| 1 | error[E0433]: cannot find module or crate `st` in this scope | |
| 2 | 2 | --> $DIR/crate-or-module-typo.rs:3:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use st::cell::Cell; |
| ... | ... | @@ -21,7 +21,7 @@ LL - use bas::bar; |
| 21 | 21 | LL + use bar::bar; |
| 22 | 22 | | |
| 23 | 23 | |
| 24 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `st` | |
| 24 | error[E0433]: cannot find module or crate `st` in this scope | |
| 25 | 25 | --> $DIR/crate-or-module-typo.rs:14:10 |
| 26 | 26 | | |
| 27 | 27 | LL | bar: st::cell::Cell<bool> |
| ... | ... | @@ -41,7 +41,7 @@ LL - bar: st::cell::Cell<bool> |
| 41 | 41 | LL + bar: cell::Cell<bool> |
| 42 | 42 | | |
| 43 | 43 | |
| 44 | error[E0433]: failed to resolve: function `bar` is not a crate or module | |
| 44 | error[E0433]: cannot find module or crate `bar` in this scope | |
| 45 | 45 | --> $DIR/crate-or-module-typo.rs:6:20 |
| 46 | 46 | | |
| 47 | 47 | LL | pub fn bar() { bar::baz(); } |
tests/ui/suggestions/issue-103112.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | 1 | fn main() { |
| 2 | 2 | std::process::abort!(); |
| 3 | //~^ ERROR: failed to resolve | |
| 3 | //~^ ERROR: cannot find | |
| 4 | 4 | } |
tests/ui/suggestions/issue-103112.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `abort` in `process` | |
| 1 | error[E0433]: cannot find `abort` in `process` | |
| 2 | 2 | --> $DIR/issue-103112.rs:2:19 |
| 3 | 3 | | |
| 4 | 4 | LL | std::process::abort!(); |
tests/ui/suggestions/issue-112590-suggest-import.rs+4-3| ... | ... | @@ -1,8 +1,9 @@ |
| 1 | 1 | pub struct S; |
| 2 | 2 | |
| 3 | impl fmt::Debug for S { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt` | |
| 4 | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { //~ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt` | |
| 5 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `fmt` | |
| 3 | impl fmt::Debug for S { //~ ERROR: cannot find module or crate `fmt` | |
| 4 | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { | |
| 5 | //~^ ERROR: cannot find module or crate `fmt` | |
| 6 | //~| ERROR: cannot find module or crate `fmt` | |
| 6 | 7 | Ok(()) |
| 7 | 8 | } |
| 8 | 9 | } |
tests/ui/suggestions/issue-112590-suggest-import.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt` | |
| 1 | error[E0433]: cannot find module or crate `fmt` in this scope | |
| 2 | 2 | --> $DIR/issue-112590-suggest-import.rs:3:6 |
| 3 | 3 | | |
| 4 | 4 | LL | impl fmt::Debug for S { |
| ... | ... | @@ -10,7 +10,7 @@ help: consider importing this module |
| 10 | 10 | LL + use std::fmt; |
| 11 | 11 | | |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt` | |
| 13 | error[E0433]: cannot find module or crate `fmt` in this scope | |
| 14 | 14 | --> $DIR/issue-112590-suggest-import.rs:4:28 |
| 15 | 15 | | |
| 16 | 16 | LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| ... | ... | @@ -22,7 +22,7 @@ help: consider importing this module |
| 22 | 22 | LL + use std::fmt; |
| 23 | 23 | | |
| 24 | 24 | |
| 25 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `fmt` | |
| 25 | error[E0433]: cannot find module or crate `fmt` in this scope | |
| 26 | 26 | --> $DIR/issue-112590-suggest-import.rs:4:51 |
| 27 | 27 | | |
| 28 | 28 | LL | fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result { |
tests/ui/suggestions/suggest-tryinto-edition-change.rs+3-3| ... | ... | @@ -8,17 +8,17 @@ fn test() { |
| 8 | 8 | //~| NOTE 'std::convert::TryInto' is included in the prelude starting in Edition 2021 |
| 9 | 9 | |
| 10 | 10 | let _i: i16 = TryFrom::try_from(0_i32).unwrap(); |
| 11 | //~^ ERROR failed to resolve: use of undeclared type | |
| 11 | //~^ ERROR cannot find | |
| 12 | 12 | //~| NOTE use of undeclared type |
| 13 | 13 | //~| NOTE 'std::convert::TryFrom' is included in the prelude starting in Edition 2021 |
| 14 | 14 | |
| 15 | 15 | let _i: i16 = TryInto::try_into(0_i32).unwrap(); |
| 16 | //~^ ERROR failed to resolve: use of undeclared type | |
| 16 | //~^ ERROR cannot find | |
| 17 | 17 | //~| NOTE use of undeclared type |
| 18 | 18 | //~| NOTE 'std::convert::TryInto' is included in the prelude starting in Edition 2021 |
| 19 | 19 | |
| 20 | 20 | let _v: Vec<_> = FromIterator::from_iter(&[1]); |
| 21 | //~^ ERROR failed to resolve: use of undeclared type | |
| 21 | //~^ ERROR cannot find | |
| 22 | 22 | //~| NOTE use of undeclared type |
| 23 | 23 | //~| NOTE 'std::iter::FromIterator' is included in the prelude starting in Edition 2021 |
| 24 | 24 | } |
tests/ui/suggestions/suggest-tryinto-edition-change.stderr+3-3| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of undeclared type `TryFrom` | |
| 1 | error[E0433]: cannot find type `TryFrom` in this scope | |
| 2 | 2 | --> $DIR/suggest-tryinto-edition-change.rs:10:19 |
| 3 | 3 | | |
| 4 | 4 | LL | let _i: i16 = TryFrom::try_from(0_i32).unwrap(); |
| ... | ... | @@ -10,7 +10,7 @@ help: consider importing this trait |
| 10 | 10 | LL + use std::convert::TryFrom; |
| 11 | 11 | | |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: use of undeclared type `TryInto` | |
| 13 | error[E0433]: cannot find type `TryInto` in this scope | |
| 14 | 14 | --> $DIR/suggest-tryinto-edition-change.rs:15:19 |
| 15 | 15 | | |
| 16 | 16 | LL | let _i: i16 = TryInto::try_into(0_i32).unwrap(); |
| ... | ... | @@ -22,7 +22,7 @@ help: consider importing this trait |
| 22 | 22 | LL + use std::convert::TryInto; |
| 23 | 23 | | |
| 24 | 24 | |
| 25 | error[E0433]: failed to resolve: use of undeclared type `FromIterator` | |
| 25 | error[E0433]: cannot find type `FromIterator` in this scope | |
| 26 | 26 | --> $DIR/suggest-tryinto-edition-change.rs:20:22 |
| 27 | 27 | | |
| 28 | 28 | LL | let _v: Vec<_> = FromIterator::from_iter(&[1]); |
tests/ui/suggestions/undeclared-module-alloc.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | //@ edition:2018 |
| 2 | 2 | |
| 3 | use alloc::rc::Rc; //~ ERROR failed to resolve: use of unresolved module or unlinked crate `alloc` | |
| 3 | use alloc::rc::Rc; //~ ERROR cannot find module or crate `alloc` | |
| 4 | 4 | |
| 5 | 5 | fn main() {} |
tests/ui/suggestions/undeclared-module-alloc.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `alloc` | |
| 1 | error[E0433]: cannot find module or crate `alloc` in this scope | |
| 2 | 2 | --> $DIR/undeclared-module-alloc.rs:3:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use alloc::rc::Rc; |
tests/ui/test-attrs/issue-109816.rs+1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | //@ compile-flags: --test |
| 2 | //@ reference: attributes.testing.test.allowed-positions | |
| 2 | 3 | |
| 3 | 4 | fn align_offset_weird_strides() { |
| 4 | 5 | #[test] |
tests/ui/test-attrs/issue-109816.stderr+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error: the `#[test]` attribute may only be used on a free function |
| 2 | --> $DIR/issue-109816.rs:4:5 | |
| 2 | --> $DIR/issue-109816.rs:5:5 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[test] |
| 5 | 5 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
tests/ui/test-attrs/test-attr-non-associated-functions.rs+1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | //@ compile-flags:--test |
| 2 | //@ reference: attributes.testing.test.allowed-positions | |
| 2 | 3 | |
| 3 | 4 | struct A {} |
| 4 | 5 |
tests/ui/test-attrs/test-attr-non-associated-functions.stderr+2-2| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error: the `#[test]` attribute may only be used on a free function |
| 2 | --> $DIR/test-attr-non-associated-functions.rs:6:5 | |
| 2 | --> $DIR/test-attr-non-associated-functions.rs:7:5 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[test] |
| 5 | 5 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -11,7 +11,7 @@ LL + #[cfg(test)] |
| 11 | 11 | | |
| 12 | 12 | |
| 13 | 13 | error: the `#[test]` attribute may only be used on a free function |
| 14 | --> $DIR/test-attr-non-associated-functions.rs:11:5 | |
| 14 | --> $DIR/test-attr-non-associated-functions.rs:12:5 | |
| 15 | 15 | | |
| 16 | 16 | LL | #[test] |
| 17 | 17 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
tests/ui/test-attrs/test-function-signature.rs+1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | //@ compile-flags: --test |
| 2 | //@ reference: attributes.testing.test.allowed-positions | |
| 2 | 3 | |
| 3 | 4 | #[test] |
| 4 | 5 | fn foo() -> Result<(), ()> { |
tests/ui/test-attrs/test-function-signature.stderr+5-5| ... | ... | @@ -1,29 +1,29 @@ |
| 1 | 1 | error: functions used as tests can not have any arguments |
| 2 | --> $DIR/test-function-signature.rs:14:1 | |
| 2 | --> $DIR/test-function-signature.rs:15:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | fn baz(val: i32) {} |
| 5 | 5 | | ^^^^^^^^^^^^^^^^^^^ |
| 6 | 6 | |
| 7 | 7 | error: functions used as tests can not have any non-lifetime generic parameters |
| 8 | --> $DIR/test-function-signature.rs:22:1 | |
| 8 | --> $DIR/test-function-signature.rs:23:1 | |
| 9 | 9 | | |
| 10 | 10 | LL | fn type_generic<T>() {} |
| 11 | 11 | | ^^^^^^^^^^^^^^^^^^^^^^^ |
| 12 | 12 | |
| 13 | 13 | error: functions used as tests can not have any non-lifetime generic parameters |
| 14 | --> $DIR/test-function-signature.rs:25:1 | |
| 14 | --> $DIR/test-function-signature.rs:26:1 | |
| 15 | 15 | | |
| 16 | 16 | LL | fn const_generic<const N: usize>() {} |
| 17 | 17 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 18 | 18 | |
| 19 | 19 | error: functions used as tests can not have any arguments |
| 20 | --> $DIR/test-function-signature.rs:30:5 | |
| 20 | --> $DIR/test-function-signature.rs:31:5 | |
| 21 | 21 | | |
| 22 | 22 | LL | fn foo(arg: ()) {} |
| 23 | 23 | | ^^^^^^^^^^^^^^^^^^ |
| 24 | 24 | |
| 25 | 25 | error[E0277]: the trait bound `i32: Termination` is not satisfied |
| 26 | --> $DIR/test-function-signature.rs:9:13 | |
| 26 | --> $DIR/test-function-signature.rs:10:13 | |
| 27 | 27 | | |
| 28 | 28 | LL | #[test] |
| 29 | 29 | | ------- in this attribute macro expansion |
tests/ui/test-attrs/test-on-not-fn.rs+1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | //@ compile-flags: --test |
| 2 | //@ reference: attributes.testing.test.allowed-positions | |
| 2 | 3 | |
| 3 | 4 | #[test] //~ ERROR: the `#[test]` attribute may only be used on a free function |
| 4 | 5 | mod test {} |
tests/ui/test-attrs/test-on-not-fn.stderr+12-12| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error: the `#[test]` attribute may only be used on a free function |
| 2 | --> $DIR/test-on-not-fn.rs:3:1 | |
| 2 | --> $DIR/test-on-not-fn.rs:4:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[test] |
| 5 | 5 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -13,7 +13,7 @@ LL + #[cfg(test)] |
| 13 | 13 | | |
| 14 | 14 | |
| 15 | 15 | error: the `#[test]` attribute may only be used on a free function |
| 16 | --> $DIR/test-on-not-fn.rs:6:1 | |
| 16 | --> $DIR/test-on-not-fn.rs:7:1 | |
| 17 | 17 | | |
| 18 | 18 | LL | #[test] |
| 19 | 19 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -33,7 +33,7 @@ LL + #[cfg(test)] |
| 33 | 33 | | |
| 34 | 34 | |
| 35 | 35 | error: the `#[test]` attribute may only be used on a free function |
| 36 | --> $DIR/test-on-not-fn.rs:20:1 | |
| 36 | --> $DIR/test-on-not-fn.rs:21:1 | |
| 37 | 37 | | |
| 38 | 38 | LL | #[test] |
| 39 | 39 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -47,7 +47,7 @@ LL + #[cfg(test)] |
| 47 | 47 | | |
| 48 | 48 | |
| 49 | 49 | error: the `#[test]` attribute may only be used on a free function |
| 50 | --> $DIR/test-on-not-fn.rs:23:1 | |
| 50 | --> $DIR/test-on-not-fn.rs:24:1 | |
| 51 | 51 | | |
| 52 | 52 | LL | #[test] |
| 53 | 53 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -61,7 +61,7 @@ LL + #[cfg(test)] |
| 61 | 61 | | |
| 62 | 62 | |
| 63 | 63 | error: the `#[test]` attribute may only be used on a free function |
| 64 | --> $DIR/test-on-not-fn.rs:26:1 | |
| 64 | --> $DIR/test-on-not-fn.rs:27:1 | |
| 65 | 65 | | |
| 66 | 66 | LL | #[test] |
| 67 | 67 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -75,7 +75,7 @@ LL + #[cfg(test)] |
| 75 | 75 | | |
| 76 | 76 | |
| 77 | 77 | error: the `#[test]` attribute may only be used on a free function |
| 78 | --> $DIR/test-on-not-fn.rs:29:1 | |
| 78 | --> $DIR/test-on-not-fn.rs:30:1 | |
| 79 | 79 | | |
| 80 | 80 | LL | #[test] |
| 81 | 81 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -89,7 +89,7 @@ LL + #[cfg(test)] |
| 89 | 89 | | |
| 90 | 90 | |
| 91 | 91 | error: the `#[test]` attribute may only be used on a free function |
| 92 | --> $DIR/test-on-not-fn.rs:32:1 | |
| 92 | --> $DIR/test-on-not-fn.rs:33:1 | |
| 93 | 93 | | |
| 94 | 94 | LL | #[test] |
| 95 | 95 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -103,7 +103,7 @@ LL + #[cfg(test)] |
| 103 | 103 | | |
| 104 | 104 | |
| 105 | 105 | error: the `#[test]` attribute may only be used on a free function |
| 106 | --> $DIR/test-on-not-fn.rs:35:1 | |
| 106 | --> $DIR/test-on-not-fn.rs:36:1 | |
| 107 | 107 | | |
| 108 | 108 | LL | #[test] |
| 109 | 109 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -119,7 +119,7 @@ LL + #[cfg(test)] |
| 119 | 119 | | |
| 120 | 120 | |
| 121 | 121 | error: the `#[test]` attribute may only be used on a free function |
| 122 | --> $DIR/test-on-not-fn.rs:40:1 | |
| 122 | --> $DIR/test-on-not-fn.rs:41:1 | |
| 123 | 123 | | |
| 124 | 124 | LL | #[test] |
| 125 | 125 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -133,7 +133,7 @@ LL + #[cfg(test)] |
| 133 | 133 | | |
| 134 | 134 | |
| 135 | 135 | error: the `#[test]` attribute may only be used on a free function |
| 136 | --> $DIR/test-on-not-fn.rs:43:1 | |
| 136 | --> $DIR/test-on-not-fn.rs:44:1 | |
| 137 | 137 | | |
| 138 | 138 | LL | #[test] |
| 139 | 139 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -150,7 +150,7 @@ LL + #[cfg(test)] |
| 150 | 150 | | |
| 151 | 151 | |
| 152 | 152 | error: the `#[test]` attribute may only be used on a free function |
| 153 | --> $DIR/test-on-not-fn.rs:50:1 | |
| 153 | --> $DIR/test-on-not-fn.rs:51:1 | |
| 154 | 154 | | |
| 155 | 155 | LL | #[test] |
| 156 | 156 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| ... | ... | @@ -168,7 +168,7 @@ LL + #[cfg(test)] |
| 168 | 168 | | |
| 169 | 169 | |
| 170 | 170 | warning: the `#[test]` attribute may only be used on a free function |
| 171 | --> $DIR/test-on-not-fn.rs:61:1 | |
| 171 | --> $DIR/test-on-not-fn.rs:62:1 | |
| 172 | 172 | | |
| 173 | 173 | LL | #[test] |
| 174 | 174 | | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
tests/ui/test-attrs/test-passed.rs+1| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | //@ run-pass |
| 5 | 5 | //@ check-run-results |
| 6 | 6 | //@ normalize-stdout: "finished in \d+\.\d+s" -> "finished in $$TIME" |
| 7 | //@ reference: attributes.testing.test.success | |
| 7 | 8 | |
| 8 | 9 | // Tests the output of the test harness with only passed tests. |
| 9 | 10 |
tests/ui/test-attrs/test-should-panic-attr.rs+1| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | //@ compile-flags: --test |
| 2 | //@ reference: attributes.testing.should_panic.syntax | |
| 2 | 3 | |
| 3 | 4 | #[test] |
| 4 | 5 | #[should_panic = "foo"] |
tests/ui/test-attrs/test-should-panic-attr.stderr+4-4| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | error[E0539]: malformed `should_panic` attribute input |
| 2 | --> $DIR/test-should-panic-attr.rs:10:1 | |
| 2 | --> $DIR/test-should-panic-attr.rs:11:1 | |
| 3 | 3 | | |
| 4 | 4 | LL | #[should_panic(expected)] |
| 5 | 5 | | ^^^^^^^^^^^^^^^--------^^ |
| ... | ... | @@ -19,7 +19,7 @@ LL + #[should_panic] |
| 19 | 19 | | |
| 20 | 20 | |
| 21 | 21 | error[E0539]: malformed `should_panic` attribute input |
| 22 | --> $DIR/test-should-panic-attr.rs:19:1 | |
| 22 | --> $DIR/test-should-panic-attr.rs:20:1 | |
| 23 | 23 | | |
| 24 | 24 | LL | #[should_panic(expect)] |
| 25 | 25 | | ^^^^^^^^^^^^^^--------^ |
| ... | ... | @@ -39,7 +39,7 @@ LL + #[should_panic] |
| 39 | 39 | | |
| 40 | 40 | |
| 41 | 41 | error[E0539]: malformed `should_panic` attribute input |
| 42 | --> $DIR/test-should-panic-attr.rs:28:1 | |
| 42 | --> $DIR/test-should-panic-attr.rs:29:1 | |
| 43 | 43 | | |
| 44 | 44 | LL | #[should_panic(expected(foo, bar))] |
| 45 | 45 | | ^^^^^^^^^^^^^^^------------------^^ |
| ... | ... | @@ -60,7 +60,7 @@ LL + #[should_panic] |
| 60 | 60 | | |
| 61 | 61 | |
| 62 | 62 | error[E0805]: malformed `should_panic` attribute input |
| 63 | --> $DIR/test-should-panic-attr.rs:37:1 | |
| 63 | --> $DIR/test-should-panic-attr.rs:38:1 | |
| 64 | 64 | | |
| 65 | 65 | LL | #[should_panic(expected = "foo", bar)] |
| 66 | 66 | | ^^^^^^^^^^^^^^-----------------------^ |
tests/ui/test-attrs/test-should-panic-failed-show-span.rs+1| ... | ... | @@ -8,6 +8,7 @@ |
| 8 | 8 | //@ normalize-stdout: "TypeId\(0x[0-9a-f]+\)" -> "TypeId($$HEX)" |
| 9 | 9 | //@ needs-threads |
| 10 | 10 | //@ needs-unwind (panic) |
| 11 | //@ reference: attributes.testing.should_panic.expected | |
| 11 | 12 | |
| 12 | 13 | #[test] |
| 13 | 14 | #[should_panic] |
tests/ui/test-attrs/test-should-panic-failed-show-span.run.stderr+4-4| ... | ... | @@ -1,13 +1,13 @@ |
| 1 | 1 | |
| 2 | thread 'should_panic_with_any_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:15:5: | |
| 2 | thread 'should_panic_with_any_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:16:5: | |
| 3 | 3 | Panic! |
| 4 | 4 | note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace |
| 5 | 5 | |
| 6 | thread 'should_panic_with_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:21:5: | |
| 6 | thread 'should_panic_with_message' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:22:5: | |
| 7 | 7 | message |
| 8 | 8 | |
| 9 | thread 'should_panic_with_substring_panics_with_incorrect_string' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:39:5: | |
| 9 | thread 'should_panic_with_substring_panics_with_incorrect_string' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:40:5: | |
| 10 | 10 | ZOMGWTFBBQ |
| 11 | 11 | |
| 12 | thread 'should_panic_with_substring_panics_with_non_string_value' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:46:5: | |
| 12 | thread 'should_panic_with_substring_panics_with_non_string_value' ($TID) panicked at $DIR/test-should-panic-failed-show-span.rs:47:5: | |
| 13 | 13 | Box<dyn Any> |
tests/ui/test-attrs/test-should-panic-failed-show-span.run.stdout+2-2| ... | ... | @@ -10,9 +10,9 @@ test should_panic_with_substring_panics_with_non_string_value - should panic ... |
| 10 | 10 | failures: |
| 11 | 11 | |
| 12 | 12 | ---- should_panic_with_any_message_does_not_panic stdout ---- |
| 13 | note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:26:4 | |
| 13 | note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:27:4 | |
| 14 | 14 | ---- should_panic_with_message_does_not_panic stdout ---- |
| 15 | note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:32:4 | |
| 15 | note: test did not panic as expected at $DIR/test-should-panic-failed-show-span.rs:33:4 | |
| 16 | 16 | ---- should_panic_with_substring_panics_with_incorrect_string stdout ---- |
| 17 | 17 | note: panic did not contain expected string |
| 18 | 18 | panic message: "ZOMGWTFBBQ" |
tests/ui/test-attrs/test-vs-cfg-test.rs+1| ... | ... | @@ -1,5 +1,6 @@ |
| 1 | 1 | //@ run-pass |
| 2 | 2 | //@ compile-flags: --cfg test |
| 3 | //@ reference: cfg.test | |
| 3 | 4 | |
| 4 | 5 | // Make sure `--cfg test` does not inject test harness |
| 5 | 6 |
tests/ui/tool-attributes/tool-attributes-shadowing.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | 1 | mod rustfmt {} |
| 2 | 2 | |
| 3 | #[rustfmt::skip] //~ ERROR failed to resolve: could not find `skip` in `rustfmt` | |
| 3 | #[rustfmt::skip] //~ ERROR: cannot find `skip` in `rustfmt` | |
| 4 | 4 | fn main() {} |
tests/ui/tool-attributes/tool-attributes-shadowing.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: could not find `skip` in `rustfmt` | |
| 1 | error[E0433]: cannot find `skip` in `rustfmt` | |
| 2 | 2 | --> $DIR/tool-attributes-shadowing.rs:3:12 |
| 3 | 3 | | |
| 4 | 4 | LL | #[rustfmt::skip] |
tests/ui/tool-attributes/unknown-tool-name.rs+2-1| ... | ... | @@ -1,2 +1,3 @@ |
| 1 | #[foo::bar] //~ ERROR failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 1 | #[foo::bar] //~ ERROR: cannot find module or crate `foo` | |
| 2 | //~^ NOTE: use of unresolved module or unlinked crate `foo` | |
| 2 | 3 | fn main() {} |
tests/ui/tool-attributes/unknown-tool-name.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `foo` | |
| 1 | error[E0433]: cannot find module or crate `foo` in this scope | |
| 2 | 2 | --> $DIR/unknown-tool-name.rs:1:3 |
| 3 | 3 | | |
| 4 | 4 | LL | #[foo::bar] |
tests/ui/traits/bound/unknown-assoc-with-const-arg.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ trait X { |
| 7 | 7 | |
| 8 | 8 | trait Y { |
| 9 | 9 | fn a() -> NOT_EXIST::unknown<{}> {} |
| 10 | //~^ ERROR: failed to resolve: use of undeclared type `NOT_EXIST` | |
| 10 | //~^ ERROR: cannot find type `NOT_EXIST` | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | trait Z<T> { |
tests/ui/traits/bound/unknown-assoc-with-const-arg.stderr+1-1| ... | ... | @@ -10,7 +10,7 @@ error[E0220]: associated type `unknown` not found for `T` |
| 10 | 10 | LL | fn a() -> T::unknown<{}> {} |
| 11 | 11 | | ^^^^^^^ associated type `unknown` not found |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: use of undeclared type `NOT_EXIST` | |
| 13 | error[E0433]: cannot find type `NOT_EXIST` in this scope | |
| 14 | 14 | --> $DIR/unknown-assoc-with-const-arg.rs:9:15 |
| 15 | 15 | | |
| 16 | 16 | LL | fn a() -> NOT_EXIST::unknown<{}> {} |
tests/ui/traits/const-traits/issue-102156.stderr+15-10| ... | ... | @@ -1,22 +1,27 @@ |
| 1 | error[E0433]: failed to resolve: you might be missing crate `core` | |
| 1 | error[E0433]: cannot find `core` in the crate root | |
| 2 | 2 | --> $DIR/issue-102156.rs:5:5 |
| 3 | 3 | | |
| 4 | 4 | LL | use core::convert::{From, TryFrom}; |
| 5 | | ^^^^ | |
| 6 | | | | |
| 7 | | you might be missing crate `core` | |
| 8 | | help: try using `std` instead of `core`: `std` | |
| 5 | | ^^^^ you might be missing crate `core` | |
| 6 | | | |
| 7 | help: try using `std` instead of `core` | |
| 8 | | | |
| 9 | LL - use core::convert::{From, TryFrom}; | |
| 10 | LL + use std::convert::{From, TryFrom}; | |
| 11 | | | |
| 9 | 12 | |
| 10 | error[E0433]: failed to resolve: you might be missing crate `core` | |
| 13 | error[E0433]: cannot find `core` in the crate root | |
| 11 | 14 | --> $DIR/issue-102156.rs:5:5 |
| 12 | 15 | | |
| 13 | 16 | LL | use core::convert::{From, TryFrom}; |
| 14 | | ^^^^ | |
| 15 | | | | |
| 16 | | you might be missing crate `core` | |
| 17 | | help: try using `std` instead of `core`: `std` | |
| 17 | | ^^^^ you might be missing crate `core` | |
| 18 | 18 | | |
| 19 | 19 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 20 | help: try using `std` instead of `core` | |
| 21 | | | |
| 22 | LL - use core::convert::{From, TryFrom}; | |
| 23 | LL + use std::convert::{From, TryFrom}; | |
| 24 | | | |
| 20 | 25 | |
| 21 | 26 | error: aborting due to 2 previous errors |
| 22 | 27 |
tests/ui/traits/const-traits/staged-api.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![feature(local_feature)] |
| 6 | 6 | #![feature(const_trait_impl)] |
| 7 | 7 | #![feature(staged_api)] |
| 8 | #![feature(rustc_allow_const_fn_unstable)] | |
| 8 | #![feature(rustc_attrs)] | |
| 9 | 9 | #![stable(feature = "rust1", since = "1.0.0")] |
| 10 | 10 | |
| 11 | 11 | //@ aux-build: staged-api.rs |
tests/ui/traits/final/final-kw.gated.stderr+1-1| ... | ... | @@ -4,7 +4,7 @@ error[E0658]: `final` on trait functions is experimental |
| 4 | 4 | LL | final fn foo() {} |
| 5 | 5 | | ^^^^^ |
| 6 | 6 | | |
| 7 | = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | |
| 7 | = note: see issue #131179 <https://github.com/rust-lang/rust/issues/131179> for more information | |
| 8 | 8 | = help: add `#![feature(final_associated_functions)]` to the crate attributes to enable |
| 9 | 9 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 10 | 10 |
tests/ui/traits/final/final-kw.ungated.stderr+1-1| ... | ... | @@ -4,7 +4,7 @@ error[E0658]: `final` on trait functions is experimental |
| 4 | 4 | LL | final fn foo() {} |
| 5 | 5 | | ^^^^^ |
| 6 | 6 | | |
| 7 | = note: see issue #1 <https://github.com/rust-lang/rust/issues/1> for more information | |
| 7 | = note: see issue #131179 <https://github.com/rust-lang/rust/issues/131179> for more information | |
| 8 | 8 | = help: add `#![feature(final_associated_functions)]` to the crate attributes to enable |
| 9 | 9 | = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 10 | 10 |
tests/ui/type-alias/issue-62263-self-in-atb.rs+1-1| ... | ... | @@ -3,6 +3,6 @@ pub trait Trait { |
| 3 | 3 | } |
| 4 | 4 | |
| 5 | 5 | pub type Alias = dyn Trait<A = Self::A>; |
| 6 | //~^ ERROR failed to resolve: `Self` | |
| 6 | //~^ ERROR cannot find `Self` | |
| 7 | 7 | |
| 8 | 8 | fn main() {} |
tests/ui/type-alias/issue-62263-self-in-atb.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 1 | error[E0433]: cannot find `Self` in this scope | |
| 2 | 2 | --> $DIR/issue-62263-self-in-atb.rs:5:32 |
| 3 | 3 | | |
| 4 | 4 | LL | pub type Alias = dyn Trait<A = Self::A>; |
tests/ui/type-alias/issue-62305-self-assoc-ty.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | 1 | type Alias = Self::Target; |
| 2 | //~^ ERROR failed to resolve: `Self` | |
| 2 | //~^ ERROR cannot find `Self` | |
| 3 | 3 | |
| 4 | 4 | fn main() {} |
tests/ui/type-alias/issue-62305-self-assoc-ty.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `Self` is only available in impls, traits, and type definitions | |
| 1 | error[E0433]: cannot find `Self` in this scope | |
| 2 | 2 | --> $DIR/issue-62305-self-assoc-ty.rs:1:14 |
| 3 | 3 | | |
| 4 | 4 | LL | type Alias = Self::Target; |
tests/ui/type/type-path-err-node-types.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ fn ufcs_trait() { |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | fn ufcs_item() { |
| 15 | NonExistent::Assoc::<u8>; //~ ERROR undeclared type `NonExistent` | |
| 15 | NonExistent::Assoc::<u8>; //~ ERROR cannot find type `NonExistent` | |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | fn method() { |
tests/ui/type/type-path-err-node-types.stderr+1-1| ... | ... | @@ -16,7 +16,7 @@ error[E0425]: cannot find value `nonexistent` in this scope |
| 16 | 16 | LL | nonexistent.nonexistent::<u8>(); |
| 17 | 17 | | ^^^^^^^^^^^ not found in this scope |
| 18 | 18 | |
| 19 | error[E0433]: failed to resolve: use of undeclared type `NonExistent` | |
| 19 | error[E0433]: cannot find type `NonExistent` in this scope | |
| 20 | 20 | --> $DIR/type-path-err-node-types.rs:15:5 |
| 21 | 21 | | |
| 22 | 22 | LL | NonExistent::Assoc::<u8>; |
tests/ui/typeck/issue-120856.rs+4-2| ... | ... | @@ -1,5 +1,7 @@ |
| 1 | 1 | pub type Archived<T> = <m::Alias as n::Trait>::Archived; |
| 2 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `m` | |
| 3 | //~| ERROR failed to resolve: use of unresolved module or unlinked crate `n` | |
| 2 | //~^ ERROR: cannot find module or crate `m` in this scope | |
| 3 | //~| ERROR: cannot find module or crate `n` in this scope | |
| 4 | //~| NOTE: use of unresolved module or unlinked crate `m` | |
| 5 | //~| NOTE: use of unresolved module or unlinked crate `n` | |
| 4 | 6 | |
| 5 | 7 | fn main() {} |
tests/ui/typeck/issue-120856.stderr+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `n` | |
| 1 | error[E0433]: cannot find module or crate `n` in this scope | |
| 2 | 2 | --> $DIR/issue-120856.rs:1:37 |
| 3 | 3 | | |
| 4 | 4 | LL | pub type Archived<T> = <m::Alias as n::Trait>::Archived; |
| ... | ... | @@ -10,7 +10,7 @@ help: a trait with a similar name exists |
| 10 | 10 | LL | pub type Archived<T> = <m::Alias as Fn::Trait>::Archived; |
| 11 | 11 | | + |
| 12 | 12 | |
| 13 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `m` | |
| 13 | error[E0433]: cannot find module or crate `m` in this scope | |
| 14 | 14 | --> $DIR/issue-120856.rs:1:25 |
| 15 | 15 | | |
| 16 | 16 | LL | pub type Archived<T> = <m::Alias as n::Trait>::Archived; |
tests/ui/typeck/path-to-method-sugg-unresolved-expr.cargo-invoked.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `page_size` | |
| 1 | error[E0433]: cannot find module or crate `page_size` in this scope | |
| 2 | 2 | --> $DIR/path-to-method-sugg-unresolved-expr.rs:5:21 |
| 3 | 3 | | |
| 4 | 4 | LL | let page_size = page_size::get(); |
tests/ui/typeck/path-to-method-sugg-unresolved-expr.only-rustc.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: use of unresolved module or unlinked crate `page_size` | |
| 1 | error[E0433]: cannot find module or crate `page_size` in this scope | |
| 2 | 2 | --> $DIR/path-to-method-sugg-unresolved-expr.rs:5:21 |
| 3 | 3 | | |
| 4 | 4 | LL | let page_size = page_size::get(); |
tests/ui/typeck/path-to-method-sugg-unresolved-expr.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | //@[cargo-invoked] rustc-env:CARGO_CRATE_NAME=foo |
| 4 | 4 | fn main() { |
| 5 | 5 | let page_size = page_size::get(); |
| 6 | //~^ ERROR failed to resolve: use of unresolved module or unlinked crate `page_size` | |
| 6 | //~^ ERROR cannot find module or crate `page_size` | |
| 7 | 7 | //~| NOTE use of unresolved module or unlinked crate `page_size` |
| 8 | 8 | //[cargo-invoked]~^^^ HELP if you wanted to use a crate named `page_size`, use `cargo add |
| 9 | 9 | //[only-rustc]~^^^^ HELP you might be missing a crate named `page_size` |
tests/ui/use/use-path-segment-kw.rs+22-22| ... | ... | @@ -9,43 +9,43 @@ macro_rules! macro_dollar_crate { |
| 9 | 9 | use $crate; //~ ERROR `$crate` may not be imported |
| 10 | 10 | pub use $crate as _dollar_crate; //~ ERROR `$crate` may not be imported |
| 11 | 11 | |
| 12 | type A2 = ::$crate; //~ ERROR failed to resolve: global paths cannot start with `$crate` | |
| 12 | type A2 = ::$crate; //~ ERROR global paths cannot start with `$crate` | |
| 13 | 13 | use ::$crate; //~ ERROR unresolved import `$crate` |
| 14 | 14 | use ::$crate as _dollar_crate2; //~ ERROR unresolved import `$crate` |
| 15 | 15 | use ::{$crate}; //~ ERROR unresolved import `$crate` |
| 16 | 16 | use ::{$crate as _nested_dollar_crate2}; //~ ERROR unresolved import `$crate` |
| 17 | 17 | |
| 18 | type A3 = foobar::$crate; //~ ERROR failed to resolve: `$crate` in paths can only be used in start position | |
| 18 | type A3 = foobar::$crate; //~ ERROR `$crate` in paths can only be used in start position | |
| 19 | 19 | use foobar::$crate; //~ ERROR unresolved import `foobar::$crate` |
| 20 | 20 | use foobar::$crate as _dollar_crate3; //~ ERROR unresolved import `foobar::$crate` |
| 21 | 21 | use foobar::{$crate}; //~ ERROR unresolved import `foobar::$crate` |
| 22 | 22 | use foobar::{$crate as _nested_dollar_crate3}; //~ ERROR unresolved import `foobar::$crate` |
| 23 | 23 | |
| 24 | type A4 = crate::$crate; //~ ERROR failed to resolve: `$crate` in paths can only be used in start position | |
| 24 | type A4 = crate::$crate; //~ ERROR `$crate` in paths can only be used in start position | |
| 25 | 25 | use crate::$crate; //~ ERROR unresolved import `crate::$crate` |
| 26 | 26 | use crate::$crate as _dollar_crate4; //~ ERROR unresolved import `crate::$crate` |
| 27 | 27 | use crate::{$crate}; //~ ERROR unresolved import `crate::$crate` |
| 28 | 28 | use crate::{$crate as _nested_dollar_crate4}; //~ ERROR unresolved import `crate::$crate` |
| 29 | 29 | |
| 30 | type A5 = super::$crate; //~ ERROR failed to resolve: `$crate` in paths can only be used in start position | |
| 30 | type A5 = super::$crate; //~ ERROR `$crate` in paths can only be used in start position | |
| 31 | 31 | use super::$crate; //~ ERROR unresolved import `super::$crate` |
| 32 | 32 | use super::$crate as _dollar_crate5; //~ ERROR unresolved import `super::$crate` |
| 33 | 33 | use super::{$crate}; //~ ERROR unresolved import `super::$crate` |
| 34 | 34 | use super::{$crate as _nested_dollar_crate5}; //~ ERROR unresolved import `super::$crate` |
| 35 | 35 | |
| 36 | type A6 = self::$crate; //~ ERROR failed to resolve: `$crate` in paths can only be used in start position | |
| 36 | type A6 = self::$crate; //~ ERROR `$crate` in paths can only be used in start position | |
| 37 | 37 | use self::$crate; |
| 38 | 38 | use self::$crate as _dollar_crate6; |
| 39 | 39 | use self::{$crate}; |
| 40 | 40 | use self::{$crate as _nested_dollar_crate6}; |
| 41 | 41 | |
| 42 | type A7 = $crate::$crate; //~ ERROR failed to resolve: `$crate` in paths can only be used in start position | |
| 42 | type A7 = $crate::$crate; //~ ERROR `$crate` in paths can only be used in start position | |
| 43 | 43 | use $crate::$crate; //~ ERROR unresolved import `$crate::$crate` |
| 44 | 44 | use $crate::$crate as _dollar_crate7; //~ ERROR unresolved import `$crate::$crate` |
| 45 | 45 | use $crate::{$crate}; //~ ERROR unresolved import `$crate::$crate` |
| 46 | 46 | use $crate::{$crate as _nested_dollar_crate7}; //~ ERROR unresolved import `$crate::$crate` |
| 47 | 47 | |
| 48 | type A8 = $crate::crate; //~ ERROR failed to resolve: `crate` in paths can only be used in start position | |
| 48 | type A8 = $crate::crate; //~ ERROR `crate` in paths can only be used in start position | |
| 49 | 49 | use $crate::crate; //~ ERROR unresolved import `$crate::crate` |
| 50 | 50 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 51 | 51 | use $crate::crate as _m_crate8; //~ ERROR unresolved import `$crate::crate` |
| ... | ... | @@ -53,13 +53,13 @@ macro_rules! macro_dollar_crate { |
| 53 | 53 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 54 | 54 | use $crate::{crate as _m_nested_crate8}; //~ ERROR unresolved import `$crate::crate` |
| 55 | 55 | |
| 56 | type A9 = $crate::super; //~ ERROR failed to resolve: `super` in paths can only be used in start position | |
| 56 | type A9 = $crate::super; //~ ERROR `super` in paths can only be used in start position | |
| 57 | 57 | use $crate::super; //~ ERROR unresolved import `$crate::super` |
| 58 | 58 | use $crate::super as _m_super8; //~ ERROR unresolved import `$crate::super` |
| 59 | 59 | use $crate::{super}; //~ ERROR unresolved import `$crate::super` |
| 60 | 60 | use $crate::{super as _m_nested_super8}; //~ ERROR unresolved import `$crate::super` |
| 61 | 61 | |
| 62 | type A10 = $crate::self; //~ ERROR failed to resolve: `self` in paths can only be used in start position | |
| 62 | type A10 = $crate::self; //~ ERROR `self` in paths can only be used in start position | |
| 63 | 63 | use $crate::self; //~ ERROR `$crate` may not be imported |
| 64 | 64 | //~^ ERROR `self` imports are only allowed within a { } list |
| 65 | 65 | //~^^ ERROR the name `<!dummy!>` is defined multiple times |
| ... | ... | @@ -98,7 +98,7 @@ mod foo { |
| 98 | 98 | use crate; //~ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 99 | 99 | pub use crate as _crate; // Good |
| 100 | 100 | |
| 101 | type B2 = ::crate; //~ ERROR failed to resolve: global paths cannot start with `crate` | |
| 101 | type B2 = ::crate; //~ ERROR `crate` | |
| 102 | 102 | use ::crate; //~ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 103 | 103 | //~^ ERROR unresolved import `crate` |
| 104 | 104 | use ::crate as _crate2; //~ ERROR unresolved import `crate` |
| ... | ... | @@ -106,7 +106,7 @@ mod foo { |
| 106 | 106 | //~^ ERROR unresolved import `crate` |
| 107 | 107 | use ::{crate as _nested_crate2}; //~ ERROR unresolved import `crate` |
| 108 | 108 | |
| 109 | type B3 = foobar::crate; //~ ERROR failed to resolve: `crate` in paths can only be used in start position | |
| 109 | type B3 = foobar::crate; //~ ERROR `crate` in paths can only be used in start position | |
| 110 | 110 | use foobar::crate; //~ ERROR unresolved import `foobar::crate` |
| 111 | 111 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 112 | 112 | use foobar::crate as _crate3; //~ ERROR unresolved import `foobar::crate` |
| ... | ... | @@ -114,7 +114,7 @@ mod foo { |
| 114 | 114 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 115 | 115 | use foobar::{crate as _nested_crate3}; //~ ERROR unresolved import `foobar::crate` |
| 116 | 116 | |
| 117 | type B4 = crate::crate; //~ ERROR failed to resolve: `crate` in paths can only be used in start position | |
| 117 | type B4 = crate::crate; //~ ERROR `crate` in paths can only be used in start position | |
| 118 | 118 | use crate::crate; //~ ERROR unresolved import `crate::crate` |
| 119 | 119 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 120 | 120 | use crate::crate as _crate4; //~ ERROR unresolved import `crate::crate` |
| ... | ... | @@ -122,7 +122,7 @@ mod foo { |
| 122 | 122 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 123 | 123 | use crate::{crate as _nested_crate4}; //~ ERROR unresolved import `crate::crate` |
| 124 | 124 | |
| 125 | type B5 = super::crate; //~ ERROR failed to resolve: `crate` in paths can only be used in start position | |
| 125 | type B5 = super::crate; //~ ERROR `crate` in paths can only be used in start position | |
| 126 | 126 | use super::crate; //~ ERROR unresolved import `super::crate` |
| 127 | 127 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 128 | 128 | use super::crate as _crate5; //~ ERROR unresolved import `super::crate` |
| ... | ... | @@ -130,7 +130,7 @@ mod foo { |
| 130 | 130 | //~^ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 131 | 131 | use super::{crate as _nested_crate5}; //~ ERROR unresolved import `super::crate` |
| 132 | 132 | |
| 133 | type B6 = self::crate; //~ ERROR failed to resolve: `crate` in paths can only be used in start position | |
| 133 | type B6 = self::crate; //~ ERROR `crate` in paths can only be used in start position | |
| 134 | 134 | use self::crate; //~ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 135 | 135 | //~^ ERROR the name `crate` is defined multiple times |
| 136 | 136 | use self::crate as _crate6; |
| ... | ... | @@ -146,19 +146,19 @@ mod foo { |
| 146 | 146 | use super; //~ ERROR unresolved import `super` |
| 147 | 147 | pub use super as _super; //~ ERROR unresolved import `super` |
| 148 | 148 | |
| 149 | type C2 = ::super; //~ ERROR failed to resolve: global paths cannot start with `super` | |
| 149 | type C2 = ::super; //~ ERROR global paths cannot start with `super` | |
| 150 | 150 | use ::super; //~ ERROR unresolved import `super` |
| 151 | 151 | use ::super as _super2; //~ ERROR unresolved import `super` |
| 152 | 152 | use ::{super}; //~ ERROR unresolved import `super` |
| 153 | 153 | use ::{super as _nested_super2}; //~ ERROR unresolved import `super` |
| 154 | 154 | |
| 155 | type C3 = foobar::super; //~ ERROR failed to resolve: `super` in paths can only be used in start position | |
| 155 | type C3 = foobar::super; //~ ERROR `super` in paths can only be used in start position | |
| 156 | 156 | use foobar::super; //~ ERROR unresolved import `foobar::super` |
| 157 | 157 | use foobar::super as _super3; //~ ERROR unresolved import `foobar::super` |
| 158 | 158 | use foobar::{super}; //~ ERROR unresolved import `foobar::super` |
| 159 | 159 | use foobar::{super as _nested_super3}; //~ ERROR unresolved import `foobar::super` |
| 160 | 160 | |
| 161 | type C4 = crate::super; //~ ERROR failed to resolve: `super` in paths can only be used in start position | |
| 161 | type C4 = crate::super; //~ ERROR `super` in paths can only be used in start position | |
| 162 | 162 | use crate::super; //~ ERROR unresolved import `crate::super` |
| 163 | 163 | use crate::super as _super4; //~ ERROR unresolved import `crate::super` |
| 164 | 164 | use crate::{super}; //~ ERROR unresolved import `crate::super` |
| ... | ... | @@ -184,7 +184,7 @@ mod foo { |
| 184 | 184 | use self; //~ ERROR `self` imports are only allowed within a { } list |
| 185 | 185 | pub use self as _self; //~ ERROR `self` imports are only allowed within a { } list |
| 186 | 186 | |
| 187 | type D2 = ::self; //~ ERROR failed to resolve: global paths cannot start with `self` | |
| 187 | type D2 = ::self; //~ ERROR global paths cannot start with `self` | |
| 188 | 188 | use ::self; //~ ERROR `self` imports are only allowed within a { } list |
| 189 | 189 | //~^ ERROR unresolved import `{{root}}` |
| 190 | 190 | use ::self as _self2; //~ ERROR `self` imports are only allowed within a { } list |
| ... | ... | @@ -192,13 +192,13 @@ mod foo { |
| 192 | 192 | use ::{self}; //~ ERROR `self` import can only appear in an import list with a non-empty prefix |
| 193 | 193 | use ::{self as _nested_self2}; //~ ERROR `self` import can only appear in an import list with a non-empty prefix |
| 194 | 194 | |
| 195 | type D3 = foobar::self; //~ ERROR failed to resolve: `self` in paths can only be used in start position | |
| 195 | type D3 = foobar::self; //~ ERROR `self` in paths can only be used in start position | |
| 196 | 196 | pub use foobar::qux::self; //~ ERROR `self` imports are only allowed within a { } list |
| 197 | 197 | pub use foobar::self as _self3; //~ ERROR `self` imports are only allowed within a { } list |
| 198 | 198 | pub use foobar::baz::{self}; // Good |
| 199 | 199 | pub use foobar::{self as _nested_self3}; // Good |
| 200 | 200 | |
| 201 | type D4 = crate::self; //~ ERROR failed to resolve: `self` in paths can only be used in start position | |
| 201 | type D4 = crate::self; //~ ERROR `self` in paths can only be used in start position | |
| 202 | 202 | use crate::self; //~ ERROR crate root imports need to be explicitly named: `use crate as name;` |
| 203 | 203 | //~^ ERROR `self` imports are only allowed within a { } list |
| 204 | 204 | //~^^ ERROR the name `crate` is defined multiple times |
| ... | ... | @@ -207,7 +207,7 @@ mod foo { |
| 207 | 207 | //~^ ERROR the name `crate` is defined multiple times |
| 208 | 208 | pub use crate::{self as _nested_self4}; // Good |
| 209 | 209 | |
| 210 | type D5 = super::self; //~ ERROR failed to resolve: `self` in paths can only be used in start position | |
| 210 | type D5 = super::self; //~ ERROR `self` in paths can only be used in start position | |
| 211 | 211 | use super::self; //~ ERROR unresolved import `super` |
| 212 | 212 | //~^ ERROR `self` imports are only allowed within a { } list |
| 213 | 213 | pub use super::self as _self5; //~ ERROR `self` imports are only allowed within a { } list |
| ... | ... | @@ -215,7 +215,7 @@ mod foo { |
| 215 | 215 | use super::{self}; //~ ERROR unresolved import `super` |
| 216 | 216 | pub use super::{self as _nested_self5}; //~ ERROR unresolved import `super` |
| 217 | 217 | |
| 218 | type D6 = self::self; //~ ERROR failed to resolve: `self` in paths can only be used in start position | |
| 218 | type D6 = self::self; //~ ERROR `self` in paths can only be used in start position | |
| 219 | 219 | use self::self; //~ ERROR `self` imports are only allowed within a { } list |
| 220 | 220 | pub use self::self as _self6; //~ ERROR `self` imports are only allowed within a { } list |
| 221 | 221 | use self::{self}; //~ ERROR unresolved import `self` |
tests/ui/use/use-path-segment-kw.stderr+44-44| ... | ... | @@ -1062,182 +1062,182 @@ error[E0573]: expected type, found module `self` |
| 1062 | 1062 | LL | type D1 = self; |
| 1063 | 1063 | | ^^^^ not a type |
| 1064 | 1064 | |
| 1065 | error[E0433]: failed to resolve: global paths cannot start with `$crate` | |
| 1065 | error[E0433]: global paths cannot start with `$crate` | |
| 1066 | 1066 | --> $DIR/use-path-segment-kw.rs:12:21 |
| 1067 | 1067 | | |
| 1068 | 1068 | LL | type A2 = ::$crate; |
| 1069 | | ^^^^^^ global paths cannot start with `$crate` | |
| 1069 | | ^^^^^^ cannot start with this | |
| 1070 | 1070 | ... |
| 1071 | 1071 | LL | macro_dollar_crate!(); |
| 1072 | 1072 | | --------------------- in this macro invocation |
| 1073 | 1073 | | |
| 1074 | 1074 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1075 | 1075 | |
| 1076 | error[E0433]: failed to resolve: `$crate` in paths can only be used in start position | |
| 1076 | error[E0433]: `$crate` in paths can only be used in start position | |
| 1077 | 1077 | --> $DIR/use-path-segment-kw.rs:18:27 |
| 1078 | 1078 | | |
| 1079 | 1079 | LL | type A3 = foobar::$crate; |
| 1080 | | ^^^^^^ `$crate` in paths can only be used in start position | |
| 1080 | | ^^^^^^ can only be used in path start position | |
| 1081 | 1081 | ... |
| 1082 | 1082 | LL | macro_dollar_crate!(); |
| 1083 | 1083 | | --------------------- in this macro invocation |
| 1084 | 1084 | | |
| 1085 | 1085 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1086 | 1086 | |
| 1087 | error[E0433]: failed to resolve: `$crate` in paths can only be used in start position | |
| 1087 | error[E0433]: `$crate` in paths can only be used in start position | |
| 1088 | 1088 | --> $DIR/use-path-segment-kw.rs:24:26 |
| 1089 | 1089 | | |
| 1090 | 1090 | LL | type A4 = crate::$crate; |
| 1091 | | ^^^^^^ `$crate` in paths can only be used in start position | |
| 1091 | | ^^^^^^ can only be used in path start position | |
| 1092 | 1092 | ... |
| 1093 | 1093 | LL | macro_dollar_crate!(); |
| 1094 | 1094 | | --------------------- in this macro invocation |
| 1095 | 1095 | | |
| 1096 | 1096 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1097 | 1097 | |
| 1098 | error[E0433]: failed to resolve: `$crate` in paths can only be used in start position | |
| 1098 | error[E0433]: `$crate` in paths can only be used in start position | |
| 1099 | 1099 | --> $DIR/use-path-segment-kw.rs:30:26 |
| 1100 | 1100 | | |
| 1101 | 1101 | LL | type A5 = super::$crate; |
| 1102 | | ^^^^^^ `$crate` in paths can only be used in start position | |
| 1102 | | ^^^^^^ can only be used in path start position | |
| 1103 | 1103 | ... |
| 1104 | 1104 | LL | macro_dollar_crate!(); |
| 1105 | 1105 | | --------------------- in this macro invocation |
| 1106 | 1106 | | |
| 1107 | 1107 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1108 | 1108 | |
| 1109 | error[E0433]: failed to resolve: `$crate` in paths can only be used in start position | |
| 1109 | error[E0433]: `$crate` in paths can only be used in start position | |
| 1110 | 1110 | --> $DIR/use-path-segment-kw.rs:36:25 |
| 1111 | 1111 | | |
| 1112 | 1112 | LL | type A6 = self::$crate; |
| 1113 | | ^^^^^^ `$crate` in paths can only be used in start position | |
| 1113 | | ^^^^^^ can only be used in path start position | |
| 1114 | 1114 | ... |
| 1115 | 1115 | LL | macro_dollar_crate!(); |
| 1116 | 1116 | | --------------------- in this macro invocation |
| 1117 | 1117 | | |
| 1118 | 1118 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1119 | 1119 | |
| 1120 | error[E0433]: failed to resolve: `$crate` in paths can only be used in start position | |
| 1120 | error[E0433]: `$crate` in paths can only be used in start position | |
| 1121 | 1121 | --> $DIR/use-path-segment-kw.rs:42:27 |
| 1122 | 1122 | | |
| 1123 | 1123 | LL | type A7 = $crate::$crate; |
| 1124 | | ^^^^^^ `$crate` in paths can only be used in start position | |
| 1124 | | ^^^^^^ can only be used in path start position | |
| 1125 | 1125 | ... |
| 1126 | 1126 | LL | macro_dollar_crate!(); |
| 1127 | 1127 | | --------------------- in this macro invocation |
| 1128 | 1128 | | |
| 1129 | 1129 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1130 | 1130 | |
| 1131 | error[E0433]: failed to resolve: `crate` in paths can only be used in start position | |
| 1131 | error[E0433]: `crate` in paths can only be used in start position | |
| 1132 | 1132 | --> $DIR/use-path-segment-kw.rs:48:27 |
| 1133 | 1133 | | |
| 1134 | 1134 | LL | type A8 = $crate::crate; |
| 1135 | | ^^^^^ `crate` in paths can only be used in start position | |
| 1135 | | ^^^^^ can only be used in path start position | |
| 1136 | 1136 | ... |
| 1137 | 1137 | LL | macro_dollar_crate!(); |
| 1138 | 1138 | | --------------------- in this macro invocation |
| 1139 | 1139 | | |
| 1140 | 1140 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1141 | 1141 | |
| 1142 | error[E0433]: failed to resolve: `super` in paths can only be used in start position | |
| 1142 | error[E0433]: `super` in paths can only be used in start position | |
| 1143 | 1143 | --> $DIR/use-path-segment-kw.rs:56:27 |
| 1144 | 1144 | | |
| 1145 | 1145 | LL | type A9 = $crate::super; |
| 1146 | | ^^^^^ `super` in paths can only be used in start position | |
| 1146 | | ^^^^^ can only be used in path start position | |
| 1147 | 1147 | ... |
| 1148 | 1148 | LL | macro_dollar_crate!(); |
| 1149 | 1149 | | --------------------- in this macro invocation |
| 1150 | 1150 | | |
| 1151 | 1151 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1152 | 1152 | |
| 1153 | error[E0433]: failed to resolve: `self` in paths can only be used in start position | |
| 1153 | error[E0433]: `self` in paths can only be used in start position | |
| 1154 | 1154 | --> $DIR/use-path-segment-kw.rs:62:28 |
| 1155 | 1155 | | |
| 1156 | 1156 | LL | type A10 = $crate::self; |
| 1157 | | ^^^^ `self` in paths can only be used in start position | |
| 1157 | | ^^^^ can only be used in path start position | |
| 1158 | 1158 | ... |
| 1159 | 1159 | LL | macro_dollar_crate!(); |
| 1160 | 1160 | | --------------------- in this macro invocation |
| 1161 | 1161 | | |
| 1162 | 1162 | = note: this error originates in the macro `macro_dollar_crate` (in Nightly builds, run with -Z macro-backtrace for more info) |
| 1163 | 1163 | |
| 1164 | error[E0433]: failed to resolve: global paths cannot start with `crate` | |
| 1164 | error[E0433]: global paths cannot start with `crate` | |
| 1165 | 1165 | --> $DIR/use-path-segment-kw.rs:101:21 |
| 1166 | 1166 | | |
| 1167 | 1167 | LL | type B2 = ::crate; |
| 1168 | | ^^^^^ global paths cannot start with `crate` | |
| 1168 | | ^^^^^ cannot start with this | |
| 1169 | 1169 | |
| 1170 | error[E0433]: failed to resolve: `crate` in paths can only be used in start position | |
| 1170 | error[E0433]: `crate` in paths can only be used in start position | |
| 1171 | 1171 | --> $DIR/use-path-segment-kw.rs:109:27 |
| 1172 | 1172 | | |
| 1173 | 1173 | LL | type B3 = foobar::crate; |
| 1174 | | ^^^^^ `crate` in paths can only be used in start position | |
| 1174 | | ^^^^^ can only be used in path start position | |
| 1175 | 1175 | |
| 1176 | error[E0433]: failed to resolve: `crate` in paths can only be used in start position | |
| 1176 | error[E0433]: `crate` in paths can only be used in start position | |
| 1177 | 1177 | --> $DIR/use-path-segment-kw.rs:117:26 |
| 1178 | 1178 | | |
| 1179 | 1179 | LL | type B4 = crate::crate; |
| 1180 | | ^^^^^ `crate` in paths can only be used in start position | |
| 1180 | | ^^^^^ can only be used in path start position | |
| 1181 | 1181 | |
| 1182 | error[E0433]: failed to resolve: `crate` in paths can only be used in start position | |
| 1182 | error[E0433]: `crate` in paths can only be used in start position | |
| 1183 | 1183 | --> $DIR/use-path-segment-kw.rs:125:26 |
| 1184 | 1184 | | |
| 1185 | 1185 | LL | type B5 = super::crate; |
| 1186 | | ^^^^^ `crate` in paths can only be used in start position | |
| 1186 | | ^^^^^ can only be used in path start position | |
| 1187 | 1187 | |
| 1188 | error[E0433]: failed to resolve: `crate` in paths can only be used in start position | |
| 1188 | error[E0433]: `crate` in paths can only be used in start position | |
| 1189 | 1189 | --> $DIR/use-path-segment-kw.rs:133:25 |
| 1190 | 1190 | | |
| 1191 | 1191 | LL | type B6 = self::crate; |
| 1192 | | ^^^^^ `crate` in paths can only be used in start position | |
| 1192 | | ^^^^^ can only be used in path start position | |
| 1193 | 1193 | |
| 1194 | error[E0433]: failed to resolve: global paths cannot start with `super` | |
| 1194 | error[E0433]: global paths cannot start with `super` | |
| 1195 | 1195 | --> $DIR/use-path-segment-kw.rs:149:21 |
| 1196 | 1196 | | |
| 1197 | 1197 | LL | type C2 = ::super; |
| 1198 | | ^^^^^ global paths cannot start with `super` | |
| 1198 | | ^^^^^ cannot start with this | |
| 1199 | 1199 | |
| 1200 | error[E0433]: failed to resolve: `super` in paths can only be used in start position | |
| 1200 | error[E0433]: `super` in paths can only be used in start position | |
| 1201 | 1201 | --> $DIR/use-path-segment-kw.rs:155:27 |
| 1202 | 1202 | | |
| 1203 | 1203 | LL | type C3 = foobar::super; |
| 1204 | | ^^^^^ `super` in paths can only be used in start position | |
| 1204 | | ^^^^^ can only be used in path start position | |
| 1205 | 1205 | |
| 1206 | error[E0433]: failed to resolve: `super` in paths can only be used in start position | |
| 1206 | error[E0433]: `super` in paths can only be used in start position | |
| 1207 | 1207 | --> $DIR/use-path-segment-kw.rs:161:26 |
| 1208 | 1208 | | |
| 1209 | 1209 | LL | type C4 = crate::super; |
| 1210 | | ^^^^^ `super` in paths can only be used in start position | |
| 1210 | | ^^^^^ can only be used in path start position | |
| 1211 | 1211 | |
| 1212 | error[E0433]: failed to resolve: global paths cannot start with `self` | |
| 1212 | error[E0433]: global paths cannot start with `self` | |
| 1213 | 1213 | --> $DIR/use-path-segment-kw.rs:187:21 |
| 1214 | 1214 | | |
| 1215 | 1215 | LL | type D2 = ::self; |
| 1216 | | ^^^^ global paths cannot start with `self` | |
| 1216 | | ^^^^ cannot start with this | |
| 1217 | 1217 | |
| 1218 | error[E0433]: failed to resolve: `self` in paths can only be used in start position | |
| 1218 | error[E0433]: `self` in paths can only be used in start position | |
| 1219 | 1219 | --> $DIR/use-path-segment-kw.rs:195:27 |
| 1220 | 1220 | | |
| 1221 | 1221 | LL | type D3 = foobar::self; |
| 1222 | | ^^^^ `self` in paths can only be used in start position | |
| 1222 | | ^^^^ can only be used in path start position | |
| 1223 | 1223 | |
| 1224 | error[E0433]: failed to resolve: `self` in paths can only be used in start position | |
| 1224 | error[E0433]: `self` in paths can only be used in start position | |
| 1225 | 1225 | --> $DIR/use-path-segment-kw.rs:201:26 |
| 1226 | 1226 | | |
| 1227 | 1227 | LL | type D4 = crate::self; |
| 1228 | | ^^^^ `self` in paths can only be used in start position | |
| 1228 | | ^^^^ can only be used in path start position | |
| 1229 | 1229 | |
| 1230 | error[E0433]: failed to resolve: `self` in paths can only be used in start position | |
| 1230 | error[E0433]: `self` in paths can only be used in start position | |
| 1231 | 1231 | --> $DIR/use-path-segment-kw.rs:210:26 |
| 1232 | 1232 | | |
| 1233 | 1233 | LL | type D5 = super::self; |
| 1234 | | ^^^^ `self` in paths can only be used in start position | |
| 1234 | | ^^^^ can only be used in path start position | |
| 1235 | 1235 | |
| 1236 | error[E0433]: failed to resolve: `self` in paths can only be used in start position | |
| 1236 | error[E0433]: `self` in paths can only be used in start position | |
| 1237 | 1237 | --> $DIR/use-path-segment-kw.rs:218:25 |
| 1238 | 1238 | | |
| 1239 | 1239 | LL | type D6 = self::self; |
| 1240 | | ^^^^ `self` in paths can only be used in start position | |
| 1240 | | ^^^^ can only be used in path start position | |
| 1241 | 1241 | |
| 1242 | 1242 | error: aborting due to 141 previous errors |
| 1243 | 1243 |
tests/ui/use/use-self-type.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ impl S { |
| 4 | 4 | fn f() {} |
| 5 | 5 | fn g() { |
| 6 | 6 | use Self::f; //~ ERROR unresolved import |
| 7 | pub(in Self::f) struct Z; //~ ERROR failed to resolve: `Self` | |
| 7 | pub(in Self::f) struct Z; //~ ERROR cannot find `Self` | |
| 8 | 8 | } |
| 9 | 9 | } |
| 10 | 10 |
tests/ui/use/use-self-type.stderr+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | error[E0433]: failed to resolve: `Self` cannot be used in imports | |
| 1 | error[E0433]: cannot find `Self` in this scope | |
| 2 | 2 | --> $DIR/use-self-type.rs:7:16 |
| 3 | 3 | | |
| 4 | 4 | LL | pub(in Self::f) struct Z; |
tests/ui/use/use-super-global-path.rs+4-3| ... | ... | @@ -4,11 +4,12 @@ struct S; |
| 4 | 4 | struct Z; |
| 5 | 5 | |
| 6 | 6 | mod foo { |
| 7 | use ::super::{S, Z}; //~ ERROR global paths cannot start with `super` | |
| 8 | //~| ERROR global paths cannot start with `super` | |
| 7 | use ::super::{S, Z}; | |
| 8 | //~^ ERROR: global paths cannot start with `super` | |
| 9 | //~| ERROR: global paths cannot start with `super` | |
| 9 | 10 | |
| 10 | 11 | pub fn g() { |
| 11 | use ::super::main; //~ ERROR global paths cannot start with `super` | |
| 12 | use ::super::main; //~ ERROR: global paths cannot start with `super` | |
| 12 | 13 | main(); |
| 13 | 14 | } |
| 14 | 15 | } |
tests/ui/use/use-super-global-path.stderr+7-7| ... | ... | @@ -1,22 +1,22 @@ |
| 1 | error[E0433]: failed to resolve: global paths cannot start with `super` | |
| 1 | error[E0433]: global paths cannot start with `super` | |
| 2 | 2 | --> $DIR/use-super-global-path.rs:7:11 |
| 3 | 3 | | |
| 4 | 4 | LL | use ::super::{S, Z}; |
| 5 | | ^^^^^ global paths cannot start with `super` | |
| 5 | | ^^^^^ cannot start with this | |
| 6 | 6 | |
| 7 | error[E0433]: failed to resolve: global paths cannot start with `super` | |
| 7 | error[E0433]: global paths cannot start with `super` | |
| 8 | 8 | --> $DIR/use-super-global-path.rs:7:11 |
| 9 | 9 | | |
| 10 | 10 | LL | use ::super::{S, Z}; |
| 11 | | ^^^^^ global paths cannot start with `super` | |
| 11 | | ^^^^^ cannot start with this | |
| 12 | 12 | | |
| 13 | 13 | = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` |
| 14 | 14 | |
| 15 | error[E0433]: failed to resolve: global paths cannot start with `super` | |
| 16 | --> $DIR/use-super-global-path.rs:11:15 | |
| 15 | error[E0433]: global paths cannot start with `super` | |
| 16 | --> $DIR/use-super-global-path.rs:12:15 | |
| 17 | 17 | | |
| 18 | 18 | LL | use ::super::main; |
| 19 | | ^^^^^ global paths cannot start with `super` | |
| 19 | | ^^^^^ cannot start with this | |
| 20 | 20 | |
| 21 | 21 | error: aborting due to 3 previous errors |
| 22 | 22 |
typos.toml+1| ... | ... | @@ -46,6 +46,7 @@ unstalled = "unstalled" # short for un-stalled |
| 46 | 46 | # |
| 47 | 47 | # tidy-alphabetical-start |
| 48 | 48 | definitinon = "definition" |
| 49 | dependy = "" | |
| 49 | 50 | similarlty = "similarity" |
| 50 | 51 | # tidy-alphabetical-end |
| 51 | 52 |