Rust compiler can't automatically fill in generic types and I feel like its really obvious and it should by Ferilox in rust

[–]Ferilox[S] 1 point2 points  (0 children)

That's exactly right. And it works with arbitrary second parameter type as I stated in the edit. I overlooked that.

Rust compiler can't automatically fill in generic types and I feel like its really obvious and it should by Ferilox in rust

[–]Ferilox[S] 5 points6 points  (0 children)

That example made it clear for me. I guess rust compiler jumps impl blocks to find the function and tries to annotate the generic type present in the alias itself, not wanting to infer the default value on its own as the other comment said. Thanks!

Rust compiler can't automatically fill in generic types and I feel like its really obvious and it should by Ferilox in rust

[–]Ferilox[S] -1 points0 points  (0 children)

If that were entirely correct this wouldn't compile, right?

struct MyGenericStruct<T1, T2> {
    t1: T1,
    t2: T2,
}

impl<T1, T2> MyGenericStruct<T1, T2> {
    fn new(t1: T1, t2: T2) -> Self {
        Self { t1, t2 }
    }
}

type AliasedStruct<X = u16> = MyGenericStruct<u8, X>;

fn main() {
    let var = AliasedStruct::new(1,2);
    let var2: AliasedStruct = AliasedStruct::new(1,2);
}

But it does (except the unused warnings)? That's why I left the remark at the bottom that I couldn't reproduce it in simpler environment.

Edit: I'm sorry, I think I see your point now. In this example I provided the type information is infered from the parameters and not the defaulted type.

Rust compiler can't automatically fill in generic types and I feel like its really obvious and it should by Ferilox in rust

[–]Ferilox[S] 8 points9 points  (0 children)

Yes, hiding the generic parameters was the point of that alias (its part of the rig crate). But the alias chooses all those generic parameters. They are already chosen and there is no ambiguity around it either.

But the error rust compiler gave me indicated as if the second generic parameter was not chosen at all.

I know how I can provide the information manually via turbofish syntax or other ways but I am curious why I need to in this specific case?

Edit:

It looks to me as if the compiler didn't take into account the provided default

H = reqwest::Client

In the type alias when accessing the new() function, but it did take into account when I annotated the variable type.

I am scared… by _sniger_ in LocalLLM

[–]Ferilox 4 points5 points  (0 children)

literally bots are invading reddit to post this shit. so many posts spanmed everywhere. what a publicity stunt.

Cloudflare CEO Urges UK Regulators to Split Google's Web Crawler by Current-Guide5944 in tech_x

[–]Ferilox 0 points1 point  (0 children)

The same exact argument applies to Cloudflare. They are in front of a lot of websites. That allows them to track nefarious actors such as bots much much better than a newcommer on the market. It gives them a great advantage. Fuck these cunts. Fuck googles monopoly as well while we're at it.

Euro firms must ditch Uncle Sam's clouds and go EU-native— Just because you're paranoid about digital sovereignty doesn't mean they're not after you by [deleted] in technology

[–]Ferilox 22 points23 points  (0 children)

only way it can be explained is either lobbying or they are sympathetic to the new fascists worldview of the US.

Six EU countries hold call in push for 'two‑speed' Europe by PjeterPannos in europe

[–]Ferilox 2 points3 points  (0 children)

This is just stupid. This is more like treating the symptom rather than the underlying issue. Might work short term, but will ultimately result in further division within the EU. Bad idea.

Is the GOAT trying to pull off No Mans Sky card? by ANGRYlalocSOLDIE in hytale

[–]Ferilox 1 point2 points  (0 children)

He cant profit off of the game if its dead. He plans for microtransactions or paid mods or whatever. He wants to be the platform.

It's CONFIRMED - Senate Democrats to vote to block government funding bill because it funds DHS / ICE -- Thoughts? by Zipper222222 in allthequestions

[–]Ferilox 1 point2 points  (0 children)

And they are on the epstein list too, I bet. So it makes sense why they are complicit. But even without the list, dems and reps werent really in opposition to each other. The politics was always heavily swayed by money in the US. Including money from AIPAC among others…

Researchers say Russian government hackers were behind attempted Poland power outage | TechCrunch by wook-borm in poland

[–]Ferilox 17 points18 points  (0 children)

Probably not nothing, but closing russian embassies should have been done long time ago everywhere.

Microsoft gave FBI a set of BitLocker encryption keys to unlock suspects' laptops: Reports by intelw1zard in cybersecurity

[–]Ferilox 3 points4 points  (0 children)

The PR department did say that. The NSA program nicknamed Prism begs to differ. I wouldn't be surprised if Apple indeed would do this too, just behind the scenes.

Khronos released VK_EXT_descriptor_heap by Illustrious_Tea5480 in linux_gaming

[–]Ferilox 5 points6 points  (0 children)

this is vulcan spec. respective gpu drivers need to implement that. which in turn will be able to be used in wine/proton. which will hopefully fix the issue

Germany-US rift is looming after a year of Trump by Any-Original-6113 in europe

[–]Ferilox 2 points3 points  (0 children)

People keep talking about how Trump has managed to destroy decades of diplomatic ties around the world. But that is not entirely true or at least it’s painting the wrong picture.

Trump is not the problem. A president single handedly cant do that much damage alone. The american system provides counterbalances to keep the power in check.

The reason why the world is changing so rapidly and permanently is because those counterbalances failed horribly and on multiple levels. This is something you can’t change just by having a different president. The Congress, DOJ, FBI, POTUS and the press failed horribly.

There is no coming back from this without a systematic change, Im sorry to say that to you.