Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1e44fee

Browse files
committedNov 20, 2017
Auto merge of #46130 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests - Successful merges: #46082, #46088, #46092, #46107, #46119, #46121, #46122, #46124, #46128 - Failed merges:
2 parents 33374fa + 079a6e4 commit 1e44fee

File tree

21 files changed

+114
-49
lines changed

21 files changed

+114
-49
lines changed
 

‎src/liballoc/arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Arc<T> {
13281328
#[stable(feature = "rust1", since = "1.0.0")]
13291329
impl<T: ?Sized> fmt::Pointer for Arc<T> {
13301330
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1331-
fmt::Pointer::fmt(&self.ptr, f)
1331+
fmt::Pointer::fmt(&(&**self as *const T), f)
13321332
}
13331333
}
13341334

‎src/liballoc/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Utilities for formatting and printing `String`s
11+
//! Utilities for formatting and printing `String`s.
1212
//!
1313
//! This module contains the runtime support for the [`format!`] syntax extension.
1414
//! This macro is implemented in the compiler to emit calls to this module in

‎src/liballoc/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ impl<T: ?Sized + fmt::Debug> fmt::Debug for Rc<T> {
10721072
#[stable(feature = "rust1", since = "1.0.0")]
10731073
impl<T: ?Sized> fmt::Pointer for Rc<T> {
10741074
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1075-
fmt::Pointer::fmt(&self.ptr, f)
1075+
fmt::Pointer::fmt(&(&**self as *const T), f)
10761076
}
10771077
}
10781078

‎src/liballoc/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,7 @@ impl str {
17341734
/// A more complex pattern, using a closure:
17351735
///
17361736
/// ```
1737-
/// assert_eq!("1fooX".trim_left_matches(|c| c == '1' || c == 'X'), "fooX");
1737+
/// assert_eq!("1fooX".trim_right_matches(|c| c == '1' || c == 'X'), "1foo");
17381738
/// ```
17391739
#[stable(feature = "rust1", since = "1.0.0")]
17401740
pub fn trim_right_matches<'a, P: Pattern<'a>>(&'a self, pat: P) -> &'a str

‎src/libcore/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ macro_rules! try {
361361
})
362362
}
363363

364-
/// Write formatted data into a buffer
364+
/// Write formatted data into a buffer.
365365
///
366366
/// This macro accepts a format string, a list of arguments, and a 'writer'. Arguments will be
367367
/// formatted according to the specified format string and the result will be passed to the writer.

‎src/librustc_mir/borrow_check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ fn do_mir_borrowck<'a, 'gcx, 'tcx>(infcx: &InferCtxt<'a, 'gcx, 'tcx>,
9191
IllegalMoveOriginKind::Static =>
9292
tcx.cannot_move_out_of(span, "static item", origin),
9393
IllegalMoveOriginKind::BorrowedContent =>
94-
tcx.cannot_move_out_of(span, "borrowed_content", origin),
94+
tcx.cannot_move_out_of(span, "borrowed content", origin),
9595
IllegalMoveOriginKind::InteriorOfTypeWithDestructor { container_ty: ty } =>
9696
tcx.cannot_move_out_of_interior_of_drop(span, ty, origin),
9797
IllegalMoveOriginKind::InteriorOfSliceOrArray { ty, is_index } =>

‎src/libstd/f32.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// except according to those terms.
1010

1111
//! This module provides constants which are specific to the implementation
12-
//! of the `f32` floating point data type. Mathematically significant
13-
//! numbers are provided in the `consts` sub-module.
12+
//! of the `f32` floating point data type.
13+
//!
14+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1415
//!
1516
//! *[See also the `f32` primitive type](../primitive.f32.html).*
1617

‎src/libstd/f64.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@
99
// except according to those terms.
1010

1111
//! This module provides constants which are specific to the implementation
12-
//! of the `f64` floating point data type. Mathematically significant
13-
//! numbers are provided in the `consts` sub-module.
12+
//! of the `f64` floating point data type.
13+
//!
14+
//! Mathematically significant numbers are provided in the `consts` sub-module.
1415
//!
1516
//! *[See also the `f64` primitive type](../primitive.f64.html).*
1617

‎src/libstd/io/mod.rs

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -419,14 +419,8 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
419419
///
420420
/// [`File`]s implement `Read`:
421421
///
422-
/// [`read()`]: trait.Read.html#tymethod.read
423-
/// [`std::io`]: ../../std/io/index.html
424-
/// [`File`]: ../fs/struct.File.html
425-
/// [`BufRead`]: trait.BufRead.html
426-
/// [`BufReader`]: struct.BufReader.html
427-
///
428422
/// ```
429-
/// use std::io;
423+
/// # use std::io;
430424
/// use std::io::prelude::*;
431425
/// use std::fs::File;
432426
///
@@ -449,6 +443,32 @@ fn read_to_end<R: Read + ?Sized>(r: &mut R, buf: &mut Vec<u8>) -> Result<usize>
449443
/// # Ok(())
450444
/// # }
451445
/// ```
446+
///
447+
/// Read from `&str` because [`&[u8]`] implements [`Read`]:
448+
///
449+
/// ```
450+
/// # use std::io;
451+
/// use std::io::prelude::*;
452+
///
453+
/// # fn foo() -> io::Result<()> {
454+
/// let mut b = "This string will be read".as_bytes();
455+
/// let mut buffer = [0; 10];
456+
///
457+
/// // read up to 10 bytes
458+
/// b.read(&mut buffer)?;
459+
///
460+
/// // etc... it works exactly as a File does!
461+
/// # Ok(())
462+
/// # }
463+
/// ```
464+
///
465+
/// [`read()`]: trait.Read.html#tymethod.read
466+
/// [`std::io`]: ../../std/io/index.html
467+
/// [`File`]: ../fs/struct.File.html
468+
/// [`BufRead`]: trait.BufRead.html
469+
/// [`BufReader`]: struct.BufReader.html
470+
/// [`&[u8]`]: primitive.slice.html
471+
///
452472
#[stable(feature = "rust1", since = "1.0.0")]
453473
pub trait Read {
454474
/// Pull some bytes from this source into the specified buffer, returning

‎src/libstd/panic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Panic support in the standard library
11+
//! Panic support in the standard library.
1212
1313
#![stable(feature = "std_panic", since = "1.9.0")]
1414

‎src/libstd/sync/mutex.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,17 @@ unsafe impl<#[may_dangle] T: ?Sized> Drop for Mutex<T> {
382382
}
383383
}
384384

385+
#[stable(feature = "mutex_from", since = "1.22.0")]
386+
impl<T> From<T> for Mutex<T> {
387+
/// Creates a new mutex in an unlocked state ready for use.
388+
/// This is equivalent to [`Mutex::new`].
389+
///
390+
/// [`Mutex::new`]: #method.new
391+
fn from(t: T) -> Self {
392+
Mutex::new(t)
393+
}
394+
}
395+
385396
#[stable(feature = "mutex_default", since = "1.10.0")]
386397
impl<T: ?Sized + Default> Default for Mutex<T> {
387398
/// Creates a `Mutex<T>`, with the `Default` value for T.

‎src/libstd/sync/rwlock.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,17 @@ impl<T: Default> Default for RwLock<T> {
457457
}
458458
}
459459

