about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2020-12-11update MiriRalf Jung-10/+8
2020-12-10Rollup merge of #79809 - Eric-Arellano:split-once, r=matkladTyler Mandry-61/+80
Dogfood `str_split_once()` Part of https://github.com/rust-lang/rust/issues/74773. Beyond increased clarity, this fixes some instances of a common confusion with how `splitn(2)` behaves: the first element will always be `Some()`, regardless of the delimiter, and even if the value is empty. Given this code: ```rust fn main() { let val = "..."; let mut iter = val.splitn(2, '='); println!("Input: {:?}, first: {:?}, second: {:?}", val, iter.next(), iter.next()); } ``` We get: ``` Input: "no_delimiter", first: Some("no_delimiter"), second: None Input: "k=v", first: Some("k"), second: Some("v") Input: "=", first: Some(""), second: Some("") ``` Using `str_split_once()` makes more clear what happens when the delimiter is not found.
2020-12-09Enable ASan, TSan, UBSan for aarch64-apple-darwin.Corey Farwell-2/+8
2020-12-09Rollup merge of #79803 - jyn514:xsv, r=Mark-SimulacrumTyler Mandry-1/+1
Update xsv to prevent random CI failures This fixes occasional proptest failures due to a bug in xsv, which aren't related to bugs in the rust compiler. See https://github.com/rust-lang/rust/pull/79751#issuecomment-740027046 for context.
2020-12-09Rollup merge of #79750 - camelid:fix-lint-docs-trimming, r=Mark-SimulacrumTyler Mandry-2/+2
Fix trimming of lint docs Fixes #79748. It was removing all the indentation before. r? `@Mark-Simulacrum`
2020-12-08Review feedbackEric Arellano-4/+13
* Use a match statement. * Clarify why we can't use `file_stem()`. * Error if the `:` is missing for Tidy error codes, rather than no-oping.
2020-12-07Update cargoEric Huss-0/+0
2020-12-07Dogfood 'str_split_once() with linkcheckerEric Arellano-5/+8
2020-12-07Dogfood 'str_split_once() with TidyEric Arellano-56/+63
2020-12-07Update xsv to prevent random CI failuresJoshua Nelson-1/+1
This fixes occasional proptest failures due to a bug in xsv, which aren't related to bugs in the rust compiler.
2020-12-06Fix trimming of lint docsCamelid-2/+2
It was removing all the indentation before. Co-authored-by: Eric Huss <eric@huss.org>
2020-12-06Retain assembly operands span when lowering AST to HIRTomasz Miąsko-3/+3
2020-12-06Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyupflip1995-576/+4334
2020-12-06Handle `Guard::IfLet` in clippyLeSeulArtichaut-1/+24
2020-12-06Implement lowering of if-let guards to MIRLeSeulArtichaut-0/+1
2020-12-06Auto merge of #79737 - Xanewok:update-rls, r=calebcartwrightbors-5/+6
Update RLS and Rustfmt Fixes #79406 Fixes #79407 This does pull 1.4.28 version of Rustfmt. Do you want me to pull the 1.4.29 while we're at it? r? `@calebcartwright`
2020-12-06Bump Rustfmt to 1.4.29Igor Matuszewski-5/+5
2020-12-05Auto merge of #79719 - JohnTitor:nomicon, r=Mark-Simulacrumbors-1/+1
Ping me when nomicon's toolstate is broken So that I can notice the breakage easily.
2020-12-05Add libc to rustc-workspace-hackIgor Matuszewski-0/+1
2020-12-05Update RLS and RustfmtIgor Matuszewski-5/+5
2020-12-05fix clippy testVishnunarayan K I-3/+2
2020-12-05update MiriRalf Jung-16/+10
2020-12-05Ping me when nomicon's toolstate is brokenYuki Okushi-1/+1
2020-12-04Auto merge of #79686 - Dylan-DPC:rollup-leama5f, r=Dylan-DPCbors-0/+0
Rollup of 11 pull requests Successful merges: - #77686 (Render Markdown in search results) - #79541 (Doc keyword lint pass) - #79602 (Fix SGX CI) - #79611 (Use more std:: instead of core:: in docs for consistency) - #79623 (Pass around Symbols instead of Idents in doctree) - #79627 (Update cargo) - #79631 (disable a ptr equality test on Miri) - #79638 (Use `item_name` instead of pretty printing for resolving `Self` on intra-doc links) - #79646 (rustc_metadata: Remove some dead code) - #79664 (move interpret::MemoryKind::Heap to const eval) - #79678 (Fix some clippy lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2020-12-04Rollup merge of #79627 - ehuss:update-cargo, r=ehussDylan DPC-0/+0
Update cargo 12 commits in bfca1cd22bf514d5f2b6c1089b0ded0ba7dfaa6e..63d0fe43449adcb316d34d98a982b597faca4178 2020-11-24 16:33:21 +0000 to 2020-12-02 01:44:30 +0000 - Add "--workspace" to update command (rust-lang/cargo#8725) - Add an FAQ for "Why is my crate rebuilt?" (rust-lang/cargo#8927) - Set docs.rs as the default extern-map for crates.io (rust-lang/cargo#8877) - remove extra whitespace when running cargo -Z help (rust-lang/cargo#8924) - Remove version from dev-dependencies to make it easier to publish. (rust-lang/cargo#8920) - update dependency queue to consider cost for each node (rust-lang/cargo#8908) - Fix some rustdoc warnings. (rust-lang/cargo#8911) - Bump miow dependency to not invalidly assume memory layout (rust-lang/cargo#8909) - Remove unnecessary trailing semicolons (rust-lang/cargo#8906) - Fix custom_target_dependency test. (rust-lang/cargo#8907) - fix: we don't ignore `version` for `git`/`path` deps now (rust-lang/cargo#8900) - doc (book): add "Getting Started" subsection: "Essential Terminology" (rust-lang/cargo#8855)
2020-12-03Coverage tests for remaining TerminatorKinds and async, improve AssertRich Kadel-2/+0
Tested and validate results for panic unwind, panic abort, assert!() macro, TerminatorKind::Assert (for example, numeric overflow), and async/await. Implemented a previous documented idea to change Assert handling to be the same as FalseUnwind and Goto, so it doesn't get its own BasicCoverageBlock anymore. This changed a couple of coverage regions, but I validated those changes are not any worse than the prior results, and probably help assure some consistency (even if some people might disagree with how the code region is consistently computed). Fixed issue with async/await. AggregateKind::Generator needs to be handled like AggregateKind::Closure; coverage span for the outer async function should not "cover" the async body, which is actually executed in a separate "closure" MIR.
2020-12-01Update cargoEric Huss-0/+0
2020-12-01Address review comments.Nixon Enraght-Moony-7/+7
Go back to CRATE_DEF_INDEX Minor niceness improvements Don't output hidden items Remove striped items from fields Add $TEST_BASE_DIR Small catch
2020-12-01Add tests for rustdoc jsonNixon Enraght-Moony-10/+62
Move rustdoc/rustdoc-json to rustdoc-json Scaffold rustdoc-json test mode Implement run_rustdoc_json_test Fix up python Make tidy happy
2020-12-01Rollup merge of #79568 - RalfJung:miri, r=RalfJungMara Bos-8/+16
update Miri This update includes https://github.com/rust-lang/miri/pull/1617, the data race detector by ``@JCTyblaidd.`` :) Cc ``@rust-lang/miri`` r? ``@ghost``
2020-12-01Rollup merge of #79522 - ehuss:lint-check-validate, r=Mark-SimulacrumMara Bos-470/+522
Validate lint docs separately. This addresses some concerns raised in https://github.com/rust-lang/rust/pull/76549#issuecomment-727638552 about errors with the lint docs being confusing and cumbersome. Errors from validating the lint documentation were being generated during `x.py doc` (and `x.py dist`), since extraction and validation are being done in a single step. This changes it so that extraction and validation are separated, so that `x.py doc` will not error if there is a validation problem, and tests are moved to `x.py test src/tools/lint-docs`. This includes the following changes: * Separate validation to `x.py test`. * Added some more documentation on how to more easily modify and test the docs. * Added more help to the error messages to hopefully provide more information on how to fix things. The first commit just moves the code around, so you may consider looking at the other commits for a smaller diff.
2020-11-30update MiriRalf Jung-8/+16
2020-11-30Auto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwcobors-2/+2
Update error to reflect that integer literals can have float suffixes For example, `1` is parsed as an integer literal, but it can be turned into a float with the suffix `f32`. Now the error calls them "numeric literals" and notes that you can add a float suffix since they can be either integers or floats.
2020-11-29lint-docs: Use strip-prefix to simplify.Eric Huss-4/+3
2020-11-29lint-docs: Add some extra detail to the error message.Eric Huss-0/+13
This will hopefully help users figure out what was wrong and how to fix it.
2020-11-29Auto merge of #78380 - bstrie:rm-old-num-const-from-tests, r=jyn514bors-1/+1
Update tests to remove old numeric constants Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-29Update tests to remove old numeric constantsbstrie-1/+1
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-29Rollup merge of #79443 - GuillaumeGomez:improve-rustdoc-js-error-output, ↵Dylan DPC-0/+31
r=jyn514 Improve rustdoc JS tests error output It's pretty common when starting to add new tests for rustdoc-js to have issues to understand the errors. With this, it should make things a bit simpler. So now, in case of an error, it displays: ``` ---- [js-doc-test] rustdoc-js/basic.rs stdout ---- error: rustdoc-js test failed! failed to decode compiler output as json: line: { output: Checking "basic" ... FAILED ==> Result not found in 'others': '{"path":"basic","name":"Fo"}' Diff of first error: { "path": "basic", - "name": "Fo", + "name": "Foo", } thread '[js-doc-test] rustdoc-js/basic.rs' panicked at 'explicit panic', src/tools/compiletest/src/json.rs:126:21 ``` I think it was ``@camelid`` who asked about it a few days ago? r? ``@jyn514``
2020-11-28lint-docs: Add --validate flag to validate lint docs separately.Eric Huss-18/+57
2020-11-28lint-docs: Move free functions into methods of LintExtractor.Eric Huss-469/+470
This helps avoid needing to pass so many parameters around.
2020-11-27Update error to reflect that integer literals can have float suffixesCamelid-2/+2
For example, `1` is parsed as an integer literal, but it can be turned into a float with the suffix `f32`. Now the error calls them "numeric literals" and notes that you can add a float suffix since they can be either integers or floats.
2020-11-27Auto merge of #79318 - cjgillot:fitem, r=lcnrbors-3/+3
Store HIR ForeignItem in a side table In a similar fashion to Item, ImplItem and TraitItem.
2020-11-26Improve rustdoc JS tests error outputGuillaume Gomez-0/+31
2020-11-26Remove ForeignMod struct.Camille GILLOT-3/+3
2020-11-26Auto merge of #77671 - flip1995:lint_list_always_plugins, r=oli-obk,Manishearthbors-3104/+1
Always print lints from plugins, if they're available Currently you can get a list of lints and lint groups by running `rustc -Whelp`. This prints an additional line at the end: ``` Compiler plugins can provide additional lints and lint groups. To see a listing of these, re-run `rustc -W help` with a crate filename. ``` Clippy is such a "compiler plugin", that provides additional lints. Running `clippy-driver -Whelp` (`rustc` wrapper) still only prints the rustc lints with the above message at the end. But when running `clippy-driver -Whelp main.rs`, where `main.rs` is any rust file, it also prints Clippy lints. I don't think this is a good approach from a UX perspective: Why is a random file necessary to print a help message? This PR changes this behavior: Whenever a compiler callback registers lints, it is assumed that these lints come from a plugin and are printed without having to specify a Rust source file. Fixes rust-lang/rust-clippy#6122 cc `@Manishearth` `@ebroto` for the Clippy changes.
2020-11-24Move lev_distance to rustc_ast, make non-genericArlie Davis-2/+2
rustc_ast currently has a few dependencies on rustc_lexer. Ideally, an AST would not have any dependency its lexer, for minimizing unnecessarily design-time dependencies. Breaking this dependency would also have practical benefits, since modifying rustc_lexer would not trigger a rebuild of rustc_ast. This commit does not remove the rustc_ast --> rustc_lexer dependency, but it does remove one of the sources of this dependency, which is the code that handles fuzzy matching between symbol names for making suggestions in diagnostics. Since that code depends only on Symbol, it is easy to move it to rustc_span. It might even be best to move it to a separate crate, since other tools such as Cargo use the same algorithm, and have simply contain a duplicate of the code. This changes the signature of find_best_match_for_name so that it is no longer generic over its input. I checked the optimized binaries, and this function was duplicated at nearly every call site, because most call sites used short-lived iterator chains, generic over Map and such. But there's no good reason for a function like this to be generic, since all it does is immediately convert the generic input (the Iterator impl) to a concrete Vec<Symbol>. This has all of the costs of generics (duplicated method bodies) with no benefit. Changing find_best_match_for_name to be non-generic removed about 10KB of code from the optimized binary. I know it's a drop in the bucket, but we have to start reducing binary size, and beginning to tame over-use of generics is part of that.
2020-11-24Update cargoEric Huss-0/+0
2020-11-24clippy: Remove now obsolete lintlist moduleflip1995-2983/+1
Also stop updating the lintlist module in clippy_dev update_lints
2020-11-24clippy: Let rustc handle describing lintsflip1995-121/+0
2020-11-24Auto merge of #79228 - flip1995:clippyup, r=oli-obkbors-876/+3112
Update Clippy Biweekly Clippy update r? `@Manishearth`