about summary refs log tree commit diff
path: root/src/test/ui/rfc1445
AgeCommit message (Collapse)AuthorLines
2020-10-15Rename some RFC dirs to be sorted alphabeticallyYuki Okushi-945/+0
2020-09-23Make sure we report a future incompat error in all casesOliver Scherer-12/+20
2020-09-23Make sure we don't hide errors just because a lint has been emittedOliver Scherer-6/+6
2020-09-23Deduplicate errors in const to pat conversionOliver Scherer-42/+7
2020-09-23Talk about unpredictable instead of "not deterministic"Oliver Scherer-2/+2
2020-09-20Use precise errors during const to pat conversion instead of a catch-all on ↵Oliver Scherer-22/+22
the main constant
2020-09-20Lint on function pointers used in patternsOliver Scherer-0/+20
2020-08-22Use smaller def span for functionsAaron Hill-8/+2
Currently, the def span of a funtion encompasses the entire function signature and body. However, this is usually unnecessarily verbose - when we are pointing at an entire function in a diagnostic, we almost always want to point at the signature. The actual contents of the body tends to be irrelevant to the diagnostic we are emitting, and just takes up additional screen space. This commit changes the `def_span` of all function items (freestanding functions, `impl`-block methods, and `trait`-block methods) to be the span of the signature. For example, the function ```rust pub fn foo<T>(val: T) -> T { val } ``` now has a `def_span` corresponding to `pub fn foo<T>(val: T) -> T` (everything before the opening curly brace). Trait methods without a body have a `def_span` which includes the trailing semicolon. For example: ```rust trait Foo { fn bar(); }``` the function definition `Foo::bar` has a `def_span` of `fn bar();` This makes our diagnostic output much shorter, and emphasizes information that is relevant to whatever diagnostic we are reporting. We continue to use the full span (including the body) in a few of places: * MIR building uses the full span when building source scopes. * 'Outlives suggestions' use the full span to sort the diagnostics being emitted. * The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]` attribute points the entire scope body. * The 'unconditional recursion' lint uses the full span to show additional context for the recursive call. All of these cases work only with local items, so we don't need to add anything extra to crate metadata.
2020-04-11rustc: Add a warning count upon completionRoccoDev-1/+11
2020-03-24Remove attribute `#[structural_match]` and any references to itVadim Petrochenkov-32/+32
2020-02-09--bless --compare-mode=nllMatthias Prechtl-2/+2
2020-01-24Normalise notes with the/isvarkor-5/+5
2020-01-09Update testsVadim Petrochenkov-7/+42
2019-11-20Rollup merge of #66060 - traxys:test_65401, r=michaelwoeristerMazdak Farrokhzad-2/+2
Making ICEs and test them in incremental This adds: - A way to make the compiler ICE - A way to check for ICE in `cfail` tests with `should-ice` - A regression test for issue #65401 I am not sure the attribute added `should-ice` is the best for this job
2019-11-05rewrote error messages for #[rustc_error]Quentin Boyer-2/+2
2019-10-25Migrate from `#[structural_match]` attribute a lang-item trait.Felix S. Klock II-6/+27
(Or more precisely, a pair of such traits: one for `derive(PartialEq)` and one for `derive(Eq)`.) ((The addition of the second marker trait, `StructuralEq`, is largely a hack to work-around `fn (&T)` not implementing `PartialEq` and `Eq`; see also issue rust-lang/rust#46989; otherwise I would just check if `Eq` is implemented.)) Note: this does not use trait fulfillment error-reporting machinery; it just uses the trait system to determine if the ADT was tagged or not. (Nonetheless, I have kept an `on_unimplemented` message on the new trait for structural_match check, even though it is currently not used.) Note also: this does *not* resolve the ICE from rust-lang/rust#65466, as noted in a comment added in this commit. Further work is necessary to resolve that and other problems with the structural match checking, especially to do so without breaking stable code (adapted from test fn-ptr-is-structurally-matchable.rs): ```rust fn r_sm_to(_: &SM) {} fn main() { const CFN6: Wrap<fn(&SM)> = Wrap(r_sm_to); let input: Wrap<fn(&SM)> = Wrap(r_sm_to); match Wrap(input) { Wrap(CFN6) => {} Wrap(_) => {} }; } ``` where we would hit a problem with the strategy of unconditionally checking for `PartialEq` because the type `for <'a> fn(&'a SM)` does not currently even *implement* `PartialEq`. ---- added review feedback: * use an or-pattern * eschew `return` when tail position will do. * don't need fresh_expansion; just add `structural_match` to appropriate `allow_internal_unstable` attributes. also fixed example in doc comment so that it actually compiles.
2019-10-25fix typo in filename.Felix S. Klock II-1/+1
2019-10-25fix typo in test.Felix S. Klock II-1/+1
2019-09-13Regression tests for fn ptr and `#[structural_match]` as discussed in #63479.Felix S. Klock II-0/+171
2019-07-17normalize use of backticks in compiler messages for librustc/lintSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-12Change `indirect_structural_match` lint to allow-by-default.Felix S. Klock II-0/+59
This is a way to address the regression aspect of rust-lang/rust#62614 in the short term without actually fixing the bug. (My thinking is that the bug that this lint detects has gone undetected for this long, it can wait a bit longer until I or someone else has a chance to put in a proper fix that accounts for rust-lang/rust#62614.)
2019-07-12Turn `indirect_structural_match` lint on explicitly in ui tests.Felix S. Klock II-11/+31
2019-07-10Auto merge of #62339 - ↵bors-0/+453
pnkfelix:issue-61188-use-visitor-for-structural-match-check, r=nikomatsakis use visitor for #[structural_match] check This changes the code so that we recur down the structure of a type of a const (rather than just inspecting at a shallow one or two levels) when we are looking to see if it has an ADT that did not derive `PartialEq` and `Eq`. Fix #61188 Fix #62307 Cc #62336
2019-07-09normalize use of backticks in compiler messages for libsyntax/feature_gateSamy Kacimi-1/+1
https://github.com/rust-lang/rust/issues/60532
2019-07-08Added test explicitly testing that this PR continues to handle empty arrays ↵Felix S. Klock II-0/+17
in same manner as before.
2019-07-08Regression tests and updates to existing tests.Felix S. Klock II-0/+436
The regression tests explore: (direct | indirect | doubly-indirect | unsafe) x (embedded | param): where: embedded: `struct Wrapper(... NoDerive ...);` param: `struct Wrapper<X>(... X ...);` direct: `const A: Wrapper<...> = Wrapper(NoDerive);` indirect: `const A: & & Wrapper<...> = Wrapper(NoDerive)` doubly-indirect: `const A: & & Wrapper<...> = & & Wrapper(& & NoDerive)` unsafe: `const A: UnsafeWrap<...> = UnsafeWrap(std::ptr::null())`
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-0/+11
2019-04-11Reword tracking issue noteEsteban Küber-1/+1
2019-04-10Tweak unstable diagnostic outputEsteban Küber-1/+2
2019-03-17Updated UI test output to remove test annotations for revisionsMathias Blikstad-2/+2
2018-12-25Remove licensesMark Rousskov-35/+5
2018-11-10make PhantomData #[structural_match].Mazdak Farrokhzad-0/+53
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+154