460+
#[stable(feature = "rw_lock_from", since = "1.22.0")]
461+
impl<T> From<T> for RwLock<T> {
462+
/// Creates a new instance of an `RwLock<T>` which is unlocked.
463+
/// This is equivalent to [`RwLock::new`].
464+
///
465+
/// [`RwLock::new`]: #method.new
466+
fn from(t: T) -> Self {
467+
RwLock::new(t)
468+
}
469+
}
470+
460471
impl<'rwlock, T: ?Sized> RwLockReadGuard<'rwlock, T> {
461472
unsafe fn new(lock: &'rwlock RwLock<T>)
462473
-> LockResult<RwLockReadGuard<'rwlock, T>> {

‎src/libstd/sys/redox/os.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,3 +213,7 @@ pub fn exit(code: i32) -> ! {
213213
pub fn getpid() -> u32 {
214214
syscall::getpid().unwrap() as u32
215215
}
216+
217+
pub fn getppid() -> u32 {
218+
syscall::getppid().unwrap() as u32
219+
}

‎src/libstd/sys/unix/ext/process.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,9 @@ impl IntoRawFd for process::ChildStderr {
191191
self.into_inner().into_fd().into_raw()
192192
}
193193
}
194+
195+
/// Returns the OS-assigned process identifier associated with this process's parent.
196+
#[unstable(feature = "unix_ppid", issue = "46104")]
197+
pub fn parent_id() -> u32 {
198+
::sys::os::getppid()
199+
}

‎src/libstd/sys/unix/os.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,3 +515,7 @@ pub fn exit(code: i32) -> ! {
515515
pub fn getpid() -> u32 {
516516
unsafe { libc::getpid() as u32 }
517517
}
518+
519+
pub fn getppid() -> u32 {
520+
unsafe { libc::getppid() as u32 }
521+
}

‎src/rustllvm/ArchiveWrapper.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static Archive::Kind fromRust(LLVMRustArchiveKind Kind) {
6666
case LLVMRustArchiveKind::COFF:
6767
return Archive::K_COFF;
6868
default:
69-
llvm_unreachable("Bad ArchiveKind.");
69+
report_fatal_error("Bad ArchiveKind.");
7070
}
7171
}
7272

‎src/rustllvm/PassWrapper.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ static CodeModel::Model fromRust(LLVMRustCodeModel Model) {
235235
case LLVMRustCodeModel::Large:
236236
return CodeModel::Large;
237237
default:
238-
llvm_unreachable("Bad CodeModel.");
238+
report_fatal_error("Bad CodeModel.");
239239
}
240240
}
241241

@@ -258,7 +258,7 @@ static CodeGenOpt::Level fromRust(LLVMRustCodeGenOptLevel Level) {
258258
case LLVMRustCodeGenOptLevel::Aggressive:
259259
return CodeGenOpt::Aggressive;
260260
default:
261-
llvm_unreachable("Bad CodeGenOptLevel.");
261+
report_fatal_error("Bad CodeGenOptLevel.");
262262
}
263263
}
264264

@@ -302,7 +302,7 @@ static Optional<Reloc::Model> fromRust(LLVMRustRelocMode RustReloc) {
302302
break;
303303
#endif
304304
}
305-
llvm_unreachable("Bad RelocModel.");
305+
report_fatal_error("Bad RelocModel.");
306306
}
307307

308308
#if LLVM_RUSTLLVM
@@ -511,7 +511,7 @@ static TargetMachine::CodeGenFileType fromRust(LLVMRustFileType Type) {
511511
case LLVMRustFileType::ObjectFile:
512512
return TargetMachine::CGFT_ObjectFile;
513513
default:
514-
llvm_unreachable("Bad FileType.");
514+
report_fatal_error("Bad FileType.");
515515
}
516516
}
517517

@@ -1197,7 +1197,7 @@ extern "C" bool
11971197
LLVMRustWriteThinBitcodeToFile(LLVMPassManagerRef PMR,
11981198
LLVMModuleRef M,
11991199
const char *BcFile) {
1200-
llvm_unreachable("ThinLTO not available");
1200+
report_fatal_error("ThinLTO not available");
12011201
}
12021202

12031203
struct LLVMRustThinLTOData {
@@ -1211,62 +1211,62 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
12111211
int num_modules,
12121212
const char **preserved_symbols,
12131213
int num_symbols) {
1214-
llvm_unreachable("ThinLTO not available");
1214+
report_fatal_error("ThinLTO not available");
12151215
}
12161216

12171217
extern "C" bool
12181218
LLVMRustPrepareThinLTORename(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
1219-
llvm_unreachable("ThinLTO not available");
1219+
report_fatal_error("ThinLTO not available");
12201220
}
12211221

12221222
extern "C" bool
12231223
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
1224-
llvm_unreachable("ThinLTO not available");
1224+
report_fatal_error("ThinLTO not available");
12251225
}
12261226

12271227
extern "C" bool
12281228
LLVMRustPrepareThinLTOInternalize(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
1229-
llvm_unreachable("ThinLTO not available");
1229+
report_fatal_error("ThinLTO not available");
12301230
}
12311231

12321232
extern "C" bool
12331233
LLVMRustPrepareThinLTOImport(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
1234-
llvm_unreachable("ThinLTO not available");
1234+
report_fatal_error("ThinLTO not available");
12351235
}
12361236

12371237
extern "C" void
12381238
LLVMRustFreeThinLTOData(LLVMRustThinLTOData *Data) {
1239-
llvm_unreachable("ThinLTO not available");
1239+
report_fatal_error("ThinLTO not available");
12401240
}
12411241

12421242
struct LLVMRustThinLTOBuffer {
12431243
};
12441244

12451245
extern "C" LLVMRustThinLTOBuffer*
12461246
LLVMRustThinLTOBufferCreate(LLVMModuleRef M) {
1247-
llvm_unreachable("ThinLTO not available");
1247+
report_fatal_error("ThinLTO not available");
12481248
}
12491249

