Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
0603a73
Add test case for #50865 regression.
FelixMcFelix Jul 20, 2018
f285876
Logging for rustc_privacy.
FelixMcFelix Aug 10, 2018
8a72954
Window Mutex: make sure we properly initialize the SRWLock
RalfJung Aug 13, 2018
b7a49e7
fixed wording
RalfJung Aug 14, 2018
00b2606
Mark impl Trait Functions as reachable. (Fixes #50865)
FelixMcFelix Aug 20, 2018
81684bf
New AccessLevel and accompanying propagation.
FelixMcFelix Aug 20, 2018
54b096a
Fixes for code review.
FelixMcFelix Aug 21, 2018
3536359
Further fixes.
FelixMcFelix Aug 21, 2018
17eb64a
add macro check for lint
Dylan-DPC Aug 21, 2018
a6201f9
add testcase to existing macro testcase
Dylan-DPC Aug 21, 2018
11f3918
docs: std::string::String.repeat(): slightly rephrase to be more in-l…
matthiaskrgr Aug 22, 2018
f07245c
Update RELEASES.md
Aaronepower Aug 22, 2018
c9c4f5e
Fix a grammatical mistake in "expected generic arguments" errors
varkor Aug 22, 2018
276253e
update nomicon and book
RalfJung Aug 22, 2018
200c6d9
Update RELEASES.md
Aaronepower Aug 22, 2018
8fbcb9c
add warning for missing docs
Dylan-DPC Aug 22, 2018
a15b617
tidy: Stop requiring a license header
joshtriplett Aug 22, 2018
b188c2a
Lament the invincibility of the Turbofish
varkor Aug 21, 2018
ede1f7d
use String::new() instead of String::from(""), "".to_string(), "".to_…
matthiaskrgr Aug 23, 2018
85a05d1
Light restructuring.
FelixMcFelix Aug 23, 2018
9e0ff24
Prefer `.nth(n)` over `.skip(n).next()`.
frewsxcv Aug 23, 2018
e7709b3
Discourage overuse of mem::forget
kornelski Aug 19, 2018
747722e
fix testcase
Dylan-DPC Aug 23, 2018
2cc2e01
Add missing fmt examples
GuillaumeGomez Aug 22, 2018
25a83e3
Use SmallVec for SmallCStr
llogiq Aug 23, 2018
ab5a71b
Rollup merge of #53311 - RalfJung:windows-mutex, r=retep998
kennytm Aug 24, 2018
973428d
Rollup merge of #53503 - kornelski:master, r=dtolnay
kennytm Aug 24, 2018
7f396ba
Rollup merge of #53559 - Dylan-DPC:fix/missing-doc-lint, r=kennytm
kennytm Aug 24, 2018
714e5b3
Rollup merge of #53562 - varkor:bastion-of-the-turbofish, r=nagisa
kennytm Aug 24, 2018
d13c612
Rollup merge of #53563 - matthiaskrgr:String, r=varkor
kennytm Aug 24, 2018
b24a30e
Remove unnecessary closure in rustc_mir/build/mod.rs
IsaacWoods Aug 24, 2018
c802be6
Added rustc_codegen_llvm to compiler documentation.
davidtwco Aug 24, 2018
c51903c
Rollup merge of #53592 - matthiaskrgr:str_doc, r=alexcrichton
kennytm Aug 24, 2018
3fbd72e
Rollup merge of #53594 - rust-lang:Aaronepower-patch-1, r=Mark-Simula…
kennytm Aug 24, 2018
7d990fa
Rollup merge of #53600 - varkor:expected-generic-arg-s, r=eddyb
kennytm Aug 24, 2018
ff4500c
Rollup merge of #53614 - RalfJung:nomicon, r=kennytm
kennytm Aug 24, 2018
cf90fd0
Rollup merge of #53617 - joshtriplett:tidy-no-license-header, r=Mark-…
kennytm Aug 24, 2018
a37b69d
Rollup merge of #53618 - GuillaumeGomez:fmt-examples, r=QuietMisdreavus
kennytm Aug 24, 2018
9dfb95b
Rollup merge of #53636 - frewsxcv:frewsxcv-nth, r=rkruppe
kennytm Aug 24, 2018
0009fad
Rollup merge of #53644 - llogiq:smallvec-for-small-c-str, r=estebank
kennytm Aug 24, 2018
62f29c4
Rollup merge of #53664 - IsaacWoods:fix_53608, r=oli-obk
kennytm Aug 24, 2018
a1ec2f7
Rollup merge of #53545 - FelixMcFelix:fix-50865-beta, r=petrochenkov
kennytm Aug 24, 2018
c6039de
Rollup merge of #53666 - davidtwco:issue-51737, r=Mark-Simulacrum
kennytm Aug 24, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tidy: Stop requiring a license header
Previously approved in #43498 ; update tidy to match.
  • Loading branch information
joshtriplett committed Aug 22, 2018
commit a15b61780b24a2311a3e42a3437b3418921a3ed3
53 changes: 0 additions & 53 deletions src/tools/tidy/src/style.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//! * No trailing whitespace
//! * No CR characters
//! * No `TODO` or `XXX` directives
//! * A valid license header is at the top
//! * No unexplained ` ```ignore ` or ` ```rust,ignore ` doc tests
//!
//! A number of these checks can be opted-out of with various directives like
Expand All @@ -28,16 +27,6 @@ use std::io::prelude::*;
use std::path::Path;

const COLS: usize = 100;
const LICENSE: &'static str = "\
Copyright <year> The Rust Project Developers. See the COPYRIGHT
file at the top-level directory of this distribution and at
http://rust-lang.org/COPYRIGHT.

Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
<LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
option. This file may not be copied, modified, or distributed
except according to those terms.";

const UNEXPLAINED_IGNORE_DOCTEST_INFO: &str = r#"unexplained "```ignore" doctest; try one:

Expand Down Expand Up @@ -168,52 +157,10 @@ pub fn check(path: &Path, bad: &mut bool) {
trailing_new_lines = 0;
}
}
if !licenseck(file, &contents) {
tidy_error!(bad, "{}: incorrect license", file.display());
}
match trailing_new_lines {
0 => tidy_error!(bad, "{}: missing trailing newline", file.display()),
1 | 2 => {}
n => tidy_error!(bad, "{}: too many trailing newlines ({})", file.display(), n),
};
})
}

fn licenseck(file: &Path, contents: &str) -> bool {
if contents.contains("ignore-license") {
return true
}
let exceptions = [
"libstd/sync/mpsc/mpsc_queue.rs",
"libstd/sync/mpsc/spsc_queue.rs",
];
if exceptions.iter().any(|f| file.ends_with(f)) {
return true
}

// Skip the BOM if it's there
let bom = "\u{feff}";
let contents = if contents.starts_with(bom) {&contents[3..]} else {contents};

// See if the license shows up in the first 100 lines
let lines = contents.lines().take(100).collect::<Vec<_>>();
lines.windows(LICENSE.lines().count()).any(|window| {
let offset = if window.iter().all(|w| w.starts_with("//")) {
2
} else if window.iter().all(|w| w.starts_with('#')) {
1
} else if window.iter().all(|w| w.starts_with(" *")) {
2
} else {
return false
};
window.iter().map(|a| a[offset..].trim())
.zip(LICENSE.lines()).all(|(a, b)| {
a == b || match b.find("<year>") {
Some(i) => a.starts_with(&b[..i]) && a.ends_with(&b[i+6..]),
None => false,
}
})
})

}