summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2018-11-06Bubble up an overflow error so that rustdoc can ignore itOliver Scherer-1/+2
2018-11-06Auto merge of #54199 - nikomatsakis:predicate_may_hold-failure, r=eddybbors-0/+171
overlook overflows in rustdoc trait solving Context: The new rustdoc "auto trait" feature walks across impls and tries to run trait solving on them with a lot of unconstrained variables. This is prone to overflows. These overflows used to cause an ICE because of a caching bug (fixed in this PR). But even once that is fixed, it means that rustdoc causes an overflow rather than generating docs. This PR therefore adds a new helper that propagates the overflow error out. This requires rustdoc to then decide what to do when it encounters such an overflow: technically, an overflow represents neither "yes" nor "no", but rather a failure to make a decision. I've decided to opt on the side of treating this as "yes, implemented", since rustdoc already takes an optimistic view. This may prove to include too many items, but I *suspect* not. We could probably reduce the rate of overflows by unifying more of the parameters from the impl -- right now we only seem to consider the self type. Moreover, in the future, as we transition to Chalk, overflow errors are expected to just "go away" (in some cases, though, queries might return an ambiguous result). Fixes #52873 cc @QuietMisdreavus -- this is the stuff we were talking about earlier cc @GuillaumeGomez -- this supersedes #53687
2018-10-24Destabilize feature non_modrs_modsPietro Albini-0/+155
This reverts commit 7f6b60899502c45fc0b58adf79d09fb77ffc8884.
2018-10-23pick a reference issue for absolute-paths future incompatibility infoZack M. Davis-18/+18
It would be kind of embarrassing to ship with the "issue TBD" message!
2018-10-18resolve: Do not skip extern prelude during speculative resolutionVadim Petrochenkov-1/+21
2018-10-18Update a rustdoc ui test whose output has changedAlex Crichton-2/+2
2018-10-09Auto merge of #54877 - arielb1:destabilize-outlives, r=nikomatsakisbors-733/+634
[beta] back out #53793 - stabilize outlives requirements Fixes #54467 for beta, looks like a less risky fix than #54701
2018-10-08Call Foo::async_method in the async-await testJonas Schievink-14/+1
2018-10-08Fix dead code lint for functions using impl TraitJonas Schievink-1/+95
2018-10-07add test for #54467Ariel Ben-Yehuda-0/+54
2018-10-07Revert "Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakis"Ariel Ben-Yehuda-733/+580
This reverts commit 6810f5286b6b91daab06fc3dccb27d8c46f14349, reversing changes made to 8586ec6980462c99a8926646201b2444d8938d29.
2018-10-04do not normalize non-scalar constants to a ConstValue::ScalarPairRalf Jung-4/+18
2018-10-04resolve: Prefer `macro_rules` definitions to in-module macro definitions in ↵Vadim Petrochenkov-19/+85
some cases
2018-10-03Auto merge of #54358 - flip1995:beta, r=Manishearthbors-102/+0
[beta] Cancel warning for tool_lints For the discussion about this, see: rust-lang-nursery/rust-clippy#3159 `clippy-preview` is available on stable since 1.29. So when running `cargo +beta clippy` on a crate with `#![allow(clippy_lint)]` a warning is produced, which tells the programmer to change this to `#![allow(clippy::clippy_lint)]`. But since `tool_lints` aren't stable yet, this would require a `#![feature(tool_lints)]`. Features aren't available on stable or beta, so we cannot do this. Even wrapping `cfg_attr(clippy)` around this won't help, since Clippy can also be run from stable or beta toolchain. r? @Manishearth
2018-10-02Accept trailing comma in `cfg_attr`Vadim Petrochenkov-0/+27
2018-10-02resolve: Do not block derive helper resolutions on single import resolutionsVadim Petrochenkov-11/+80
Derive helpers conflict currently conflict with anything else, so if some resolution from a single import appears later, it will result in error anyway
2018-10-02Use full name to identify a macro in a `FileName`.Diogo Sousa-8/+8
Before this two macros with same name would be indistinguishable inside a `FileName`. This caused a bug in incremental compilation (see #53097) since two different macros would map out to the same `StableFilemapId`. Fixes #53097.
2018-10-02rustc_typeck: don't lint non-extern-prelude extern crate's in Rust 2018.Eduard-Mihai Burtescu-81/+25
2018-10-01Remove lint_tool testsflip1995-102/+0
2018-09-29Do not put noalias annotations by defaultSimonas Kazlauskas-3/+36
This will be re-enabled sooner or later depending on results of further investigation. Fixes #54462
2018-09-22Ignore new test on WindowsAlex Crichton-0/+1
2018-09-22avoid leaking host details in proc macro metadata decodingAriel Ben-Yehuda-0/+77
proc macro crates are essentially implemented as dynamic libraries using a dlopen-based ABI. They are also Rust crates, so they have 2 worlds - the "host" world in which they are defined, and the "target" world in which they are used. For all the "target" world knows, the proc macro crate might not even be implemented in Rust, so leaks of details from the host to the target must be avoided for correctness. Because the "host" DefId space is different from the "target" DefId space, any leak involving a DefId will have a nonsensical or out-of-bounds DefKey, and will cause all sorts of crashes. This PR fixes all leaks I have found in `decoder`. In particular, #54059 was caused by host native libraries leaking into the target, which feels like it might even be a correctness issue if it doesn't cause an ICE. Fixes #54059
2018-09-21Stabilize crate_in_paths, extern_absolute_paths and extern_prelude on all ↵Eduard-Mihai Burtescu-40/+48
editions.
2018-09-17Auto merge of #54277 - petrochenkov:afterder, r=alexcrichtonbors-4/+68
Temporarily prohibit proc macro attributes placed after derives ... and also proc macro attributes used together with `#[test]`/`#[bench]`. Addresses item 6 from https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393. The end goal is straightforward predictable left-to-right expansion order for attributes. Right now derives are expanded last regardless of their relative ordering with macro attributes and right now it's simpler to temporarily prohibit macro attributes placed after derives than changing the expansion order. I'm not sure whether the new beta is already released or not, but if it's released, then this patch needs to be backported, so the solution needs to be minimal. How to fix broken code (derives): - Move macro attributes above derives. This won't change expansion order, they are expanded before derives anyway. Using attribute macros on same items with `#[test]` and `#[bench]` is prohibited for similar expansion order reasons, but this one is going to be reverted much sooner than restrictions on derives. How to fix broken code (test/bench): - Enable `#![feature(plugin)]` (don't ask why). r? @ghost
2018-09-16resolve: Do not error on access to proc macros imported with `#[macro_use]`Vadim Petrochenkov-2/+2
2018-09-16Temporarily prohibit proc macro attributes placed after derivesVadim Petrochenkov-4/+68
... and also proc macro attributes used together with test/bench.
2018-09-16Auto merge of #54270 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-51/+201
Rollup of 5 pull requests Successful merges: - #53941 (rustdoc: Sort implementors) - #54181 (Suggest && and || instead of 'and' and 'or') - #54209 (Partially revert 674a5db "Fix undesirable fallout [from macro modularization]") - #54213 (De-overlap the lifetimes of `flow_inits` and `flow_{un,ever_}inits`.) - #54244 (Add a small search box to seach Rust's standary library) Failed merges: r? @ghost
2018-09-16Rollup merge of #54209 - petrochenkov:mexpr, r=pnkfelixGuillaume Gomez-51/+51
Partially revert 674a5db "Fix undesirable fallout [from macro modularization]" Partially revert https://github.com/rust-lang/rust/commit/674a5db1a50e25dd60a8ee6669edee9a366c9fab ~~Closes~~ (see pnkfelix comments below) https://github.com/rust-lang/rust/issues/53675
2018-09-16Rollup merge of #54181 - vi:hint_and_or, r=estebankGuillaume Gomez-0/+120
Suggest && and || instead of 'and' and 'or' Resolves #54109. Note: competing pull reqeust: #54179 r? @csmoe
2018-09-16Rollup merge of #53941 - kzys:sort-impls, r=GuillaumeGomezGuillaume Gomez-0/+30
rustdoc: Sort implementors Fixes #53812
2018-09-16Auto merge of #54157 - euclio:structured-suggestion, r=estebankbors-158/+169
use structured suggestion for "missing mut" label Fixes #54133 for both NLL and non-NLL. r? @estebank I'm not super happy with the existing wording here, since it's now a suggestion. I wonder if the message would work better as something like "help: make binding mutable: `mut foo`"? Also, are the `HELP` and `SUGGESTION` comments necessary?
2018-09-16Check the remaining nodesKazuyoshi Kato-0/+4
2018-09-15rustc_resolve: use `continue` instead of `return` to "exit" a loop iteration.Eduard-Mihai Burtescu-1/+75
2018-09-15rustc_resolve: always include core, std and meta in the extern prelude.Eduard-Mihai Burtescu-2/+92
2018-09-15rustc_resolve: don't allow `::crate_name` to bypass `extern_prelude`.Eduard-Mihai Burtescu-47/+105
2018-09-15Auto merge of #52896 - SergioBenitez:master, r=alexcrichtonbors-0/+170
Add inspection and setter methods to proc_macro::Diagnostic. A few useful methods for `proc_macro::Diagnostic`. r? @alexcrichton
2018-09-14Add a test to prevent regressionKazuyoshi Kato-0/+26
The way it defines implementations is unrealistic though.
2018-09-15issue 54109: use short suggestionsVitaly _Vi Shukela-6/+6
2018-09-14Auto merge of #54069 - petrochenkov:subns, r=aturonbors-24/+46
resolve: Introduce two sub-namespaces in macro namespace Two sub-namespaces are introduced in the macro namespace - one for bang macros and one for attribute-like macros (attributes, derives). "Sub-namespace" means this is not a newly introduced full namespace, the single macro namespace is still in place. I.e. you still can't define/import two macros with the same name in a single module, `use` imports still import only one name in macro namespace (from any sub-namespace) and not possibly two. However, when we are searching for a name used in a `!` macro call context (`my_macro!()`) we skip attribute names in scope, and when we are searching for a name used in attribute context (`#[my_macro]`/`#[derive(my_macro)]`) we are skipping bang macro names in scope. In other words, bang macros cannot shadow attribute macros and vice versa. For a non-macro analogy, we could e.g. skip non-traits when searching for `MyTrait` in `impl MyTrait for Type { ... }`. However we do not do it in non-macro namespaces because we don't have practical issues with e.g. non-traits shadowing traits with the same name, but with macros we do, especially after macro modularization. For `#[test]` and `#[bench]` we have a hack in the compiler right now preventing their shadowing by `macro_rules! test` and similar things. This hack was introduced after making `#[test]`/`#[bench]` built-in macros instead of built-in attributes (https://github.com/rust-lang/rust/pull/53410), something that needed to be done from the start since they are "active" attributes transforming their inputs. Now they are passed through normal name resolution and can be shadowed, but that's a breaking change, so we have a special hack basically applying this PR for `#[test]` and `#[bench]` only. Soon all potentially built-in attributes will be passed through normal name resolution (https://github.com/rust-lang/rust/pull/53913) and that uncovers even more cases where the strict "macro namespace is a single namespace" rule needs to be broken. For example, with strict rules, built-in macro `cfg!(...)` would shadow built-in attribute `#[cfg]` (they are different things), standard library macro `thread_local!(...)` would shadow built-in attribute `#[thread_local]` - both of these cases are covered by special hacks in https://github.com/rust-lang/rust/pull/53913 as well. Crater run uncovered more cases of attributes being shadowed by user-defined macros (`warn`, `doc`, `main`, even `deprecated`), we cannot add exceptions in the compiler for all of them. Regressions with user-defined attributes like https://github.com/rust-lang/rust/issues/53583 and https://github.com/rust-lang/rust/issues/53898 also appeared after enabling macro modularization. People are also usually confused (https://github.com/rust-lang/rust/issues/53205#issuecomment-411552763, https://github.com/rust-lang/rust/issues/53583#issuecomment-415447800) when they see conflicts between attributes and non-attribute macros for the first time. So my proposed solution is to solve this issue by introducing two sub-namespaces and thus skipping resolutions of the wrong kind and preventing more error-causing cases of shadowing. Fixes https://github.com/rust-lang/rust/issues/53583
2018-09-14Auto merge of #54201 - eddyb:reflexive-disambiguation, r=petrochenkovbors-0/+16
rustc_resolve: don't treat uniform_paths canaries as ambiguities unless they resolve to distinct Def's. In particular, this allows this pattern that @cramertj mentioned in https://github.com/rust-lang/rust/issues/53130#issuecomment-420848814: ```rust use log::{debug, log}; fn main() { use log::{debug, log}; debug!(...); } ``` The canaries for the inner `use log::...;`, *in the macro namespace*, see the `log` macro imported at the module scope, and the (same) `log` macro, imported in the block scope inside `main`. Previously, these two possible (macro namspace) `log` resolutions would be considered ambiguous (from a forwards-compat standpoint, where we might make imports aware of block scopes). With this PR, such a case is allowed *if and only if* all the possible resolutions refer to the same definition (more specifically, because the *same* `log` macro is being imported twice). This condition subsumes previous (weaker) checks like #54005 and the second commit of #54011. Only the last commit is the main change, the other two are cleanups. r? @petrochenkov cc @Centril @joshtriplett
2018-09-14Auto merge of #54088 - matthewjasper:use-reason-in-dlle-errors, r=pnkfelixbors-0/+25
[NLL] Suggest let binding Closes #49821 Also adds an alternative to `explain_why_borrow_contains_point` that allows changing error messages based on the reason that will be given. This will also be useful for #51026, #51169 and maybe further changes to does not live long enough messages.
2018-09-14Auto merge of #54080 - PramodBisht:issue/53692, r=estebankbors-0/+51
Addressed #53692 @sunjay @estebank @csmoe hopefully this answer #53692 Please let me know if you have any suggestion
2018-09-14Auto merge of #54032 - oli-obk:layout_scalar_ranges, r=eddybbors-7/+32
Add forever unstable attribute to allow specifying arbitrary scalar ranges r? @eddyb for the first commit and @nikomatsakis for the second one
2018-09-14Rollup merge of #54173 - phansch:suggest_valid_crate_type, r=estebankkennytm-3/+93
Suggest valid crate type if invalid crate type is found This adds a suggestion to the `invalid_crate_types` lint. The suggestion is based on the Levenshtein distance to existing crate types. If no suggestion is found it will show the lint without any suggestions. Closes #53958
2018-09-14Auto merge of #53751 - F001:tuple-struct-self-ctor, r=petrochenkov,varkorbors-34/+216
Implement RFC 2302: tuple_struct_self_ctor Tracking issue: https://github.com/rust-lang/rust/issues/51994
2018-09-14Partially revert 674a5db "Fix undesirable fallout [from macro modularization]"Vadim Petrochenkov-51/+51
2018-09-13Auto merge of #54168 - kennytm:rollup, r=kennytmbors-7/+131
Rollup of 11 pull requests Successful merges: - #53371 (Do not emit E0277 on incorrect tuple destructured binding) - #53829 (Add rustc SHA to released DWARF debuginfo) - #53950 (Allow for opting out of ThinLTO and clean up LTO related cli flag handling.) - #53976 (Replace unwrap calls in example by expect) - #54070 (Add Error::description soft-deprecation to RELEASES) - #54076 (miri loop detector hashing) - #54119 (Add some unit tests for find_best_match_for_name) - #54147 (Add a test that tries to modify static memory at compile-time) - #54150 (Updated 1.29 release notes with --document-private-items flag) - #54163 (Update stage 0 to latest beta) - #54170 (COMPILER_TESTS.md has been moved)
2018-09-13rustc_resolve: don't treat uniform_paths canaries as ambiguities unless they ↵Eduard-Mihai Burtescu-0/+16
resolve to distinct Def's.
2018-09-13Suggest valid crate type if invalidPhilipp Hansch-3/+93
This adds a suggestion to the `invalid_crate_types` lint. The suggestion is based on the Levenshtein distance to existing crate types. If no suggestion is found it will show the lint without any suggestions.
2018-09-13Add "while" tests for issue 54109Vitaly _Vi Shukela-1/+38