summary refs log tree commit diff
path: root/src/test/ui/issues
AgeCommit message (Collapse)AuthorLines
2018-10-07Revert "Auto merge of #53793 - toidiu:ak-stabalize, r=nikomatsakis"Ariel Ben-Yehuda-2/+21
This reverts commit 6810f5286b6b91daab06fc3dccb27d8c46f14349, reversing changes made to 8586ec6980462c99a8926646201b2444d8938d29.
2018-10-04do not normalize non-scalar constants to a ConstValue::ScalarPairRalf Jung-0/+12
2018-09-16Auto merge of #54157 - euclio:structured-suggestion, r=estebankbors-26/+29
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-15rustc_resolve: don't allow `::crate_name` to bypass `extern_prelude`.Eduard-Mihai Burtescu-1/+2
2018-09-14Auto merge of #54069 - petrochenkov:subns, r=aturonbors-3/+3
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 #54088 - matthewjasper:use-reason-in-dlle-errors, r=pnkfelixbors-0/+5
[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-13resolve: Introduce two sub-namespaces in macro namespaceVadim Petrochenkov-3/+3
2018-09-12use structured suggestion for "missing mut" labelAndy Russell-26/+29
Fixes #54133.
2018-09-11stabalize infer outlives requirements (RFC 2093).toidiu-21/+2
Co-authored-by: nikomatsakis
2018-09-10resolve: Remove `unshadowable_attrs`Vadim Petrochenkov-4/+3
2018-09-09Suggest a let binding to extend temporary lifetimes with NLLMatthew Jasper-0/+5
2018-09-09Auto merge of #53960 - estebank:issue-51303, r=nagisabors-3/+4
Fix incorrect outer function type parameter message Fix #51303.
2018-09-07Auto merge of #53893 - petrochenkov:cfgexpr, r=pnkfelixbors-13/+0
Validate syntax of `cfg` attributes Fixes https://github.com/rust-lang/rust/issues/53298
2018-09-07Auto merge of #54021 - kennytm:rollup, r=kennytmbors-3/+3
Rollup of 17 pull requests Successful merges: - #53299 (Updated core/macros.rs to note it works in a no_std environment.) - #53376 (Cross reference io::copy and fs::copy in docs.) - #53455 (Individual docs for {from,to}_*_bytes) - #53550 (librustc_lint: In recursion warning, change 'recurring' to 'recursing') - #53860 (Migrate (some) of run-pass/ to ui) - #53874 (Implement Unpin for Box, Rc, and Arc) - #53895 (tidy: Cleanups and clippy warning fixes) - #53946 (Clarify `ManuallyDrop` docs) - #53948 (Minimized clippy test from when NLL disabled two-phase borrows) - #53959 (Add .git extension to submodule paths missing it) - #53966 (A few cleanups and minor improvements to mir/dataflow) - #53967 (propagate build.python into cmake) - #53979 (Remove `#[repr(transparent)]` from atomics) - #53991 (Add unchecked_shl/shr check for intrinsics to fix miri's test suit) - #53992 (migrate run-pass/borrowck to ui/run-pass) - #53994 (migrate run-pass/*/ to ui/run-pass) - #54023 (update clippy submodule)
2018-09-07Auto merge of #53830 - davidtwco:issue-53228, r=nikomatsakisbors-0/+2
Add help message for missing IndexMut impl with NLL Fixes #53228. r? @nikomatsakis
2018-09-07Rollup merge of #53550 - brson:recurring, r=estebankkennytm-3/+3
librustc_lint: In recursion warning, change 'recurring' to 'recursing' The existing wording seems incorrect. Aside: This warning, 'function cannot return without recursing' is not perfectly clear - it implies that the function _can_ return, it's just got to recurse. But really the fn cannot return period. Clearer wording: 'function recurses infinitely; it cannot return'; or 'function is infinitely self-recursive; it cannot return, and this is probably an error'. I like that.
2018-09-06Validate syntax of `--cfg` command line argumentsVadim Petrochenkov-13/+0
2018-09-05slight rewording of labelsEsteban Küber-1/+1
2018-09-05Fix incorrect outer function type parameter messageEsteban Küber-3/+4
2018-09-04Document #[test_case] and #![test_runner]John Renner-2/+2
2018-09-04Introduce Custom Test FrameworksJohn Renner-3/+3
2018-09-03Auto merge of #53865 - zilbuz:issue-52768, r=pnkfelixbors-160/+0
Remove 'not reporting regions error due to nll' warning Fix #52768
2018-09-01Auto merge of #53842 - estebank:various, r=petrochenkovbors-1/+3
Various small diagnostic and code clean up - Point at def span on incorrect `panic` or `oom` function - Use structured suggestion instead of note for `+=` that can be performed on a dereference of the left binding - Small code formatting cleanup
2018-09-01Auto merge of #53884 - kennytm:rollup, r=kennytmbors-26/+39
Rollup of 9 pull requests Successful merges: - #53076 (set cfg(rustdoc) when rustdoc is running on a crate) - #53622 (cleanup: Add main functions to some UI tests) - #53769 (Also link Clippy repo in the CONTRIBUTING.md file) - #53774 (Add rust-gdbgui script.) - #53781 (bench: libcore: fix build failure of any.rs benchmark (use "dyn Any")) - #53782 (Make Arc cloning mechanics clearer in module docs) - #53790 (Add regression test for issue #52060) - #53801 (Prevent duplicated impl on foreign types) - #53850 (Nuke the `const_to_allocation` query)
2018-09-01Rollup merge of #53790 - zilbuz:issue-52060, r=nikomatsakiskennytm-0/+25
Add regression test for issue #52060 Fix #52060
2018-09-01Update testsBasile Desloges-160/+0
2018-08-31cleanup: Add main functions to some UI testsVadim Petrochenkov-26/+14
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-1/+1
2018-08-30Use suggestion for dereference helpEsteban Küber-1/+3
2018-08-30Added help message for missing IndexMut impl.David Wood-0/+2
2018-08-30Add regression test for issue #52060Basile Desloges-0/+25
2018-08-28Auto merge of #53493 - matthewjasper:hair-spans, r=nikomatsakisbors-18/+8
Use smaller span for adjustments on block expressions When returning a mutable reference don't use the entire body of the function as the span for the adjustments at the end. The error [in this case](https://github.com/rust-lang/rust/compare/master...matthewjasper:hair-spans?expand=1#diff-ecef8b1f15622fb48a803c9b61605c78) is worse, but neither error message is really what we want. I have some ideas on how to get a better error message that will have to wait for a future PR.
2018-08-25Auto merge of #53584 - mcr431:Fix-#53525, r=varkorbors-10/+10
Fix #53525 - Unify E0243, E0244, E0087, E0088, E0089, and E0090 into E0107 Fix #53525 This pr merges all errors related to too many or too few generic arguments in types and functions. E0243, E0244, E0087, E0088, E0089, E0090 errors will no longer be emitted and E0107 will be used instead.
2018-08-25Use smaller span for adjustments on block expressionsMatthew Jasper-18/+8
2018-08-24updates tests to use new error codeMatthew Russo-10/+10
2018-08-23Stabilize 'attr_literals' feature.Sergio Benitez-3/+1
2018-08-22Allow panicking with string literal messages inside constantsOliver Schneider-3/+4
2018-08-21Auto merge of #53471 - petrochenkov:biattr2, r=oli-obkbors-6/+6
resolve: Some macro resolution refactoring Work towards completing https://github.com/rust-lang/rust/pull/50911#issuecomment-411605393 The last commit also fixes https://github.com/rust-lang/rust/issues/53269 by not using `def_id()` on `Def::Err` and also fixes https://github.com/rust-lang/rust/issues/53512.
2018-08-21Auto merge of #53530 - kennytm:rollup, r=kennytmbors-9/+13
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-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-3/+3
Fix typos found by codespell.
2018-08-21Rollup merge of #53370 - jkozlowski:stabilize-macro_vis_matcher, r=cramertjkennytm-1/+1
Stabilize macro_vis_matcher This PR should stabilize [macro_vis_matcher](https://github.com/rust-lang/rust/issues/41022) feature. - [ ] "reference" book changes: https://github.com/rust-lang-nursery/reference/pull/400 - [ ] "Rust by example" book changes: https://github.com/rust-lang/rust-by-example/pull/1096 - [ ] "clippy" changes: https://github.com/rust-lang-nursery/rust-clippy/pull/3055 r? @cramertj
2018-08-20librustc_lint: In recursion warning, change 'recurring' to 'recursing'Brian Anderson-3/+3
2018-08-20resolve: Consolidate error reporting for resolved macros in `fn ↵Vadim Petrochenkov-6/+6
resolve_macro_to_def`
2018-08-21Rollup merge of #53296 - estebank:suggest-closure, r=KodrAuskennytm-5/+9
When closure with no arguments was expected, suggest wrapping Fix #49694.
2018-08-20Fix diagnostic regressionvarkor-4/+4
2018-08-19Refactor generic argument count check in astconvvarkor-6/+6
2018-08-19Stabilize macro_vis_matcherJakub Kozlowski-1/+1
2018-08-19Fix typos found by codespell.Matthias Krüger-3/+3
2018-08-19Lift some Sized checks.Masaki Hara-0/+7
2018-08-19Add notes on unsized argument errors.Masaki Hara-0/+4