+use<'_> suggestion and broken terminal output

I had my first encounter with a suggestion relating to +use<'_> usage the other day, and the output looked kind of broken -- partial ansi codes printed to the screen and all that good stuff. I was in a rather annoyed mood (unrelated to the +use<'_>) and just wanted to get the code working, so I didn't check in the code that generated the broken output. I may be able to recreate the situation if there's sufficient interest, but I thought I should at least broadcast to the world that with rustc 1.83.0, on macos/x64, some suggestion relating to +use<'_> will generate some pretty funky output.

Silly question, I suppose, but... What is this syntax?

I haven't run across +use<'_> before ... and couldn't find anything in the documentation about it due to common word not being a useful search term.

Definitely not a silly question -- from the blog for the 1.82.0 release:

Rust now supports use<..> syntax within certain impl Trait bounds to control which generic lifetime parameters are captured.

1 Like

It is a Use Bound, which specifies which (generic) lifetime the trait captures.

1 Like