12501250
extern "C" void
12511251
LLVMRustThinLTOBufferFree(LLVMRustThinLTOBuffer *Buffer) {
1252-
llvm_unreachable("ThinLTO not available");
1252+
report_fatal_error("ThinLTO not available");
12531253
}
12541254

12551255
extern "C" const void*
12561256
LLVMRustThinLTOBufferPtr(const LLVMRustThinLTOBuffer *Buffer) {
1257-
llvm_unreachable("ThinLTO not available");
1257+
report_fatal_error("ThinLTO not available");
12581258
}
12591259

12601260
extern "C" size_t
12611261
LLVMRustThinLTOBufferLen(const LLVMRustThinLTOBuffer *Buffer) {
1262-
llvm_unreachable("ThinLTO not available");
1262+
report_fatal_error("ThinLTO not available");
12631263
}
12641264

12651265
extern "C" LLVMModuleRef
12661266
LLVMRustParseBitcodeForThinLTO(LLVMContextRef Context,
12671267
const char *data,
12681268
size_t len,
12691269
const char *identifier) {
1270-
llvm_unreachable("ThinLTO not available");
1270+
report_fatal_error("ThinLTO not available");
12711271
}
12721272
#endif // LLVM_VERSION_GE(4, 0)

‎src/rustllvm/RustWrapper.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ static AtomicOrdering fromRust(LLVMAtomicOrdering Ordering) {
5454
return AtomicOrdering::SequentiallyConsistent;
5555
}
5656

57-
llvm_unreachable("Invalid LLVMAtomicOrdering value!");
57+
report_fatal_error("Invalid LLVMAtomicOrdering value!");
5858
}
5959

6060
static LLVM_THREAD_LOCAL char *LastError;
@@ -161,7 +161,7 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
161161
case SanitizeMemory:
162162
return Attribute::SanitizeMemory;
163163
}
164-
llvm_unreachable("bad AttributeKind");
164+
report_fatal_error("bad AttributeKind");
165165
}
166166

167167
extern "C" void LLVMRustAddCallSiteAttribute(LLVMValueRef Instr, unsigned Index,
@@ -356,7 +356,7 @@ static SyncScope::ID fromRust(LLVMRustSynchronizationScope Scope) {
356356
case LLVMRustSynchronizationScope::CrossThread:
357357
return SyncScope::System;
358358
default:
359-
llvm_unreachable("bad SynchronizationScope.");
359+
report_fatal_error("bad SynchronizationScope.");
360360
}
361361
}
362362
#else
@@ -367,7 +367,7 @@ static SynchronizationScope fromRust(LLVMRustSynchronizationScope Scope) {
367367
case LLVMRustSynchronizationScope::CrossThread:
368368
return CrossThread;
369369
default:
370-
llvm_unreachable("bad SynchronizationScope.");
370+
report_fatal_error("bad SynchronizationScope.");
371371
}
372372
}
373373
#endif
@@ -397,7 +397,7 @@ static InlineAsm::AsmDialect fromRust(LLVMRustAsmDialect Dialect) {
397397
case LLVMRustAsmDialect::Intel:
398398
return InlineAsm::AD_Intel;
399399
default:
400-
llvm_unreachable("bad AsmDialect.");
400+
report_fatal_error("bad AsmDialect.");
401401
}
402402
}
403403

@@ -748,7 +748,7 @@ extern "C" LLVMMetadataRef LLVMRustDIBuilderCreateVariable(
748748
unwrapDI<DIType>(Ty), AlwaysPreserve, fromRust(Flags)
749749
#if LLVM_VERSION_GE(4, 0)
750750
,
751-
AlignInBits
751+
AlignInBits
752752
#endif
753753
));
754754
} else {
@@ -1149,7 +1149,7 @@ extern "C" LLVMTypeKind LLVMRustGetTypeKind(LLVMTypeRef Ty) {
11491149
return LLVMTokenTypeKind;
11501150
#endif
11511151
}
1152-
llvm_unreachable("Unhandled TypeID.");
1152+
report_fatal_error("Unhandled TypeID.");
11531153
}
11541154

11551155
extern "C" void LLVMRustWriteDebugLocToString(LLVMContextRef C,
@@ -1370,7 +1370,7 @@ static LLVMRustLinkage toRust(LLVMLinkage Linkage) {
13701370
case LLVMCommonLinkage:
13711371
return LLVMRustLinkage::CommonLinkage;
13721372
default:
1373-
llvm_unreachable("Invalid LLVMRustLinkage value!");
1373+
report_fatal_error("Invalid LLVMRustLinkage value!");
13741374
}
13751375
}
13761376

