Skip to content

feat(final_associated_functions) #26

@matthiaskrgr

Description

@matthiaskrgr

The following code

//@ check-pass

#![feature(final_associated_functions)]

trait Foo {
    final fn bar(&self) {
    ().bar();
}
}

impl Foo for () {}

fn main() {
    final;
}

Compiled successfully ( with --crate-type=lib --cap-lints=warn ):

warning: unnecessary trailing semicolon
  --> ./1540B5266E4098CE31A0C08A835399E2A4F4479F728DDB86D477E510EC7FDE9E.rs:14:5
   |
14 |     final;
   |     ^^^^^^ help: remove this semicolon
   |
   = note: `#[warn(redundant_semicolons)]` (part of `#[warn(unused)]`) on by default

warning: trait `Foo` is never used
 --> ./1540B5266E4098CE31A0C08A835399E2A4F4479F728DDB86D477E510EC7FDE9E.rs:5:7
  |
5 | trait Foo {
  |       ^^^
  |
  = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default

warning: function `main` is never used
  --> ./1540B5266E4098CE31A0C08A835399E2A4F4479F728DDB86D477E510EC7FDE9E.rs:13:4
   |
13 | fn main() {
   |    ^^^^

warning: 3 warnings emitted


However rasur was found to have errors (-e 2015):

error: found `final` but expected statement
  --> ./1540B5266E4098CE31A0C08A835399E2A4F4479F728DDB86D477E510EC7FDE9E.rs:14:5
   |
14 |     final;
   |     ^^^^^ unexpected token

Metadata

Metadata

Assignees

No one assigned

    Labels

    K-bugKind: BugK-upstream-bugKind: A bug in rustc or in the Rust language.S-in-progressStatus: In progress

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions