about summary refs log tree commit diff
path: root/src/test/ui/rfc-2632-const-trait-impl
AgeCommit message (Collapse)AuthorLines
2021-07-01Use revisions for cross-crate testDeadbeef-22/+6
2021-06-30Add tests for cross-crate usage of `impl const`Deadbeef-0/+84
2021-06-23deny using default function in impl const TraitDeadbeef-0/+42
2021-04-29don't let const_fn feature flag affect impl-block-level trait boundsRalf Jung-9/+5
2021-04-19remove E0723 error codeRalf Jung-2/+1
2021-04-18move 'trait bounds on const fn' to separate feature gateRalf Jung-4/+4
2021-04-06Remove trailing `:` from E0119 messageEsteban Küber-2/+2
2020-12-12Recover on `const impl<> X for Y`Noah-0/+61
2020-11-22Add some more testsJonas Schievink-0/+51
2020-11-22const fn: allow use of trait impls from boundsJonas Schievink-0/+93
2020-09-22Bless testsDylan MacKenzie-15/+9
2020-09-03specialization_graph: avoid trimmed paths for OverlapErrorDan Aloni-2/+2
2020-09-02pretty: trim paths of unique symbolsDan Aloni-4/+4
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-08-22Use smaller def span for functionsAaron Hill-2/+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-08-21Suppress "const" prefix of FnDef in MIR dumpLzu Tao-2/+2
2020-06-28Update testsDylan MacKenzie-10/+8
2020-06-28Update testsDylan MacKenzie-6/+6
2020-04-09Add regression test for #69615Dylan MacKenzie-0/+28
2020-03-05review commentsEsteban Küber-4/+4
2020-03-04Tweak output for invalid negative impl AST errorsEsteban Küber-4/+4
2020-02-19Update testsDylan MacKenzie-6/+28
2020-02-18Add passing test for `Add` on generic structDylan MacKenzie-0/+32
2020-02-18Add ignored test for associated types in const implDylan MacKenzie-0/+28
2020-02-18Test `rustc_const_unstable` on trait fnsDylan MacKenzie-0/+45
2020-02-18Ensure const impl cannot coexist with non-const implDylan MacKenzie-0/+67
2020-02-18Split const trait method test and impl `ops::Add`Dylan MacKenzie-2/+43
2020-02-18Add tests for calling trait methods on concrete typesDylan MacKenzie-38/+78
2020-02-13Constness -> enum Const { Yes(Span), No }Mazdak Farrokhzad-6/+18
Same idea for `Unsafety` & use new span for better diagnostics.
2020-02-09--bless --compare-mode=nllMatthias Prechtl-2/+2
2020-01-20Update testsDylan MacKenzie-94/+49
2020-01-09Add test for `?const` in nested impl/dyn traitDylan MacKenzie-1/+17
2020-01-09Add test for `?const` and `?` on the same boundDylan MacKenzie-0/+22
2020-01-09Add tests for RFC 2632Dylan MacKenzie-0/+321