about summary refs log tree commit diff
path: root/src/test/ui/rust-2018
AgeCommit message (Collapse)AuthorLines
2018-11-18resolve: Check resolution consistency for import paths and multi-segment ↵Vadim Petrochenkov-54/+130
macro paths
2018-11-18resolve: Resolve single-segment imports using in-scope resolution on 2018 ↵Vadim Petrochenkov-0/+12
edition
2018-11-18resolve: Improve diagnostics for resolution ambiguitiesVadim Petrochenkov-72/+116
2018-10-28Add note linking to Rust 2018 path semantics docs.David Wood-0/+2
This commit extends existing path suggestions to link to documentation on the changed semantics of `use` in Rust 2018.
2018-10-23fix typos in various placesMatthias Krüger-2/+2
2018-10-20pick a reference issue for absolute-paths future incompatibility infoZack M. Davis-16/+16
It would be kind of embarrassing to ship with the "issue TBD" message!
2018-10-13resolve: Scale back hard-coded extern prelude additionsVadim Petrochenkov-1/+1
2018-10-03Update tests to demonstrate 2015 behaviour.David Wood-4/+49
Adds a test to demonstrate behaviour of suggestions in the 2015 edition.
2018-10-03Add suggestions for unresolved imports.David Wood-1/+68
This commit adds suggestions for unresolved imports in the cases where there could be a missing `crate::`, `super::`, `self::` or a missing external crate name before an import.
2018-10-02Add `crate::` to trait suggestions in Rust 2018.David Wood-0/+99
In the 2018 edition, when suggesting traits to import that implement a given method that is being invoked, suggestions will now include the `crate::` prefix if the suggested trait is local to the current crate.
2018-10-01Rollup merge of #54488 - zackmdavis:and_the_case_of_the_unused_crate, r=estebankkennytm-0/+67
in which we include attributes in unused `extern crate` suggestion spans ![unused_extern](https://user-images.githubusercontent.com/1076988/45921698-50243e80-be6f-11e8-930a-7b2a33b4935c.png) Resolves #54400. r? @estebank
2018-09-30Auto merge of #54650 - eddyb:no-extern's-land, r=alexcrichtonbors-4/+16
Don't lint non-extern-prelude extern crate's in Rust 2018. Fixes #54381 by silencing the lint telling users to remove `extern crate` when `use` doesn't work. r? @alexcrichton cc @petrochenkov @nikomatsakis @Centril
2018-09-28rustc_typeck: don't lint non-extern-prelude extern crate's in Rust 2018.Eduard-Mihai Burtescu-4/+16
2018-09-27in which inferable outlives-requirements are lintedZack M. Davis-0/+855
RFC 2093 (tracking issue #44493) lets us leave off commonsensically inferable `T: 'a` outlives requirements. (A separate feature-gate was split off for the case of 'static lifetimes, for which questions still remain.) Detecting these was requested as an idioms-2018 lint. It turns out that issuing a correct, autofixable suggestion here is somewhat subtle in the presence of other bounds and generic parameters. Basically, we want to handle these three cases: • One outlives-bound. We want to drop the bound altogether, including the colon— MyStruct<'a, T: 'a> ^^^^ help: remove this bound • An outlives bound first, followed by a trait bound. We want to delete the outlives bound and the following plus sign (and hopefully get the whitespace right, too)— MyStruct<'a, T: 'a + MyTrait> ^^^^^ help: remove this bound • An outlives bound after a trait bound. We want to delete the outlives lifetime and the preceding plus sign— MyStruct<'a, T: MyTrait + 'a> ^^^^^ help: remove this bound This gets (slightly) even more complicated in the case of where clauses, where we want to drop the where clause altogether if there's just the one bound. Hopefully the comments are enough to explain what's going on! A script (in Python, sorry) was used to generate the hopefully-sufficiently-exhaustive UI test input. Some of these are split off into a different file because rust-lang-nursery/rustfix#141 (and, causally upstream of that, #53934) prevents them from being `run-rustfix`-tested. We also make sure to include a UI test of a case (copied from RFC 2093) where the outlives-bound can't be inferred. Special thanks to Niko Matsakis for pointing out the `inferred_outlives_of` query, rather than blindly stripping outlives requirements as if we weren't a production compiler and didn't care. This concerns #52042.
2018-09-22in which we include attributes in unused `extern crate` suggestion spansZack M. Davis-0/+67
Resolves #54400.
2018-09-22Rollup merge of #54261 - varkor:dyn-keyword-2018, r=petrochenkovPietro Albini-0/+58
Make `dyn` a keyword in the 2018 edition Proposed in https://github.com/rust-lang/rust/issues/44662#issuecomment-421596088.
2018-09-16Treat `dyn` as a keyword in the 2018 editionvarkor-0/+58
2018-09-15rustc_resolve: use `continue` instead of `return` to "exit" a loop iteration.Eduard-Mihai Burtescu-0/+74
2018-09-15rustc_resolve: always include core, std and meta in the extern prelude.Eduard-Mihai Burtescu-2/+2
2018-09-15rustc_resolve: don't allow `::crate_name` to bypass `extern_prelude`.Eduard-Mihai Burtescu-7/+53
2018-09-11we now successfully warn about `async` in macro invocationsNiko Matsakis-13/+26
2018-09-10add test caseNiko Matsakis-0/+47
2018-09-10rustc_resolve: ignore uniform_paths canaries that resolve to an import of ↵Eduard-Mihai Burtescu-0/+62
the same crate.
2018-09-10rustc_resolve: inject `uniform_paths` canaries regardless of the ↵Eduard-Mihai Burtescu-0/+216
feature-gate, on Rust 2018.
2018-09-09Remove crate_visibility_modifier from 2018 editionMark Rousskov-6/+6
2018-09-06rustc_resolve: allow `use crate_name;` under `uniform_paths`.Eduard-Mihai Burtescu-31/+0
2018-08-29Generalize `async_idents` to all new keywordsAlex Crichton-5/+71
This commit generalizes the existing `async_idents` lint to easily encompass other identifiers that will be keywords in future editions. The new lint is called `keyword_idents` and the old `async_idents` lint is registered as renamed to this new lint. As a proof of concept the `try` keyword was added to this list as it looks to be listed as a keyword in the 2018 edition only. The `await` keyword was not added as it's not listed as a keyword yet. Closes #53077
2018-08-27rustc: Suggest removing `extern crate` in 2018Alex Crichton-0/+122
This commit updates the `unused_extern_crates` lint to make automatic suggestions about removing `extern crate` annotations in the 2018 edition. This ended up being a little easier than originally though due to what's likely been fixed issues in the resolver! Closes #52829
2018-08-21Auto merge of #53530 - kennytm:rollup, r=kennytmbors-1/+1
Rollup of 17 pull requests Successful merges: - #53030 (Updated RELEASES.md for 1.29.0) - #53104 (expand the documentation on the `Unpin` trait) - #53213 (Stabilize IP associated constants) - #53296 (When closure with no arguments was expected, suggest wrapping) - #53329 (Replace usages of ptr::offset with ptr::{add,sub}.) - #53363 (add individual docs to `core::num::NonZero*`) - #53370 (Stabilize macro_vis_matcher) - #53393 (Mark libserialize functions as inline) - #53405 (restore the page title after escaping out of a search) - #53452 (Change target triple used to check for lldb in build-manifest) - #53462 (Document Box::into_raw returns non-null ptr) - #53465 (Remove LinkMeta struct) - #53492 (update lld submodule to include RISCV patch) - #53496 (Fix typos found by codespell.) - #53521 (syntax: Optimize some literal parsing) - #53540 (Moved issue-53157.rs into src/test/ui/consts/const-eval/) - #53551 (Avoid some Place clones.) Failed merges: r? @ghost
2018-08-20Removed `raw_identifiers` feature gate.Alexander Regueiro-18/+16
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-17Auto merge of #50911 - petrochenkov:macuse, r=alexcrichtonbors-3/+2
Stabilize `use_extern_macros` Closes https://github.com/rust-lang/rust/issues/35896
2018-08-17Rollup merge of #53413 - eddyb:featured-in-the-latest-edition, r=varkorCorey Farwell-9/+7
Warn that `#![feature(rust_2018_preview)]` is implied when the edition is set to Rust 2018. cc @varkor @petrochenkov @joshtriplett
2018-08-17Stabilize `use_extern_macros`Vadim Petrochenkov-3/+2
2018-08-17rustc_resolve: don't allow paths starting with `::crate`.Eduard-Mihai Burtescu-2/+2
2018-08-17rustc_resolve: overhaul `#![feature(uniform_paths)]` error reporting.Eduard-Mihai Burtescu-21/+92
2018-08-16tests: prefer edition: directives to compile-flags:--edition.Eduard-Mihai Burtescu-4/+4
2018-08-16syntax: also warn about edition "umbrella" features being implied by --edition.Eduard-Mihai Burtescu-5/+3
2018-08-14rustc_resolve: also inject canaries to detect block scopes shadowing ↵Eduard-Mihai Burtescu-0/+36
`uniform_paths` imports.
2018-08-14rustc_resolve: inject ambiguity "canaries" when #![feature(uniform_paths)] ↵Eduard-Mihai Burtescu-0/+172
is enabled.
2018-08-01rustc: Trim down the `rust_2018_idioms` lint groupAlex Crichton-7/+6
These migration lints aren't all up to par in terms of a good migration experience. Some, like `unreachable_pub`, hit bugs like #52665 and unprepared macros to be handled enough of the time. Others like linting against `#[macro_use]` are swimming upstream in an ecosystem that's not quite ready (and slightly buggy pending a few current PRs). The general idea is that we will continue to recommend the `rust_2018_idioms` lint group as part of the transition guide (as an optional step) but we'll be much more selective about which lints make it into this group. Only those with a strong track record of not causing too much churn will make the cut. cc #52679
2018-07-26Tweak the raw_identifiers lints in 2018Alex Crichton-0/+38
* Enable the `raw_identifiers` feature automatically in the 2018 preview * Only emit lint warnings if the `raw_identifiers` feature is activated cc rust-lang/cargo#5783
2018-07-18Auto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearthbors-0/+309
Lint `async` identifiers in 2018 preparation mode r? @Manishearth fixes https://github.com/rust-lang/rust/issues/49716
2018-07-18Make `async_idents` allow-by-defaultOliver Schneider-17/+23
2018-07-17Make `async_idents` an edition incompat lintOliver Schneider-15/+227
2018-07-14Lint the use of async as an identifierOliver Schneider-0/+91
2018-07-12rustc: Lint against `#[macro_use]` in 2018 idiomsAlex Crichton-0/+73
This commit adds a lint to the compiler to warn against the `#[macro_use]` directive as part of the `rust_2018_idioms` lint. This lint is turned off by default and is only enabled when the `use_extern_macros` feature is also enabled. The lint here isn't fully fleshed out as it's just a simple warning rather than suggestions of how to actually import the macro, but hopefully it's a good base to start from! cc #52043
2018-07-09in which `use` suggestions meet edition 2018Zack M. Davis-0/+43
The intent here is to resolve #52202.
2018-06-01merge UNNECESSARY_EXTERN_CRATE and UNUSED_EXTERN_CRATESNiko Matsakis-10/+17
2018-06-01extend `unused_extern_crates` lint with a suggestion to removeNiko Matsakis-0/+86