File: malformed_foreign_on_unimplemented.rs

package info (click to toggle)
rustc 1.85.0%2Bdfsg3-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid, trixie
  • size: 893,396 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,051; perl: 29; lisp: 29; ruby: 19; sql: 11
file content (32 lines) | stat: -rw-r--r-- 1,036 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//@ edition:2021
//@ aux-build:bad_on_unimplemented.rs
//@ reference: attributes.diagnostic.on_unimplemented.syntax

// Do not ICE when encountering a malformed `#[diagnostic::on_unimplemented]` annotation in a
// dependency when incorrectly used (#124651).

extern crate bad_on_unimplemented;

use bad_on_unimplemented::*;

fn missing_attr<T: MissingAttr>(_: T) {}
fn duplicate_attr<T: DuplicateAttr>(_: T) {}
fn not_meta_list<T: NotMetaList>(_: T) {}
fn empty<T: Empty>(_: T) {}
fn wrong_delim<T: WrongDelim>(_: T) {}
fn bad_formatter<T: BadFormatter<()>>(_: T) {}
fn no_implicit_args<T: NoImplicitArgs>(_: T) {}
fn missing_arg<T: MissingArg>(_: T) {}
fn bad_arg<T: BadArg>(_: T) {}

fn main() {
    missing_attr(()); //~ ERROR E0277
    duplicate_attr(()); //~ ERROR E0277
    not_meta_list(()); //~ ERROR E0277
    empty(()); //~ ERROR E0277
    wrong_delim(()); //~ ERROR E0277
    bad_formatter(()); //~ ERROR E0277
    no_implicit_args(()); //~ ERROR E0277
    missing_arg(()); //~ ERROR E0277
    bad_arg(()); //~ ERROR E0277
}