Hadithcore
Sahih Muslim, 2268 a
sahih

Jabir reported Allah's Messenger (ﷺ) as saying:

He who saw me in sleep in fact saw me, for it is not possible for the satan to appear in my form; and he also said: When any one of you sees a hulm he should not inform anyone, for it is a sort of vain sport of devil in the state of sleep.

وَحَدَّثَنَا قُتَيْبَةُ بْنُ سَعِيدٍ، حَدَّثَنَا لَيْثٌ، ح وَحَدَّثَنَا ابْنُ رُمْحٍ، أَخْبَرَنَا اللَّيْثُ، عَنْ أَبِي، الزُّبَيْرِ عَنْ جَابِرٍ، أَنَّ رَسُولَ اللَّهِ صلى الله عليه وسلم قَالَ ‏"‏ مَنْ رَآنِي فِي النَّوْمِ فَقَدْ رَآنِي إِنَّهُ لاَ يَنْبَغِي لِلشَّيْطَانِ أَنْ يَتَمَثَّلَ فِي صُورَتِي ‏"‏ ‏.‏ وَقَالَ ‏"‏ إِذَا حَلَمَ أَحَدُكُمْ فَلاَ يُخْبِرْ أَحَدًا بِتَلَعُّبِ الشَّيْطَانِ بِهِ فِي الْمَنَامِ ‏"‏ ‏.‏

References2 variants
In-Book Reference
Book 42, Hadith 27
USC-MSA web (English) reference
Book 29, Hadith 5638 (deprecated numbering scheme)