@@ -1399,7 +1399,7 @@ static LLVMLinkage fromRust(LLVMRustLinkage Linkage) {
13991399
case LLVMRustLinkage::CommonLinkage:
14001400
return LLVMCommonLinkage;
14011401
}
1402-
llvm_unreachable("Invalid LLVMRustLinkage value!");
1402+
report_fatal_error("Invalid LLVMRustLinkage value!");
14031403
}
14041404

14051405
extern "C" LLVMRustLinkage LLVMRustGetLinkage(LLVMValueRef V) {
@@ -1447,7 +1447,7 @@ static LLVMRustVisibility toRust(LLVMVisibility Vis) {
14471447
case LLVMProtectedVisibility:
14481448
return LLVMRustVisibility::Protected;
14491449
}
1450-
llvm_unreachable("Invalid LLVMRustVisibility value!");
1450+
report_fatal_error("Invalid LLVMRustVisibility value!");
14511451
}
14521452

14531453
static LLVMVisibility fromRust(LLVMRustVisibility Vis) {
@@ -1459,7 +1459,7 @@ static LLVMVisibility fromRust(LLVMRustVisibility Vis) {
14591459
case LLVMRustVisibility::Protected:
14601460
return LLVMProtectedVisibility;
14611461
}
1462-
llvm_unreachable("Invalid LLVMRustVisibility value!");
1462+
report_fatal_error("Invalid LLVMRustVisibility value!");
14631463
}
14641464

14651465
extern "C" LLVMRustVisibility LLVMRustGetVisibility(LLVMValueRef V) {

‎src/test/COMPILER_TESTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ result is then compared against reference files named
106106
those files doesn't exist, the output must be empty. If the test run
107107
fails, we will print out the current output, but it is also saved in
108108
`build/<target-triple>/test/ui/hello_world/main.stdout` (this path is
109-
printed as part of the test failure mesage), so you can run `diff` and
109+
printed as part of the test failure message), so you can run `diff` and
110110
so forth.
111111

112112
### Editing and updating the reference files

‎src/tools/tidy/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ fn filter_dirs(path: &Path) -> bool {
5757
"src/libbacktrace",
5858
"src/libcompiler_builtins",
5959
"src/compiler-rt",
60-
"src/rustllvm",
6160
"src/liblibc",
6261
"src/vendor",
6362
"src/rt/hoedown",

‎src/tools/tidy/src/style.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ const UNEXPLAINED_IGNORE_DOCTEST_INFO: &str = r#"unexplained "```ignore" doctest
5050
5151
"#;
5252

53+
const LLVM_UNREACHABLE_INFO: &str = r"\
54+
C++ code used llvm_unreachable, which triggers undefined behavior
55+
when executed when assertions are disabled.
56+
Use llvm::report_fatal_error for increased robustness.";
57+
5358
/// Parser states for line_is_url.
5459
#[derive(PartialEq)]
5560
#[allow(non_camel_case_types)]
@@ -108,7 +113,7 @@ pub fn check(path: &Path, bad: &mut bool) {
108113
let mut contents = String::new();
109114
super::walk(path, &mut super::filter_dirs, &mut |file| {
110115
let filename = file.file_name().unwrap().to_string_lossy();
111-
let extensions = [".rs", ".py", ".js", ".sh", ".c", ".h"];
116+
let extensions = [".rs", ".py", ".js", ".sh", ".c", ".cpp", ".h"];
112117
if extensions.iter().all(|e| !filename.ends_with(e)) ||
113118
filename.starts_with(".#") {
114119
return
@@ -153,6 +158,9 @@ pub fn check(path: &Path, bad: &mut bool) {
153158
if line.ends_with("```ignore") || line.ends_with("```rust,ignore") {
154159
err(UNEXPLAINED_IGNORE_DOCTEST_INFO);
155160
}
161+
if filename.ends_with(".cpp") && line.contains("llvm_unreachable") {
162+
err(LLVM_UNREACHABLE_INFO);
163+
}
156164
}
157165
if !licenseck(file, &contents) {
158166
tidy_error!(bad, "{}: incorrect license", file.display());

0 commit comments

Comments
 (0)
Please sign in to comment.