about summary refs log tree commit diff
path: root/src/librustc_errors
AgeCommit message (Collapse)AuthorLines
2018-10-29Rename other occs of (Code/File)Map to Source(Map/File) #51574David Lavati-29/+29
2018-10-20Auto merge of #55014 - ljedrz:lazyboye_unwraps, r=matthewjasperbors-1/+1
Prefer unwrap_or_else to unwrap_or in case of function calls/allocations The contents of `unwrap_or` are evaluated eagerly, so it's not a good pick in case of function calls and allocations. This PR also changes a few `unwrap_or`s with `unwrap_or_default`. An added bonus is that in some cases this change also reveals if the object it's called on is an `Option` or a `Result` (based on whether the closure takes an argument).
2018-10-19Free some memory instead of just dropping elementsOliver Scherer-1/+2
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-4/+4
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-4/+4
2018-10-19Prefer unwrap_or_else to unwrap_or in case of function calls/allocationsljedrz-1/+1
2018-10-10A handful of random string-related improvementsljedrz-4/+4
2018-09-27Bump to 1.31.0 and bootstrap from 1.30 betaJosh Stone-1/+1
2018-09-20Auto merge of #54241 - vi:suggest_with_applicability, r=estebankbors-23/+72
Remove usages of span_suggestion without Applicability Use `Applicability::Unspecified` for all of them instead. Shall deprecations for the non-`_with_applicability` functions be added? Shall clippy be addressed somehow? r? @estebank
2018-09-18Log when buffering a diagnostic.David Wood-0/+6
This is useful in debugging when and where errors are emitted in logs.
2018-09-17Whitespace fix again.Vitaly _Vi Shukela-3/+3
2018-09-17Better trick for allowing trailing comma at forward!Vitaly _Vi Shukela-10/+13
2018-09-17Add -Z dont-buffer-diagnostics, a way to force NLL to immediately emit its ↵Felix S. Klock II-2/+23
diagnostics. This is mainly intended for `rustc` developers who want to see a diagnostic in its original context in the control flow. Two uses cases for that are: * `-Z treat-err-as-bug` which then allows extraction of a stack-trace to the origin of the error (a case that is so important that we make that flag imply this one, effectively). * `RUST_LOG=... rustc`, in which case it is often useful to see the logging statements that occurred immediately prior to the point where the diagnostic was signalled. Drive-by: Added some documentation pointing future devs at HandlerFlags, and documented the fields of `HandlerFlags` itself.
2018-09-17Change diagnostic_builder's forward! macro to enforce trailing argument commaVitaly _Vi Shukela-27/+27
2018-09-17Fix style according to review comments.Vitaly _Vi Shukela-7/+8
2018-09-16trailing whitespace fixVitaly _Vi Shukela-1/+1
2018-09-16Deprecate *_suggestion* that are without explicit applicabilityVitaly _Vi Shukela-0/+15
2018-09-16Add multipart_suggestion_with_applicabilityVitaly _Vi Shukela-2/+32
2018-09-14Rollup merge of #54024 - alexcrichton:compile-to-wasm, r=petrochenkovkennytm-1/+1
Fix compiling some rustc crates to wasm I was dabbling recently seeing what it would take to compile `rustfmt` to the `wasm32-unknown-unknown` target and it turns out not much effort is needed! Currently `rustfmt` depends on a few rustc crates published to crates.io, so this commit touches up those crates to compile for wasm themselves. Notably: * The `rustc_data_structures` crate's `flock` implementation is stubbed out to unconditionally return errors on unsupported platforms. * The `rustc_errors` crate is extended to not do any locking for all non-windows platforms. In both of these cases if we port the compiler to new platforms the functionality isn't critical but will be discovered over time as it comes up, so this hopefully doesn't make it too too hard to compile to new platforms!
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-1/+0
Co-authored-by: nikomatsakis
2018-09-07Fix compiling some rustc crates to wasmAlex Crichton-1/+1
I was dabbling recently seeing what it would take to compile `rustfmt` to the `wasm32-unknown-unknown` target and it turns out not much effort is needed! Currently `rustfmt` depends on a few rustc crates published to crates.io, so this commit touches up those crates to compile for wasm themselves. Notably: * The `rustc_data_structures` crate's `flock` implementation is stubbed out to unconditionally return errors on unsupported platforms. * The `rustc_errors` crate is extended to not do any locking for all non-windows platforms. In both of these cases if we port the compiler to new platforms the functionality isn't critical but will be discovered over time as it comes up, so this hopefully doesn't make it too too hard to compile to new platforms!
2018-09-04Breaking change upgradesMark Rousskov-1/+2
2018-08-30Rollup merge of #53786 - frewsxcv:frewsxcv-bad-style, r=ManishearthPietro Albini-1/+1
Replace usages of 'bad_style' with 'nonstandard_style'. `bad_style` is being deprecated in favor of `nonstandard_style`: - https://github.com/rust-lang/rust/issues/41646
2018-08-29Replace usages of 'bad_style' with 'nonstandard_style'.Corey Farwell-1/+1
`bad_style` is being deprecated in favor of `nonstandard_style`: - https://github.com/rust-lang/rust/issues/41646
2018-08-28Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.Eduard-Mihai Burtescu-5/+5
2018-08-27Auto merge of #53441 - toidiu:ak-fix53419, r=nikomatsakisbors-0/+1
fix for late-bound regions Fix for https://github.com/rust-lang/rust/issues/53419 r? @nikomatsakis
2018-08-24check that adding infer-outlives requirement to all crates worksNiko Matsakis-0/+1
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-3/+3
or "".into()
2018-08-19fix tidy errorsDonato Sciarra-1/+8
2018-08-19mv filemap source_fileDonato Sciarra-2/+2
2018-08-19mv FileMap SourceFileDonato Sciarra-6/+6
2018-08-19mv CodeMap SourceMapDonato Sciarra-9/+9
2018-08-10Rollup merge of #53214 - memoryruins:nll_bootstrap_2, r=nikomatsakiskennytm-0/+1
[nll] enable feature(nll) on various crates for bootstrap: part 2 #53172
2018-08-09[nll] librustc_errors: enable feature(nll) for bootstrapmemoryruins-0/+1
2018-08-07Avoid unnecessary pattern matching against Option and Resultljedrz-1/+1
2018-07-30rustc: Disallow machine applicability in foreign macrosAlex Crichton-19/+64
Recent changes to lints disallowed lints from being emitted against code located in foreign macros, except for future-incompatible lints. For a future incompatible lint, however, the automatic suggestions may not be applicable! This commit updates this code path to force all applicability suggestions made to foreign macros to never be `MachineApplicable`. This should avoid rustfix actually attempting fixing these suggestions, causing non-compiling code to be produced. Closes rust-lang/cargo#5799
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-9/+4
Misc cleanups
2018-07-28Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakiskennytm-5/+5
Use a slice where a vector is not necessary
2018-07-27Auto merge of #52336 - ishitatsuyuki:dyn-rollup, r=Mark-Simulacrumbors-2/+0
Rollup of bare_trait_objects PRs All deny attributes were moved into bootstrap so they can be disabled with a line of config. Warnings for external tools are allowed and it's up to the tool's maintainer to keep it warnings free. r? @Mark-Simulacrum cc @ljedrz @kennytm
2018-07-27Use slices where a vector is not necessaryljedrz-5/+5
2018-07-27Remove unnecessary `.collect()`Shotaro Yamada-6/+3
2018-07-27Use str::repeatShotaro Yamada-3/+1
2018-07-27Auto merge of #52681 - pnkfelix:z-borrowck-migrate, r=nikomatsakisbors-19/+19
Add `-Z borrowck=migrate` This adds `-Z borrowck=migrate`, which represents the way we want to migrate to NLL under Rust versions to come. It also hooks this new mode into `--edition 2018`, which means we're officially turning NLL on in the 2018 edition. The basic idea of `-Z borrowck=migrate` that there are cases where NLL is fixing old soundness bugs in the borrow-checker, but in order to avoid just breaking code by immediately rejecting the programs that hit those soundness bugs, we instead use the following strategy: If your code is accepted by NLL, then we accept it. If your code is rejected by both NLL and the old AST-borrowck, then we reject it. If your code is rejected by NLL but accepted by the old AST-borrowck, then we emit the new NLL errors as **warnings**. These warnings will be turned into hard errors in the future, and they say so in these diagnostics. Fix #46908
2018-07-26Add `-Z borrowck=migrate` flag, use it to link NLL up to AST-borrowck.Felix S. Klock II-19/+19
2018-07-25Improve readability in a few sortsljedrz-5/+3
2018-07-25Deny bare_trait_objects globallyTatsuyuki Ishi-2/+0
2018-07-23Buffer errors in MIR borrow checkSantiago Pastorino-0/+12
(pnkfelix updated to address tidy, and to change the buffer from `Vec<DiagnosticBuilder<'errs>>` to a `Vec<Diagnostic>` in order to avoid painful lifetime maintenance.)
2018-07-23Auto merge of #52568 - oli-obk:span_bug_error, r=varkorbors-7/+27
Fix loop label resolution around constants And make `delay_span_bug` a little more helpful r? @varkor fixes #52442 fixes #52443
2018-07-21Auto merge of #51485 - estebank:dehighlight-secondary-msgs, r=GuillaumeGomezbors-4/+11
Remove highlighting from secondary messages Deemphasize the secondary messages so that all other highlights stand out more. <img width="684" alt="" src="https://user-images.githubusercontent.com/1606434/41261199-7b4fe96e-6d8f-11e8-8619-04d170617df2.png">
2018-07-21Sequence-field should have plural nameOliver Schneider-4/+4